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 specs #1

Merged
merged 25 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
0a1cb88
create specs
alessandratrapani May 25, 2024
00158e1
add test
alessandratrapani May 25, 2024
97270d4
minor fix
alessandratrapani May 25, 2024
7ae8983
fix typos
alessandratrapani May 25, 2024
d70ab9e
restructure testing
alessandratrapani May 25, 2024
c5eb8a1
minor fix
alessandratrapani May 25, 2024
f5f3846
Merge branch 'main' into create_specs
CodyCBakerPhD May 25, 2024
6014db6
create DeviceModel
alessandratrapani May 27, 2024
d1c59a7
add OpticalFilter as base calss for BandOpticalFilter and EdgeOptical…
alessandratrapani May 27, 2024
273cee0
add a example for magnification field
alessandratrapani May 27, 2024
6296281
minor fixes
alessandratrapani May 27, 2024
c5791ed
add mermaid entity relationship diagram
alessandratrapani May 27, 2024
fd9b78c
add pulsed excitation source
alessandratrapani May 27, 2024
1339c62
add tests for DeviceModel, OpticalFilter and PulsedExcitationSource
alessandratrapani May 27, 2024
486c0a5
update Entity relationship diagram
alessandratrapani May 27, 2024
5122ae8
Update spec/ndx-ophys-devices.extensions.yaml
alessandratrapani May 28, 2024
fadb936
separate diagrams
alessandratrapani May 28, 2024
7c2f36f
fix illumination_type doc
alessandratrapani May 28, 2024
f30c6fb
define indicator and effector as nwbcontainer
alessandratrapani May 28, 2024
1bb58da
minor fix
alessandratrapani May 28, 2024
a426f08
remove Microscope object
alessandratrapani Aug 20, 2024
76d02c7
remove Microscope object
alessandratrapani Aug 20, 2024
1122c78
remmove tetrode series from example.ipynb
alessandratrapani Aug 20, 2024
c5d99e5
minor fixes
alessandratrapani Aug 20, 2024
385bdcc
change dichroic mirror attribute from bandwidth to band
alessandratrapani Aug 27, 2024
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ This is an NWB extension for storing metadata of devices used in optical experim

