Skip to content

Commit

Permalink
use frame rate from metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
h-mayorquin committed Oct 22, 2024
1 parent 6196ac4 commit ae83880
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/cai_lab_to_nwb/zaki_2024/imaginginterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,13 @@ def __init__(self, folder_path: DirectoryPath):
self.session_folder = self.miniscope_folder.parent

self._miniscope_config = read_miniscope_config(folder_path=self.miniscope_folder)


# use the frame rate of the json configuration to set the metadata
frame_rate_string = self._miniscope_config["frameRate"]
# frame_rate_string look like "30.0FPS", extract the float part
self._metadata_frame_rate = float(frame_rate_string.split("FPS")[0])


self.photon_series_type = "OnePhotonSeries"

def _get_session_start_time(self):
Expand Down Expand Up @@ -244,7 +250,7 @@ def get_metadata(self) -> DeepDict:
imaging_plane_metadata = metadata["Ophys"]["ImagingPlane"][0]
imaging_plane_metadata.update(
device=device_name,
imaging_rate=self.imaging_extractor.get_sampling_frequency(),
imaging_rate=self._metadata_frame_rate,
)
one_photon_series_metadata = metadata["Ophys"]["OnePhotonSeries"][0]
one_photon_series_metadata.update(unit="px")
Expand Down

0 comments on commit ae83880

Please sign in to comment.