diff --git a/src/cai_lab_to_nwb/zaki_2024/interfaces/miniscope_imaging_interface.py b/src/cai_lab_to_nwb/zaki_2024/interfaces/miniscope_imaging_interface.py index f42ce4f..db2e362 100644 --- a/src/cai_lab_to_nwb/zaki_2024/interfaces/miniscope_imaging_interface.py +++ b/src/cai_lab_to_nwb/zaki_2024/interfaces/miniscope_imaging_interface.py @@ -248,16 +248,14 @@ def get_metadata(self) -> DeepDict: device_metadata = metadata["Ophys"]["Device"][0] miniscope_config = deepcopy(self._miniscope_config) - device_name = miniscope_config.pop("name") + miniscope_config.pop("name") description = ( "The Miniscope is the head-mounted miniature microscope part of the UCLA Miniscope imaging platform." ) device_metadata.update(description=description, **miniscope_config) # Add link to Device for ImagingPlane imaging_plane_metadata = metadata["Ophys"]["ImagingPlane"][0] - imaging_plane_metadata.update( - imaging_rate=self._metadata_frame_rate, - ) + imaging_plane_metadata.update(imaging_rate=self._metadata_frame_rate) one_photon_series_metadata = metadata["Ophys"]["OnePhotonSeries"][0] one_photon_series_metadata.update(unit="px") diff --git a/src/cai_lab_to_nwb/zaki_2024/zaki_2024_convert_conditioning_session.py b/src/cai_lab_to_nwb/zaki_2024/zaki_2024_convert_conditioning_session.py index 76324b5..6271290 100644 --- a/src/cai_lab_to_nwb/zaki_2024/zaki_2024_convert_conditioning_session.py +++ b/src/cai_lab_to_nwb/zaki_2024/zaki_2024_convert_conditioning_session.py @@ -104,10 +104,7 @@ def session_to_nwb( else: print("No .edf file found at {}".format(edf_file_path)) - ophys_metadata_path = Path(__file__).parent / "zaki_2024_ophys_metadata.yaml" - ophys_metadata = load_dict_from_file(ophys_metadata_path) - - converter = Zaki2024NWBConverter(source_data=source_data, ophys_metadata=ophys_metadata) + converter = Zaki2024NWBConverter(source_data=source_data) # Add datetime to conversion metadata = converter.get_metadata() diff --git a/src/cai_lab_to_nwb/zaki_2024/zaki_2024_metadata.yaml b/src/cai_lab_to_nwb/zaki_2024/zaki_2024_metadata.yaml index e89724c..bf535e7 100644 --- a/src/cai_lab_to_nwb/zaki_2024/zaki_2024_metadata.yaml +++ b/src/cai_lab_to_nwb/zaki_2024/zaki_2024_metadata.yaml @@ -39,3 +39,20 @@ Subject: species: Mus musculus age: P12W/P15W # in ISO 8601, such as "P1W2D" sex: U # One of M, F, U, or O +Ophys: + OnePhotonSeries: + - name: OnePhotonSeries + description: Imaging data from Miniscope. + imaging_plane: ImagingPlane + unit: n.a. + ImagingPlane: + - name: ImagingPlane + description: Imaging plane for Miniscope imaging data. + excitation_lambda: 496.0 + location: CA1 + device: Microscope + optical_channel: + - name: OpticalChannel + description: Green channel of the microscope. + emission_lambda: 513.0 + indicator: GCaMP6f \ No newline at end of file diff --git a/src/cai_lab_to_nwb/zaki_2024/zaki_2024_nwbconverter.py b/src/cai_lab_to_nwb/zaki_2024/zaki_2024_nwbconverter.py index b07e150..e26bbe3 100644 --- a/src/cai_lab_to_nwb/zaki_2024/zaki_2024_nwbconverter.py +++ b/src/cai_lab_to_nwb/zaki_2024/zaki_2024_nwbconverter.py @@ -30,27 +30,6 @@ class Zaki2024NWBConverter(NWBConverter): Video=VideoInterface, ) - def __init__( - self, - source_data: Dict[str, dict], - verbose: bool = True, - ophys_metadata=Dict[str, dict], - ): - self.verbose = verbose - self._validate_source_data(source_data=source_data, verbose=self.verbose) - self.data_interface_objects = { - name: data_interface(**source_data[name]) - for name, data_interface in self.data_interface_classes.items() - if name in source_data - } - self.ophys_metadata = ophys_metadata - - def get_metadata(self) -> DeepDict: - metadata = super().get_metadata() - metadata["Ophys"]["OnePhotonSeries"] = self.ophys_metadata["Ophys"]["OnePhotonSeries"] - metadata["Ophys"]["ImagingPlane"] = self.ophys_metadata["Ophys"]["ImagingPlane"] - return metadata - """ # TODO decide which datastream set the session start time diff --git a/src/cai_lab_to_nwb/zaki_2024/zaki_2024_ophys_metadata.yaml b/src/cai_lab_to_nwb/zaki_2024/zaki_2024_ophys_metadata.yaml deleted file mode 100644 index 2b4e289..0000000 --- a/src/cai_lab_to_nwb/zaki_2024/zaki_2024_ophys_metadata.yaml +++ /dev/null @@ -1,17 +0,0 @@ -Ophys: - OnePhotonSeries: - - name: OnePhotonSeries - description: Imaging data from Miniscope. - imaging_plane: ImagingPlane - unit: n.a. - ImagingPlane: - - name: ImagingPlane - description: Imaging plane for Miniscope imaging data. - excitation_lambda: 496.0 - location: CA1 - device: Microscope - optical_channel: - - name: OpticalChannel - description: Green channel of the microscope. - emission_lambda: 513.0 - indicator: GCaMP6f \ No newline at end of file