Skip to content

Commit

Permalink
Added legacy metadata parsing function
Browse files Browse the repository at this point in the history
  • Loading branch information
pauladkisson committed Sep 19, 2023
1 parent 84c1946 commit c3fcfea
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,35 @@ def parse_metadata(metadata):
return metadata_parsed


def parse_metadata_v3_8(metadata):
"""Parse metadata dictionary to extract relevant information and store it standard keys for ImagingExtractors.
Requires old version of metadata (v3.8).
Currently supports
- sampling frequency
- num_channels
- num_planes
Parameters
----------
metadata : dict
Dictionary of metadata extracted from the TIFF file.
Returns
-------
metadata_parsed: dict
Dictionary of parsed metadata.
"""
sampling_frequency = float(metadata["state.acq.frameRate"])
num_channels = int(metadata["state.acq.numberOfChannelsSave"])
num_planes = int(metadata["state.acq.numberOfZSlices"])
metadata_parsed = dict(
sampling_frequency=sampling_frequency,
num_channels=num_channels,
num_planes=num_planes,
)


class MultiPlaneImagingExtractor(ImagingExtractor):
"""Class to combine multiple ImagingExtractor objects by depth plane."""

Expand Down

0 comments on commit c3fcfea

Please sign in to comment.