InscopixSegmentationExtractor#
Inscopix Segmentation Extractor.
- class InscopixSegmentationExtractor(file_path: str | Path)[source]#
Bases:
SegmentationExtractorA segmentation extractor for Inscopix.
Initialize a InscopixSegmentationExtractor instance.
Main class for extracting segmentation data from Inscopix format.
- Parameters:
file_path (str or Path) – The location of the folder containing Inscopix *.mat output file.
- get_num_rois() int[source]#
Get total number of Regions of Interest (ROIs) in the acquired images.
- Returns:
num_rois – The number of ROIs extracted.
- Return type:
int
- get_frame_shape() tuple[int, int][source]#
Get frame size of movie (height, width).
- Returns:
frame_shape – 2-D array: image height x image width
- Return type:
array_like
- get_accepted_list() list[source]#
Get a list of accepted ROI ids.
- Returns:
accepted_list – List of accepted ROI ids.
- Return type:
list
- get_rejected_list() list[source]#
Get a list of rejected ROI ids.
- Returns:
rejected_list – List of rejected ROI ids.
- Return type:
list
- get_traces(roi_ids=None, start_frame=None, end_frame=None, name='raw') ndarray[source]#
Get traces for the specified ROIs.
- Parameters:
roi_ids (list or None) – List of ROI IDs (can be integers or string IDs)
start_frame (int or None) – Start frame index
end_frame (int or None) – End frame index
name (str) – Name of the trace type
- Returns:
Traces for the specified ROIs
- Return type:
np.ndarray
- get_num_samples() int[source]#
Get the number of samples in the recording (duration of recording).
- Returns:
num_samples – Number of samples in the recording.
- Return type:
int
- get_sampling_frequency() float[source]#
Get the sampling frequency in Hz.
- Returns:
sampling_frequency – Sampling frequency of the recording in Hz.
- Return type:
float
- get_native_timestamps(start_sample: int | None = None, end_sample: int | None = None) ndarray | None[source]#
Get the original timestamps from the data source.
- Parameters:
start_sample (int, optional) – Start sample index (inclusive).
end_sample (int, optional) – End sample index (exclusive).
- Returns:
timestamps – The original timestamps in seconds, or None if not available.
- Return type:
np.ndarray or None