From 3927a4cb0c9c0b687eda6e416e81816be4fb9d2b Mon Sep 17 00:00:00 2001 From: Ben Dichter Date: Wed, 15 May 2024 18:38:50 -0500 Subject: [PATCH] add MultiPageMultiTiffImagingInterface --- .../ophys/tiff/tiffdatainterface.py | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/neuroconv/datainterfaces/ophys/tiff/tiffdatainterface.py b/src/neuroconv/datainterfaces/ophys/tiff/tiffdatainterface.py index 47eab03f6..7a658915c 100644 --- a/src/neuroconv/datainterfaces/ophys/tiff/tiffdatainterface.py +++ b/src/neuroconv/datainterfaces/ophys/tiff/tiffdatainterface.py @@ -1,5 +1,5 @@ from ..baseimagingextractorinterface import BaseImagingExtractorInterface -from ....utils import FilePathType +from ....utils import FilePathType, FolderPathType class TiffImagingInterface(BaseImagingExtractorInterface): @@ -26,3 +26,33 @@ def __init__(self, file_path: FilePathType, sampling_frequency: float, verbose: verbose : bool, default: True """ super().__init__(file_path=file_path, sampling_frequency=sampling_frequency, verbose=verbose) + + +class MultiPageMultiTiffImagingInterface(BaseImagingExtractorInterface): + """Interface for multi-page multi-TIFF files.""" + + display_name = "Multi-Page Multi-TIFF" + associated_suffixes = (".tif", ".tiff") + info = "Interface for multiple multi-page TIFF files that have been split." + + @classmethod + def get_source_schema(cls) -> dict: + source_schema = super().get_source_schema() + source_schema["properties"]["file_path"]["description"] = "Path to Tiff directory." + return source_schema + + def __init__(self, folder_path: FolderPathType, pattern: str, sampling_frequency: float, verbose: bool = True): + """ + Initialize reading of multi-page multi-TIFF file. + + Parameters + ---------- + folder_path : FolderPathType + pattern: str + fstring-style pattern to match the TIFF files. Must use named variables. + sampling_frequency : float + verbose : bool, default: True + """ + super().__init__( + folder_path=folder_path, pattern=pattern, sampling_frequency=sampling_frequency, verbose=verbose + )