Skip to content

Commit

Permalink
prepopulate private attribute for image mask; rearrange abstract method
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyCBakerPhD authored May 15, 2024
1 parent 22ccdad commit 1d8177b
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/roiextractors/segmentationextractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class SegmentationExtractor(ABC):
"""

def __init__(self):
"""Create a new SegmentationExtractor from specified data type (unique to each child SegmentationExtractor)."""
"""Create a new SegmentationExtractor for a specific data format (unique to each child SegmentationExtractor)."""
self._sampling_frequency = None
self._times = None
self._channel_names = ["OpticalChannel"]
Expand All @@ -44,6 +44,7 @@ def __init__(self):
self._roi_response_deconvolved = None
self._image_correlation = None
self._image_mean = None
self._image_mask = None

@abstractmethod
def get_accepted_list(self) -> list:
Expand All @@ -67,6 +68,17 @@ def get_rejected_list(self) -> list:
"""
pass

@abstractmethod
def get_image_size(self) -> ArrayType:
"""Get frame size of movie (height, width).
Returns
-------
no_rois: array_like
2-D array: image height x image width
"""
pass

def get_num_frames(self) -> int:
"""Get the number of frames in the recording (duration of recording).
Expand Down Expand Up @@ -204,17 +216,6 @@ def get_background_pixel_masks(self, background_ids=None) -> np.array:

return _pixel_mask_extractor(self.get_background_image_masks(background_ids=background_ids), background_ids)

@abstractmethod
def get_image_size(self) -> ArrayType:
"""Get frame size of movie (height, width).
Returns
-------
no_rois: array_like
2-D array: image height x image width
"""
pass

def frame_slice(self, start_frame: Optional[int] = None, end_frame: Optional[int] = None):
"""Return a new SegmentationExtractor ranging from the start_frame to the end_frame.
Expand Down

0 comments on commit 1d8177b

Please sign in to comment.