Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandratrapani committed Oct 28, 2024
1 parent 2e57187 commit c236951
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
17 changes: 17 additions & 0 deletions src/cai_lab_to_nwb/zaki_2024/zaki_2024_metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
21 changes: 0 additions & 21 deletions src/cai_lab_to_nwb/zaki_2024/zaki_2024_nwbconverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 0 additions & 17 deletions src/cai_lab_to_nwb/zaki_2024/zaki_2024_ophys_metadata.yaml

This file was deleted.

0 comments on commit c236951

Please sign in to comment.