---
This extension was created using [ndx-template](https://github.com/nwb-extensions/ndx-template).

## Contributing

Add a comment on how to contribute to this extension
220 changes: 214 additions & 6 deletions spec/ndx-ophys-devices.extensions.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,216 @@
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
alessandratrapani marked this conversation as resolved.
Show resolved Hide resolved
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
- name: core_diameter_in_um
dtype: float
doc: Core diameter in micrometers.
required: false
- neurodata_type_def: ExcitationSource
neurodata_type_inc: Device
doc: Extends Device to hold metadata on the Excitation Source.
CodyCBakerPhD marked this conversation as resolved.
Show resolved Hide resolved
attributes:
- name: model
dtype: text
doc: Model of excitation source device.
required: false
- name: illumination_type
dtype: text
doc: 'Type of illumination. Suggested values: LED, LAser or more specifically
Gas, Metal vapor, Solid state, Dye, Semiconductor, Free electron, etc.'
- name: excitation_wavelength_in_nm
dtype: float
doc: Excitation wavelength of the stimulation light (nanometers).
- name: peak_power_in_W
dtype: float
doc: Incident power of stimulation device (in Watts).
required: false
- name: peak_pulse_energy_in_J
dtype: float
doc: If device is pulsed light source, pulse energy (in Joules).
required: false
- name: intensity_in_W_per_m2
dtype: float
doc: Intensity of the excitation in W/m^2, if known.
required: false
- name: pulse_rate_in_Hz
dtype: float
doc: If device is pulsed light source, pulse rate (in Hz) used for stimulation.
required: false
alessandratrapani marked this conversation as resolved.
Show resolved Hide resolved
- name: exposure_time_in_s
dtype: float
doc: Exposure time of the sample (in sec).
required: false
- 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. Suggested values: CCD, Intensified
CCD, Analog video, PMT, Photodiode, CMOS, EBCCD, FTIR.'
CodyCBakerPhD marked this conversation as resolved.
Show resolved Hide resolved
- 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
alessandratrapani marked this conversation as resolved.
Show resolved Hide resolved
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.
required: false
- 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
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
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: BandOpticalFilter
CodyCBakerPhD marked this conversation as resolved.
Show resolved Hide resolved
neurodata_type_inc: Device
doc: Extends Device to hold a Band Optical Filter (Bandpass or Bandstop).
attributes:
- name: center_wavelength_in_nm
dtype: float
doc: The midpoint of the band of wavelengths that the filter transmits or blocks.
- name: bandwidth_in_nm
dtype: float
doc: The width of the wavelength range that the filter transmits or blocks (full
width at half maximum).
- name: filter_type
dtype: text
doc: Type of filter (e.g., 'Bandpass', 'Bandstop').
- name: model
alessandratrapani marked this conversation as resolved.
Show resolved Hide resolved
dtype: text
doc: Model of the optical filter.
required: false
- neurodata_type_def: EdgeOpticalFilter
neurodata_type_inc: Device
doc: Extends Device to hold an Edge Optical Filter (Longpass or Shortpass).
attributes:
- name: cut_wavelength_in_nm
dtype: float
doc: ' The wavelength at which the filter transmits half as much as its peak transmission.'
- name: filter_type
dtype: text
doc: Type of filter (e.g., 'Longpass', 'Shortpass').
- name: slope_in_percent_cut_wavelength
dtype: float
doc: The steepness of the transition from high blocking to high transmission (or
vice versa). Specified as a percentage of the cut wavelength.
required: false
- name: slope_starting_transmission_in_percent
dtype: float
doc: The percent transmission that defines the starting point for the slope (e.g.
10%).
required: false
- name: slope_ending_transmission_in_percent
dtype: float
doc: The percent transmission that defines the ending point for the slope (e.g.
80%).
required: false
- name: model
dtype: text
doc: Model of the optical filter.
required: false
- neurodata_type_def: ObjectiveLens
neurodata_type_inc: Device
doc: Extends Device to hold a Objective lens.
attributes:
- name: model
dtype: text
doc: Model of the objective lens.
required: false
- name: numerical_aperture
dtype: float
doc: Numerical aperture, e.g., 0.39 NA.
required: false
- name: magnification
alessandratrapani marked this conversation as resolved.
Show resolved Hide resolved
dtype: float
doc: Lens magnification.
required: false
- neurodata_type_def: Effector
alessandratrapani marked this conversation as resolved.
Show resolved Hide resolved
neurodata_type_inc: Device
doc: Extends Device to hold metadata on the Effector or Opsin.
attributes:
- name: label
dtype: text
doc: Effector 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: Microscope
neurodata_type_inc: Device
doc: Extends Device to hold a Microscope.
attributes:
- name: microscopy_type
dtype: text
doc: Type of microscope used to capture the image (e.g., inverted, upright, light
sheet, confocal, two photon).
- name: doi
dtype: text
doc: The publication link for custom-built microscope.
required: false
- name: model
dtype: text
doc: Model of the Microscope.
required: false
2 changes: 2 additions & 0 deletions spec/ndx-ophys-devices.namespace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ namespaces:
name: ndx-ophys-devices
schema:
- namespace: core
neurodata_types:
- Device
- source: ndx-ophys-devices.extensions.yaml
version: 0.1.0
21 changes: 10 additions & 11 deletions src/pynwb/ndx_ophys_devices/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,16 @@
# Load the namespace
load_namespaces(str(__spec_path))

# TODO: Define your classes here to make them accessible at the package level.
# 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-ophys-devices")`
TetrodeSeries = get_class("TetrodeSeries", "ndx-ophys-devices")

# NOTE: `widgets/tetrode_series_widget.py` adds a "widget"
# attribute to the TetrodeSeries class. This attribute is used by NWBWidgets.
# Delete the `widgets` subpackage or the `tetrode_series_widget.py` module
# if you do not want to define a custom widget for your extension neurodata
# type.
Indicator = get_class("Indicator", "ndx-ophys-devices")
OpticalFiber = get_class("OpticalFiber", "ndx-ophys-devices")
ExcitationSource = get_class("ExcitationSource", "ndx-ophys-devices")
Photodetector = get_class("Photodetector", "ndx-ophys-devices")
DichroicMirror = get_class("DichroicMirror", "ndx-ophys-devices")
BandOpticalFilter = get_class("BandOpticalFilter", "ndx-ophys-devices")
EdgeOpticalFilter = get_class("EdgeOpticalFilter", "ndx-ophys-devices")
ObjectiveLens = get_class("ObjectiveLens", "ndx-ophys-devices")
Effector = get_class("Effector", "ndx-ophys-devices")
Microscope = get_class("Microscope", "ndx-ophys-devices")

# Remove these functions from the package
del load_namespaces, get_class
25 changes: 25 additions & 0 deletions src/pynwb/ndx_ophys_devices/testing/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from ._mock import (
mock_Indicator,
mock_Effector,
mock_OpticalFiber,
mock_Photodetector,
mock_DichroicMirror,
mock_BandOpticalFilter,
mock_EdgeOpticalFilter,
mock_ObjectiveLens,
mock_ExcitationSource,
mock_Microscope,
)

__all__ = [
"mock_Indicator",
"mock_Effector",
"mock_OpticalFiber",
"mock_Photodetector",
"mock_DichroicMirror",
"mock_BandOpticalFilter",
"mock_EdgeOpticalFilter",
"mock_ObjectiveLens",
"mock_ExcitationSource",
"mock_Microscope",
]
Loading
Loading