Skip to content

Commit a418352

Browse files
Add optional optical_path_scheme field to MicroscopyRig
1 parent 7e5141a commit a418352

File tree

7 files changed

+49
-2
lines changed

7 files changed

+49
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
- `ViralVectorInjection` objects (from ndx-ophys-devices)
2323
- `Indicator` objects (from ndx-ophys-devices)
2424
- Added support for `ViralVector` and `ViralVectorInjection` imports from ndx-ophys-devices
25+
- Added optional `optical_path_scheme` field to `MicroscopyRig` (an `Image` group) for storing an annotated diagram or picture of the microscope's optical path layout
2526

2627
## Notes
2728
- These changes improve metadata organization by centralizing all experiment-related objects in `MicroscopyExperimentMetadata`

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ classDiagram
9999
dichroic_mirror : DichroicMirror, optional
100100
photodetector : Photodetector, optional
101101
emission_filter : OpticalFilter, optional
102+
--------------------------------------
103+
groups
104+
--------------------------------------
105+
optical_path_scheme : Image, optional
102106
}
103107
104108
class ExcitationSource {
@@ -297,6 +301,10 @@ classDiagram
297301
dichroic_mirror : DichroicMirror, optional
298302
photodetector : Photodetector, optional
299303
emission_filter : OpticalFilter, optional
304+
--------------------------------------
305+
groups
306+
--------------------------------------
307+
optical_path_scheme : Image, optional
300308
}
301309
302310
class ViralVector {
@@ -478,6 +486,10 @@ classDiagram
478486
dichroic_mirror : DichroicMirror, optional
479487
photodetector : Photodetector, optional
480488
emission_filter : OpticalFilter, optional
489+
--------------------------------------
490+
groups
491+
--------------------------------------
492+
optical_path_scheme : Image, optional
481493
}
482494
483495
MicroscopySeries <|-- PlanarMicroscopySeries : extends

docs/source/format.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,15 @@ A collection of devices and metadata that make up the microscopy rig.
7373
target_type: OpticalFilter
7474
doc: Link to OpticalFilter object which contains metadata about the emission filter. It can be either a BandOpticalFilter (e.g., 'Bandpass', 'Bandstop', 'Longpass', 'Shortpass') or a EdgeOpticalFilter (Longpass or Shortpass).
7575
quantity: "?"
76+
- name: objective_lens
77+
target_type: ObjectiveLens
78+
doc: Link to ObjectiveLens object which contains metadata about the objective lens used in the microscopy rig.
79+
quantity: "?"
80+
groups:
81+
- name: optical_path_scheme
82+
neurodata_type_inc: Image
83+
doc: optional link to Images object that provide an annotated scheme of the microscope and / or optical path.
84+
quantity: "?"
7685
7786
For other device components (ExcitationSource, OpticalFilter, Photodetector, etc.), please refer to the `ndx-ophys-devices documentation <https://ndx-ophys-devices.readthedocs.io/>`_.
7887

docs/source/user_guide.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,18 @@ The device components include MicroscopeModel, Microscope, and MicroscopyRig:
145145
excitation_filter=ex_filter,
146146
dichroic_mirror=dichroic,
147147
photodetector=detector,
148-
emission_filter=em_filter
148+
emission_filter=em_filter,
149+
# Optionally, attach a scheme image of the optical path
150+
# optical_path_scheme=Image(
151+
# name="optical_path_scheme",
152+
# data=optical_path_image_data, # numpy array, e.g. (H, W, 3) uint8
153+
# description="Annotated scheme of the two-photon optical path.",
154+
# )
149155
)
150156
157+
The ``optical_path_scheme`` parameter is optional and accepts a ``pynwb.image.Image`` object.
158+
This can be used to store an annotated diagram or picture of the microscope's optical path layout.
159+
151160
Other optical components (filters, sources, detectors) are provided by the ndx-ophys-devices extension.
152161

153162
4. **MicroscopyExperimentMetadata**: Container for centralizing all experiment metadata

examples/two-photon_calcium_imaging_example.ipynb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,13 @@
270270
"outputs": [],
271271
"source": [
272272
"# Create microscopy rig\n",
273+
"# Optionally, you can attach an annotated image/scheme of the optical path:\n",
274+
"# from pynwb.image import Image\n",
275+
"# optical_path_scheme = Image(\n",
276+
"# name='optical_path_scheme',\n",
277+
"# data=optical_path_image_array, # numpy array, e.g. (H, W, 3) uint8\n",
278+
"# description='Annotated scheme of the two-photon optical path.',\n",
279+
"# )\n",
273280
"microscopy_rig = MicroscopyRig(\n",
274281
" name='2p_rig',\n",
275282
" description='Two-photon microscopy rig for calcium imaging',\n",
@@ -278,7 +285,8 @@
278285
" excitation_filter=excitation_filter,\n",
279286
" dichroic_mirror=dichroic,\n",
280287
" photodetector=detector,\n",
281-
" emission_filter=emission_filter\n",
288+
" emission_filter=emission_filter,\n",
289+
" # optical_path_scheme=optical_path_scheme, # Optional: attach optical path diagram\n",
282290
")\n",
283291
"\n",
284292
"# Create microscopy channel\n",

spec/ndx-microscopy.extensions.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ groups:
4848
target_type: ObjectiveLens
4949
doc: Link to ObjectiveLens object which contains metadata about the objective lens used in the microscopy rig.
5050
quantity: "?"
51+
groups:
52+
- name: optical_path_scheme
53+
neurodata_type_inc: Image
54+
doc: optional link to Images object that provide an annotated scheme of the microscope and / or optical path.
55+
quantity: "?"
5156

5257
- neurodata_type_def: MicroscopyChannel
5358
neurodata_type_inc: NWBContainer

src/pynwb/ndx_microscopy/testing/_mock.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
mock_DichroicMirror,
1313
)
1414

15+
from pynwb.image import Image
1516
from pynwb.testing.mock.utils import name_generator
1617
from pynwb.core import DynamicTableRegion
1718
import ndx_microscopy
@@ -79,6 +80,7 @@ def mock_MicroscopyRig(
7980
dichroic_mirror: DichroicMirror = None,
8081
photodetector: Photodetector = None,
8182
emission_filter: OpticalFilter = None,
83+
optical_path_scheme: Optional[Image] = None,
8284
) -> ndx_microscopy.MicroscopyRig:
8385
microscopy_rig = ndx_microscopy.MicroscopyRig(
8486
name=name or name_generator("MicroscopyRig"),
@@ -89,6 +91,7 @@ def mock_MicroscopyRig(
8991
dichroic_mirror=dichroic_mirror or mock_DichroicMirror(),
9092
photodetector=photodetector or mock_Photodetector(),
9193
emission_filter=emission_filter or mock_OpticalFilter(),
94+
optical_path_scheme=optical_path_scheme,
9295
)
9396
return microscopy_rig
9497

0 commit comments

Comments
 (0)