From 735a866aa5e82dc7ffbf6cb81ad39d58678ba053 Mon Sep 17 00:00:00 2001 From: Paul Adkisson Date: Wed, 18 Sep 2024 01:55:38 +1000 Subject: [PATCH] Added specific error message for single-frame scanimage data (#360) * added specific notimplementederror for single-frame case * updated changelog --- CHANGELOG.md | 13 ++++++++++++- .../scanimagetiffimagingextractor.py | 7 ++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62d7ec67..562a132f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,15 @@ -# Upcoming (v0.5.9) +# Upcoming (v0.5.10) + +### Features + +### Fixes +* Added specific error message for single-frame scanimage data [PR #360](https://github.com/catalystneuro/roiextractors/pull/360) + +### Improvements + +### Testing + +# v0.5.9 ### Deprecations diff --git a/src/roiextractors/extractors/tiffimagingextractors/scanimagetiffimagingextractor.py b/src/roiextractors/extractors/tiffimagingextractors/scanimagetiffimagingextractor.py index bdc1bc38..155ace8f 100644 --- a/src/roiextractors/extractors/tiffimagingextractors/scanimagetiffimagingextractor.py +++ b/src/roiextractors/extractors/tiffimagingextractors/scanimagetiffimagingextractor.py @@ -299,7 +299,12 @@ def __init__( ScanImageTiffReader = _get_scanimage_reader() with ScanImageTiffReader(str(self.file_path)) as io: shape = io.shape() # [frames, rows, columns] - if len(shape) == 3: + if len(shape) == 2: # [rows, columns] + raise NotImplementedError( + "Extractor cannot handle single-frame ScanImageTiff data. Please raise an issue to request this feature: " + "https://github.com/catalystneuro/roiextractors/issues " + ) + elif len(shape) == 3: self._total_num_frames, self._num_rows, self._num_columns = shape if ( self._num_planes == 1