Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create extension spec #1

Merged
merged 20 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions notebooks/metadata_example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
NWBFile:
session_description: Description.
session_start_time: 2000-07-23T00:00:00-07:00
institution: My University
lab: My Lab
experimenter:
- Last, First Middle
Subject:
subject_id: subid012345
genotype: not defined
description: not defined
species: Mus musculus
date_of_birth: 2023-03-17T00:00:00
sex: F
Ophys:
FiberPhotometry:
FiberPhotometryTable:
location: Location of this fiber
coordinates: [0.0, 0.0, 0.0] # Fiber placement stereotactic coordinates in (AP, ML, DV) in mm relative to Bregma
notes: extra notes
OpticalFibers:
- name: fiber0
description: fiber0 description
manufacturer: fiber0 manufacturer
model: fiber0 model
numerical_aperture: 0.2
ExcitationSources:
- name: laser0
description: laser0 description
manufacturer: laser0 manufacturer
model: laser0 model
illumination_type: laser # LED or laser
excitation_wavelength_in_nm: 465.0
Photodetectors:
- name: photodetector0
description: photodetector0 description
manufacturer: photodetector0 manufacturer
model: photodetector0 model
detector_type: PMT # PMT or photodiode
detected_wavelength_in_nm: 500.0
OpticalFilters:
- name: filter0
description: filter0 description
manufacturer: filter0 manufacturer
model: filter0 model
peak_wavelength_in_nm: 465.0
bandwidth_in_nm: 20.0
filter_type: Excitation
- name: filter1
description: filter1 description
manufacturer: filter1 manufacturer
model: filter1 model
peak_wavelength_in_nm: 500.0
bandwidth_in_nm: 20.0
filter_type: Emission
DichroicMirrors:
- name: dichroic0
description: dichroic0 description
manufacturer: dichroic0 manufacturer
model: dichroic0 model
cut_on_wavelength_in_nm: 465.0
cut_off_wavelength_in_nm: 500.0
Indicator:
- name: indicator0
label: dlight
location: VTA
emission_peak_wavelength: 500.0
excitation_peak_wavelength: 465.0
coordinates: [0.0, 0.0, 0.0] # Fluorophore injection site in taxonomical coordinates in (AP, ML, Z) in mm relative to Bregma
FiberPhotometryResponseSeries:
- name: _405A
description: isosbestic signal
unit: F
fiber_photometry_table_region: [0]
253 changes: 247 additions & 6 deletions spec/ndx-fiber-photometry.extensions.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,249 @@
groups:
- neurodata_type_def: TetrodeSeries
neurodata_type_inc: ElectricalSeries
doc: An extension of ElectricalSeries to include the tetrode ID for each time series.
- neurodata_type_def: Indicator
neurodata_type_inc: Device
doc: Extends Device to hold metadata on the Indicator.
attributes:
- name: trode_id
dtype: int32
doc: The tetrode ID.
- name: label
dtype: text
doc: Indicator standard notation.
- name: injection_location
dtype: text
doc: Injection brain region name.
required: false
- name: injection_coordinates_in_mm
dtype: float
shape:
- 3
doc: Indicator injection location in stereotactic coordinates (AP, ML, DV) mm
relative to Bregma.
required: false
- neurodata_type_def: OpticalFiber
neurodata_type_inc: Device
doc: Extends Device to hold metadata on the Optical Fiber.
attributes:
- name: model
dtype: text
doc: Model of optical fiber.
required: false
- name: numerical_aperture
dtype: float
doc: Numerical aperture, e.g., 0.39 NA.
required: false
- neurodata_type_def: ExcitationSource
neurodata_type_inc: Device
doc: Extends Device to hold metadata on the Excitation Source.
attributes:
- name: model
dtype: text
doc: Model of excitation source device.
required: false
- name: illumination_type
dtype: text
doc: Illumination type, e.g., laser or LED.
- name: excitation_wavelength_in_nm
dtype: float
doc: Excitation wavelength of the stimulation light (nanometers).
- neurodata_type_def: Photodetector
neurodata_type_inc: Device
doc: Extends Device to hold metadata on the Photodetector.
attributes:
- name: model
dtype: text
doc: Model of photodetector device.
required: false
- name: detector_type
dtype: text
doc: Technology used to detect the light, e.g., PMT or photodiode.
- name: detected_wavelength_in_nm
dtype: float
doc: Wavelength detected by photodetector.
- name: gain
dtype: float
doc: Gain on the photodetector.
- neurodata_type_def: DichroicMirror
neurodata_type_inc: Device
doc: Extends Device to hold a Dichroic Mirror.
attributes:
- name: cut_on_wavelength_in_nm
dtype: float
doc: Wavelength at which the mirror starts to transmit light more than reflect.
- name: cut_off_wavelength_in_nm
dtype: float
doc: Wavelength at which transmission shifts back to reflection,for mirrors with
complex transmission spectra.
required: false
- name: reflection_bandwidth_in_nm
dtype: float
shape:
- 2
doc: The range of wavelengths that are primarily reflected.The start and end wavelengths
needs to be specified.
required: false
- name: transmission_bandwidth_in_nm
dtype: float
shape:
- 2
doc: The range of wavelengths that are primarily transmitted.The start and end
wavelengths needs to be specified.
required: false
- name: angle_of_incidence_in_degrees
dtype: float
doc: Intended angle at which light strikes the mirror.
required: false
- name: model
dtype: text
doc: Model of the dichroic mirror.
required: false
- neurodata_type_def: OpticalFilter
neurodata_type_inc: Device
doc: Extends Device to hold a Optical Filter.
attributes:
- name: peak_wavelength_in_nm
dtype: float
doc: Wavelength that the filter is designed to pass or reflect.
- name: bandwidth_in_nm
dtype: float
shape:
- 2
doc: Width of the wavelength range that the filter allows to pass through or blocks.
- name: filter_type
dtype: text
doc: Type of filter (e.g., 'Excitation', 'Emission', 'Bandpass', 'Longpass', 'Shortpass').
- name: model
dtype: text
doc: Model of the optical filter.
required: false
- neurodata_type_def: FiberPhotometryTable
neurodata_type_inc: DynamicTable
doc: Extends DynamicTable to hold metadata on the Fiber Photometry system.
datasets:
- name: location
neurodata_type_inc: VectorData
dtype: text
shape:
- null
doc: Location of fiber.
- name: coordinates
neurodata_type_inc: VectorData
dtype: float
shape:
- null
- 3
doc: Fiber placement in stereotactic coordinates (AP, ML, DV) mm relative to Bregma.
quantity: '?'
attributes:
- name: unit
dtype: text
value: millimeters
doc: coordinates unit
- name: indicator
neurodata_type_inc: VectorData
dtype:
target_type: Device
reftype: object
shape:
- null
doc: Link to the indicator object.
- name: notes
neurodata_type_inc: VectorData
dtype: text
shape:
- null
doc: Description of system.
quantity: '?'
- name: optical_fiber
neurodata_type_inc: VectorData
dtype:
target_type: Device
reftype: object
shape:
- null
doc: Link to the optical fiber device.
- name: excitation_source
neurodata_type_inc: VectorData
dtype:
target_type: Device
reftype: object
shape:
- null
doc: Link to the excitation source device.
- name: commanded_voltage_series
neurodata_type_inc: VectorData
dtype:
target_type: TimeSeries
reftype: object
shape:
- null
- null
doc: Link to the commanded voltage series.
- name: photodetector
neurodata_type_inc: VectorData
dtype:
target_type: Device
reftype: object
shape:
- null
doc: Link to the photodetector device.
- name: dichroic_mirror
neurodata_type_inc: VectorData
dtype:
target_type: Device
reftype: object
shape:
- null
doc: Link to the dichroic mirror device.
- name: emission_filter
neurodata_type_inc: VectorData
dtype:
target_type: Device
reftype: object
shape:
- null
doc: Link to the emission filter device.
quantity: '?'
- name: excitation_filter
neurodata_type_inc: VectorData
dtype:
target_type: Device
reftype: object
shape:
- null
doc: Link to the excitation filter device.
quantity: '?'
- neurodata_type_def: FiberPhotometryResponseSeries
neurodata_type_inc: TimeSeries
doc: Extends TimeSeries to hold Fiber Photometry data.
datasets:
- name: data
shape:
- null
- null
doc: The data values. May be 1D or 2D. The first dimension must be time.The optional
second dimension refers to the fiber that record the series.
- name: fiber_photometry_table_region
neurodata_type_inc: DynamicTableRegion
doc: References row(s) of FiberPhotometryTable.
quantity: '?'
- neurodata_type_def: CommandedVoltageSeries
neurodata_type_inc: TimeSeries
doc: Extends TimeSeries to hold a Commanded Voltage
datasets:
- name: data
dtype: float
shape:
- null
doc: Voltages (length number timesteps) in unit volts.
attributes:
- name: unit
dtype: text
value: volts
doc: data unit
- name: frequency
dtype: float
doc: Voltage frequency in unit hertz.
quantity: '?'
attributes:
- name: unit
dtype: text
value: hertz
doc: frequency unit
13 changes: 12 additions & 1 deletion spec/ndx-fiber-photometry.namespace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,22 @@ namespaces:
- Paul Adkisson
- Szonja Weigl
contact:
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
doc: This is an NWB extension for storing fiber photometry recordings and associated
metadata.
name: ndx-fiber-photometry
schema:
- namespace: core
neurodata_types:
- TimeSeries
- Device
- namespace: hdmf-common
neurodata_types:
- DynamicTable
- DynamicTableRegion
- VectorData
- source: ndx-fiber-photometry.extensions.yaml
version: 0.1.0
11 changes: 10 additions & 1 deletion src/pynwb/ndx_fiber_photometry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,16 @@
# Either have PyNWB generate a class from the spec using `get_class` as shown
# below or write a custom class and register it using the class decorator
# `@register_class("TetrodeSeries", "ndx-fiber-photometry")`
TetrodeSeries = get_class("TetrodeSeries", "ndx-fiber-photometry")
Indicator = get_class("Indicator", "ndx-fiber-photometry")
OpticalFiber = get_class("OpticalFiber", "ndx-fiber-photometry")
ExcitationSource = get_class("ExcitationSource", "ndx-fiber-photometry")
Photodetector = get_class("Photodetector", "ndx-fiber-photometry")
DichroicMirror = get_class("DichroicMirror", "ndx-fiber-photometry")
OpticalFilter = get_class("OpticalFilter", "ndx-fiber-photometry")
FiberPhotometryTable = get_class("FiberPhotometryTable", "ndx-fiber-photometry")
FiberPhotometryResponseSeries = get_class("FiberPhotometryResponseSeries", "ndx-fiber-photometry")
CommandedVoltageSeries = get_class("CommandedVoltageSeries", "ndx-fiber-photometry")


# NOTE: `widgets/tetrode_series_widget.py` adds a "widget"
# attribute to the TetrodeSeries class. This attribute is used by NWBWidgets.
Expand Down
Empty file.
Loading
Loading