-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from catalystneuro/add_suite2p
Add suite2p interface
- Loading branch information
Showing
3 changed files
with
57 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 21 additions & 4 deletions
25
src/higley_lab_to_nwb/benisty_2024/benisty_2024_nwbconverter.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,29 @@ | ||
"""Primary NWBConverter class for this dataset.""" | ||
|
||
from typing import Dict, List | ||
from typing import Dict | ||
from neuroconv import NWBConverter | ||
|
||
|
||
from neuroconv.datainterfaces import ScanImageMultiFileImagingInterface, Suite2pSegmentationInterface | ||
from neuroconv.utils import DeepDict | ||
|
||
class Benisty2024NWBConverter(NWBConverter): | ||
"""Primary conversion class.""" | ||
|
||
data_interface_classes = dict( | ||
) | ||
TwoPhotonImagingGreenChannel=ScanImageMultiFileImagingInterface, | ||
SegmentationGreenChannel=Suite2pSegmentationInterface, | ||
) | ||
def __init__(self, source_data: Dict[str, dict],ophys_metadata: Dict[str, dict], verbose: bool = True): | ||
super().__init__(source_data, verbose) | ||
self.ophys_metadata=ophys_metadata | ||
|
||
def get_metadata(self) -> DeepDict: | ||
metadata = super().get_metadata() | ||
segmentation_metadata = self.data_interface_objects["SegmentationGreenChannel"].get_metadata() | ||
for segmentation_metadata_ind in range(len(segmentation_metadata["Ophys"]["ImageSegmentation"]["plane_segmentations"])): | ||
metadata["Ophys"]["ImageSegmentation"]["plane_segmentations"][segmentation_metadata_ind]["imaging_plane"] = self.ophys_metadata["Ophys"]["ImagingPlane"][0]["name"] | ||
|
||
metadata["Ophys"]["Device"] = self.ophys_metadata["Ophys"]["Device"] | ||
metadata["Ophys"]["TwoPhotonSeries"] = self.ophys_metadata["Ophys"]["TwoPhotonSeries"] | ||
metadata["Ophys"]["ImagingPlane"] = self.ophys_metadata["Ophys"]["ImagingPlane"] | ||
|
||
return metadata |
21 changes: 19 additions & 2 deletions
21
src/higley_lab_to_nwb/benisty_2024/metadata/benisty_2024_ophys_metadata.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,21 @@ | ||
Ophys: | ||
Device: | ||
OnePhotonSeries: | ||
ImagingPlane: | ||
- name: TwoPhotonMicroscope | ||
description: MOM microscope (Sutter Instruments) coupled to a 16x, 0.8 NA objective (Nikon). Excitation was driven by a Titanium-Sapphire Laser (Mai-Tai eHP DeepSee, Spectra-Physics). | ||
manufacturer: Sutter Instruments | ||
TwoPhotonSeries: | ||
- name: TwoPhotonSeriesGreenChannel | ||
description: Imaging data from Green channel recorded with 2p microscope. Images were acquired at 512x512 resolution at 30 Hz using a galvo-resonant scan system controlled by ScanImage software (Vidrio). | ||
imaging_plane: ImagingPlaneGreenChannel | ||
unit: n.a. | ||
ImagingPlane: | ||
- name: ImagingPlaneGreenChannel | ||
description: Imaging plane for the Green channel recorded with 2p microscope. | ||
excitation_lambda: 920.0 # in nm | ||
location: Whole Brain | ||
device: TwoPhotonMicroscope | ||
optical_channel: | ||
- name: Green | ||
description: Emitted light was collected through a 525/50 filter and a gallium arsenide phosphide photomultiplier tube (Hamamatsu). | ||
emission_lambda: 525.0 | ||
indicator: GCaMP6s |