Skip to content

Commit

Permalink
Added deprecation warning to legacy scanimage extractor
Browse files Browse the repository at this point in the history
  • Loading branch information
pauladkisson committed Sep 19, 2023
1 parent 80ec40c commit bc4fafe
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def __init__(
), "All imaging extractors must have the same number of planes."


class ScanImageTiffSinglePlaneImagingExtractor(ImagingExtractor): # TODO: Remove this extractor on/after December 2023
class ScanImageTiffSinglePlaneImagingExtractor(ImagingExtractor):
"""Specialized extractor for reading TIFF files produced via ScanImage."""

extractor_name = "ScanImageTiffImaging"
Expand Down Expand Up @@ -338,12 +338,6 @@ def __init__(
plane : int, optional
Index of the depth plane for this extractor (default=0).
"""
deprecation_message = """
This extractor is being deprecated on or after December 2023 in favor of
ScanImageTiffMultiPlaneImagingExtractor or ScanImageTiffSinglePlaneImagingExtractor. Please use one of these
extractors instead.
"""
warn(deprecation_message, category=FutureWarning)
super().__init__()
self.file_path = Path(file_path)
self.channel = channel
Expand All @@ -356,9 +350,9 @@ def __init__(
self._frames_per_slice = parsed_metadata["frames_per_slice"]
self._channel_names = parsed_metadata["channel_names"]
if channel >= self._num_channels:
raise ValueError(f"Channel index ({channel}) exceeds number of channels ({num_channels}).")
raise ValueError(f"Channel index ({channel}) exceeds number of channels ({self._num_channels}).")
if plane >= self._num_planes:
raise ValueError(f"Plane index ({plane}) exceeds number of planes ({num_planes}).")
raise ValueError(f"Plane index ({plane}) exceeds number of planes ({self._num_planes}).")
if self._frames_per_slice != 1:
raise NotImplementedError(
"Extractor cannot handle multiple frames per slice. Please raise an issue to request this feature: "
Expand Down Expand Up @@ -509,7 +503,7 @@ def frame_to_raw_index(self, frame):
return raw_index


class ScanImageTiffImagingExtractor(ImagingExtractor):
class ScanImageTiffImagingExtractor(ImagingExtractor): # TODO: Remove this extractor on/after December 2023
"""Specialized extractor for reading TIFF files produced via ScanImage.
This implementation is for legacy purposes and is not recommended for use.
Expand Down Expand Up @@ -538,6 +532,12 @@ def __init__(
sampling_frequency : float
The frequency at which the frames were sampled, in Hz.
"""
deprecation_message = """
This extractor is being deprecated on or after December 2023 in favor of
ScanImageTiffMultiPlaneImagingExtractor or ScanImageTiffSinglePlaneImagingExtractor. Please use one of these
extractors instead.
"""
warn(deprecation_message, category=FutureWarning)
ScanImageTiffReader = _get_scanimage_reader()

super().__init__()
Expand Down

0 comments on commit bc4fafe

Please sign in to comment.