From 467bbb00c20d79ecdd383b39aa1ced2734fcb33e Mon Sep 17 00:00:00 2001 From: Heberto Mayorquin Date: Tue, 5 Dec 2023 13:13:26 +0100 Subject: [PATCH 1/3] avoid parsing the file twice --- .../tiffimagingextractors/brukertiffimagingextractor.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/roiextractors/extractors/tiffimagingextractors/brukertiffimagingextractor.py b/src/roiextractors/extractors/tiffimagingextractors/brukertiffimagingextractor.py index e307d826..f4f10180 100644 --- a/src/roiextractors/extractors/tiffimagingextractors/brukertiffimagingextractor.py +++ b/src/roiextractors/extractors/tiffimagingextractors/brukertiffimagingextractor.py @@ -159,17 +159,20 @@ def __init__( tif_file_paths = list(folder_path.glob("*.ome.tif")) assert tif_file_paths, f"The TIF image files are missing from '{folder_path}'." - assert _determine_imaging_is_volumetric(folder_path=folder_path), ( + streams = self.get_streams(folder_path=folder_path) + plane_streams = streams["plane_streams"] + + assert len(plane_streams) == 0 ( f"{self.extractor_name}Extractor is for volumetric imaging. " "For single imaging plane data use BrukerTiffSinglePlaneImagingExtractor." ) - streams = self.get_streams(folder_path=folder_path) if stream_name is None: if len(streams["channel_streams"]) > 1: raise ValueError( "More than one recording stream is detected! Please specify which stream you wish to load with the `stream_name` argument. " - "To see what streams are available, call `BrukerTiffMultiPlaneImagingExtractor.get_stream_names(folder_path=...)`." + "The following channel streams are available: \n" + f"{streams['channel_streams']}" ) channel_stream_name = streams["channel_streams"][0] stream_name = streams["plane_streams"][channel_stream_name][0] From 0d15c8920ded9afc0aa37ecf9296ba2d1e9ac25a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 5 Dec 2023 12:15:46 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../tiffimagingextractors/brukertiffimagingextractor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/roiextractors/extractors/tiffimagingextractors/brukertiffimagingextractor.py b/src/roiextractors/extractors/tiffimagingextractors/brukertiffimagingextractor.py index f4f10180..bb26c5d2 100644 --- a/src/roiextractors/extractors/tiffimagingextractors/brukertiffimagingextractor.py +++ b/src/roiextractors/extractors/tiffimagingextractors/brukertiffimagingextractor.py @@ -162,7 +162,7 @@ def __init__( streams = self.get_streams(folder_path=folder_path) plane_streams = streams["plane_streams"] - assert len(plane_streams) == 0 ( + assert len(plane_streams) == 0( f"{self.extractor_name}Extractor is for volumetric imaging. " "For single imaging plane data use BrukerTiffSinglePlaneImagingExtractor." ) From 9156e8c8bca88f8dae9b9bf2d743545829fd1c77 Mon Sep 17 00:00:00 2001 From: Heberto Mayorquin Date: Tue, 5 Dec 2023 13:19:08 +0100 Subject: [PATCH 3/3] missed a comma --- .../tiffimagingextractors/brukertiffimagingextractor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/roiextractors/extractors/tiffimagingextractors/brukertiffimagingextractor.py b/src/roiextractors/extractors/tiffimagingextractors/brukertiffimagingextractor.py index bb26c5d2..7062d75e 100644 --- a/src/roiextractors/extractors/tiffimagingextractors/brukertiffimagingextractor.py +++ b/src/roiextractors/extractors/tiffimagingextractors/brukertiffimagingextractor.py @@ -162,7 +162,7 @@ def __init__( streams = self.get_streams(folder_path=folder_path) plane_streams = streams["plane_streams"] - assert len(plane_streams) == 0( + assert len(plane_streams) > 0, ( f"{self.extractor_name}Extractor is for volumetric imaging. " "For single imaging plane data use BrukerTiffSinglePlaneImagingExtractor." )