Source code for neuroconv.datainterfaces.ophys.micromanagertiff.micromanagertiffdatainterface
from dateutil.parser import parse
from pydantic import DirectoryPath, validate_call
from ..baseimagingextractorinterface import BaseImagingExtractorInterface
[docs]class MicroManagerTiffImagingInterface(BaseImagingExtractorInterface):
"""Data Interface for MicroManagerTiffImagingExtractor."""
display_name = "Micro-Manager TIFF Imaging"
associated_suffixes = (".ome", ".tif", ".json")
info = "Interface for Micro-Manager TIFF imaging data."
[docs] @classmethod
def get_source_schema(cls) -> dict:
"""
Get the source schema for the Micro-Manager TIFF imaging interface.
Returns
-------
dict
The schema dictionary containing input parameters and descriptions
for initializing the Micro-Manager TIFF interface.
"""
source_schema = super().get_source_schema()
source_schema["properties"]["folder_path"]["description"] = "The folder containing the OME-TIF image files."
return source_schema
@validate_call
def __init__(self, folder_path: DirectoryPath, verbose: bool = False):
"""
Data Interface for MicroManagerTiffImagingExtractor.
Parameters
----------
folder_path : FolderPathType
The folder path that contains the OME-TIF image files (.ome.tif files) and
the 'DisplaySettings' JSON file.
verbose : bool, default: False
"""
super().__init__(folder_path=folder_path)
self.verbose = verbose
# Micro-Manager uses "Default" as channel name, for clarity we rename it to 'OpticalChannelDefault'
channel_name = self.imaging_extractor._channel_names[0]
self.imaging_extractor._channel_names = [f"OpticalChannel{channel_name}"]