-
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.
* enhancements * add pump probe imaging interface * debugging * debugging name collision * saving state * added pumpprobe segmentation * added neuropal and debugged ogen * added neuropal segmentation * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * typos --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
8040465
commit 1bb46f9
Showing
18 changed files
with
789 additions
and
304 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
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
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
12 changes: 8 additions & 4 deletions
12
src/leifer_lab_to_nwb/randi_nature_2023/interfaces/__init__.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,13 +1,17 @@ | ||
"""Collection of interfaces for the conversion of data related to the Randi (Nature 2023) paper from the Leifer lab.""" | ||
|
||
from ._extra_ophys_metadata import ExtraOphysMetadataInterface | ||
from ._logbook_metadata import SubjectInterface | ||
from ._onephotonseries import OnePhotonSeriesInterface | ||
from ._neuropal_imaging_interface import NeuroPALImagingInterface | ||
from ._neuropal_segmentation_interface import NeuroPALSegmentationInterface | ||
from ._optogenetic_stimulation import OptogeneticStimulationInterface | ||
from ._pump_probe_imaging_interface import PumpProbeImagingInterface | ||
from ._pump_probe_segmentation_interface import PumpProbeSegmentationInterface | ||
|
||
__all__ = [ | ||
"ExtraOphysMetadataInterface", | ||
"OnePhotonSeriesInterface", | ||
"PumpProbeImagingInterface", | ||
"PumpProbeSegmentationInterface", | ||
"NeuroPALImagingInterface", | ||
"NeuroPALSegmentationInterface", | ||
"OptogeneticStimulationInterface", | ||
"SubjectInterface", | ||
] |
75 changes: 0 additions & 75 deletions
75
src/leifer_lab_to_nwb/randi_nature_2023/interfaces/_binaryimagingextractor.py
This file was deleted.
Oops, something went wrong.
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
49 changes: 1 addition & 48 deletions
49
src/leifer_lab_to_nwb/randi_nature_2023/interfaces/_logbook_metadata.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,48 +1 @@ | ||
import json | ||
import pathlib | ||
|
||
import ndx_multichannel_volume | ||
import neuroconv | ||
import pandas | ||
import pynwb | ||
from pydantic import FilePath | ||
|
||
|
||
class SubjectInterface(neuroconv.BaseDataInterface): | ||
"""A custom interface for adding extra subject metadata from the logbook.""" | ||
|
||
def __init__(self, *, file_path: FilePath, session_id: str) -> None: | ||
""" | ||
A custom interface for adding extra subject metadata from the logbook. | ||
Parameters | ||
---------- | ||
file_path : FilePath | ||
Path to the logbook for this session. | ||
""" | ||
file_path = pathlib.Path(file_path) | ||
|
||
super().__init__(file_path=file_path, session_id=session_id) | ||
|
||
with open(file=file_path, mode="r") as io: | ||
self.logbook = io.readlines() | ||
|
||
def add_to_nwbfile(self, nwbfile: pynwb.NWBFile): | ||
session_id = self.source_data["session_id"] | ||
|
||
logbook_growth_stage_mapping = { | ||
"L4": "L4", | ||
"young adult": "YA", | ||
"L4/ya": "YA", # TODO: consult them on how to handle this case | ||
} | ||
|
||
subject_start_line = self.logbook | ||
|
||
subject = ndx_multichannel_volume.CElegansSubject( | ||
subject_id=session_id, # Sessions are effectively defined by the subject number on that day | ||
description="", # TODO: find something from paper | ||
species="Caenorhabditis elegans", | ||
growth_stage=logbook_growth_stage_mapping[growth_stage], | ||
strain=strain, | ||
) | ||
nwbfile.subject = subject | ||
# TODO: write a simple function to read the logbook YAML file and lookup the information for this session |
Oops, something went wrong.