deepcinac.cinac_structures
¶
Module Contents¶
Classes¶
Helper class that provides a standard way to create an ABC using |
|
Take the movie as a 2d array directly |
|
Helper class that provides a standard way to create an ABC using |
|
Helper class that provides a standard way to create an ABC using |
|
Used if tiff movie has been splitted as as many tiff files as frames in the movie |
|
Used if tiff movie has been splitted as as many tiff files as frames in the movie |
|
Functions¶
|
|
|
|
-
class
deepcinac.cinac_structures.
CinacMovie
¶ Bases:
abc.ABC
Helper class that provides a standard way to create an ABC using inheritance.
-
abstract
get_frames_section
(self, frames, minx, maxx, miny, maxy)¶
-
get_dimensions
(self)¶ Get x and y dimensions of the movie Returns: a 1d array of integers
-
get_n_frames
(self)¶ The number of frames in the movie Returns: integer
-
abstract
get_full_movie
(self, normalized)¶ Full movie, if available a 3d array n_frames x len_y x len_x :param normalized: bool, if True return normalized movie, False original movie if available
Returns:
-
abstract
-
class
deepcinac.cinac_structures.
CinacDataMovie
(movie, already_normalized=False)¶ Bases:
deepcinac.cinac_structures.CinacMovie
Take the movie as a 2d array directly
-
get_frames_section
(self, frames, minx, maxx, miny, maxy)¶
-
get_full_movie
(self, normalized)¶ Full movie, if available a 3d array n_frames x len_y x len_x :param normalized: bool, if True return normalized movie, False original movie if available
Returns:
-
-
class
deepcinac.cinac_structures.
CinacTiffMovie
(tiff_file_name=None, tiff_movie=None)¶ Bases:
deepcinac.cinac_structures.CinacMovie
Helper class that provides a standard way to create an ABC using inheritance.
-
get_frames_section
(self, frames, minx, maxx, miny, maxy)¶
-
get_full_movie
(self, normalized)¶ Full movie, if available a 3d array n_frames x len_y x len_x :param normalized: bool, if True return normalized movie, False original movie if available
Returns:
-
-
class
deepcinac.cinac_structures.
CinacFileReaderMovie
(cinac_file_reader, segment)¶ Bases:
deepcinac.cinac_structures.CinacMovie
Helper class that provides a standard way to create an ABC using inheritance.
-
get_frames_section
(self, frames, minx, maxx, miny, maxy)¶
-
get_full_movie
(self, normalized)¶ Full movie, if available a 3d array n_frames x len_y x len_x :param normalized: bool, if True return normalized movie, False original movie if available
Returns:
-
-
class
deepcinac.cinac_structures.
CinacSplitedTiffMovie
(identifier, tiffs_dirname, already_normalized=False, tiff_file_name=None, tiff_movie=None)¶ Bases:
deepcinac.cinac_structures.CinacMovie
Used if tiff movie has been splitted as as many tiff files as frames in the movie
-
get_frames_section
(self, frames_indices, minx, maxx, miny, maxy)¶ get section of given frames from the calcium imaging movie :param frames_indices: numpy array of integers, representing the frame’s indices to select :param minx: integer, min x coordinate :param maxx: integer, max x coordinate :param miny: integer, min y coordinate :param maxy: integer, max y coordinate
Returns:
-
get_full_movie
(self, normalized)¶ Full movie, if available a 3d array n_frames x len_y x len_x :param normalized: bool, if True return normalized movie, False original movie if available
Returns:
-
-
class
deepcinac.cinac_structures.
CinacSplitedNpyMovie
(identifier, tiffs_dirname, already_normalized=False, tiff_file_name=None, tiff_movie=None)¶ Bases:
deepcinac.cinac_structures.CinacMovie
Used if tiff movie has been splitted as as many tiff files as frames in the movie
-
get_frames_section
(self, frames_indices, minx, maxx, miny, maxy)¶ get section of given frames from the calcium imaging movie :param frames_indices: numpy array of integers, representing the frame’s indices to select :param minx: integer, min x coordinate :param maxx: integer, max x coordinate :param miny: integer, min y coordinate :param maxy: integer, max y coordinate
Returns:
-
get_full_movie
(self, normalized)¶ Full movie, if available a 3d array n_frames x len_y x len_x :param normalized: bool, if True return normalized movie, False original movie if available
Returns:
-
-
deepcinac.cinac_structures.
get_cinac_movie_from_cinac_file_reader
(cinac_file_reader)¶ - Parameters
cinac_file_reader – CinacFileReader instance
Returns:
-
deepcinac.cinac_structures.
create_cinac_recording_from_cinac_file_segment
(identifier, cinac_file_reader, segment)¶ - Parameters
identifier – cinac_recording identifier
cinac_file_reader – CinacFileReaderInstance
cinac_movie – CinacMovie instance
segment – tuple of 3 int (cell, first_frame, last_frame
Returns:
-
class
deepcinac.cinac_structures.
CinacRecording
(identifier)¶ -
_build_traces
(self)¶
-
get_raw_traces
(self, normalized)¶ - Parameters
normalized – if True, get the raw_traces normalized
Returns:
-
get_smooth_traces
(self, normalized)¶ - Parameters
normalized – if True, get the raw_traces normalized
Returns:
-
set_movie
(self, cinac_movie)¶ Set the instance of CinacMovie, that will be used to get the frames given to the network :param cinac_movie:
Returns:
-
set_rois_from_suite_2p
(self, is_cell_file_name, stat_file_name)¶ - Parameters
is_cell_file_name – path and file_name of the file iscell.npy produce by suite2p segmentation process
stat_file_name – path and file_name of the file stat.npy produce by suite2p segmentation process
Returns:
-
set_rois_2d_array
(self, coord, from_matlab)¶ - Parameters
coord – numpy array of 2d, first dimension of length 2 (x and y) and 2nd dimension of length the number of
Could also be a list of lists or tuples of 2 integers (cells.) –
from_matlab – Indicate if the data has been computed by matlab, then 1 will be removed to the coordinates
it starts at zero. (so) –
Returns:
-
set_rois_from_nwb
(self, nwb_data, name_module, name_segmentation, name_seg_plane)¶ - Parameters
nwb_data – nwb object instance
name_module – Name of the module to find segmentation. Will be used this way: nwb_data.modules[name_module] Ex: name_module = ‘ophys’
name_segmentation – Name of the segmentation in which find the plane segmentation. Used this way:get_plane_segmentation(name_segmentation) Ex: name_segmentation = ‘segmentation_suite2p’
name_seg_plane – Name of the segmentation plane in which to find the ROIs data
this way (Used) – mod[name_segmentation]get_plane_segmentation(name_seq_plane) Ex: name_segmentation = ‘my_plane_seg’
Returns:
-
set_rois_using_pixel_mask
(self, pixel_masks)¶ - Parameters
pixel_masks – list of list of 2 integers representing for each cell all the pixels that belongs to the cell
Returns:
-
get_n_frames
(self)¶ Return the number of frames in the movie Returns:
-
get_n_cells
(self)¶
-
get_source_profile_frames
(self, frames_indices, coords)¶ Return frames section based on the indices of the frames and the coordinates of the corners of the section :param frames_indices: array of integers :param coords: tuple of 4 integers: (minx, maxx, miny, maxy)
Returns: A numpy array of dimensions len(frames_indices) * (maxy - miny + 1) * (maxx - minx + 1)
-