Skip to content

Commit 519f3a1

Browse files
Add Microscopy Rig (#61)
* add MicroscopyRig and MicroscopeModel * add mock functions * update tests * update README * update docs * update notebooks * update changelog * ruff fixes * update requirements * update ndx-ophys-devices dependency to use GitHub repository * update ndx-ophys-devices dependency to version 0.2.0 and add OpticalLens to the namespace and extensions * update ndx-ophys-devices dependency to version 0.2.0 and add OpticalLens to the namespace and extensions
1 parent de98518 commit 519f3a1

26 files changed

+1464
-972
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
# v0.3.0 (upcoming)
22
## Bug Fixes
33

4+
## Deprecations and Changes
5+
- Removed `ExcitationLightPath` and `EmissionLightPath` classes in favor of a more integrated approach with `MicroscopyRig`
6+
47
## Features
58
### NWB TAB reviews Issue[#48](https://github.com/catalystneuro/ndx-microscopy/issues/48)
69
- Added MicroscopyChannel object Sub-Issue[#49](https://github.com/catalystneuro/ndx-microscopy/issues/49)
10+
- Added `MicroscopyRig` object Sub-Issue[#51](https://github.com/catalystneuro/ndx-microscopy/issues/51)
11+
- Changed `Microscope` to inherit from `DeviceInstance` instead of `Device` Sub-Issue[#51](https://github.com/catalystneuro/ndx-microscopy/issues/51)
12+
- Added `MicroscopeModel` that inherit from `DeviceModel` Sub-Issue[#51](https://github.com/catalystneuro/ndx-microscopy/issues/51)
13+
- Updated `MicroscopySeries` to use `MicroscopyRig` instead of individual `microscope`, `excitation_light_path`, and `emission_light_path` references Sub-Issue[#51](https://github.com/catalystneuro/ndx-microscopy/issues/51)
714

815
# v0.2.1 (March 28, 2025)
916

README.md

Lines changed: 62 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ A Neurodata Without Borders (NWB) extension for storing microscopy data and asso
66

77
**Comprehensive Neurodata Types**
88
- Microscope and optical component metadata (integration with [ndx-ophys-devices](https://github.com/catalystneuro/ndx-ophys-devices)):
9+
- `MicroscopeModel`
910
- `Microscope`
11+
- `MicroscopyRig`
1012
- `ExcitationSource` / `PulsedExcitationSource`
1113
- `BandOpticalFilter` / `EdgeOpticalFilter` /
1214
- `DichroicMirror`
1315
- `Photodetector`
1416
- `Indicator`
1517
- Microscopy channel configurations:
1618
- `MicroscopyChannel`
17-
- `ExcitationLightPath`
18-
- `EmissionLightPath`
1919
- Imaging space definitions:
2020
- `PlanarImagingSpace`
2121
- `VolumetricImagingSpace`
@@ -38,65 +38,66 @@ A Neurodata Without Borders (NWB) extension for storing microscopy data and asso
3838

3939
## Entity Relationship Diagrams
4040

41-
#### Device and Light Path Components
41+
#### Device Components
4242

4343
```mermaid
4444
%%{init: {'theme': 'base', 'themeVariables': {'primaryColor': '#ffffff', 'primaryBorderColor': '#144E73', 'lineColor': '#D96F32'}}}%%
4545
4646
classDiagram
4747
direction TB
48-
49-
class DeviceModel {
48+
49+
class DeviceModel{
5050
<<Device>>
5151
--------------------------------------
5252
attributes
5353
--------------------------------------
54-
model : text, optional
55-
}
56-
57-
class ExcitationLightPath {
58-
<<LabMetaData>>
54+
manufacturer : text
55+
model_number : text, optional
56+
}
57+
58+
class DeviceInstance{
59+
<<Device>>
5960
--------------------------------------
6061
attributes
6162
--------------------------------------
62-
**description** : text
63+
serial_number : text, optional
6364
--------------------------------------
6465
links
6566
--------------------------------------
66-
**excitation_source** : ExcitationSource
67-
excitation_filter : OpticalFilter, optional
68-
dichroic_mirror : DichroicMirror, optional
69-
--------------------------------------
70-
methods
71-
--------------------------------------
72-
get_excitation_wavelength()
67+
model : DeviceModel, optional
7368
}
7469
75-
class EmissionLightPath {
76-
<<LabMetaData>>
70+
class MicroscopeModel {
71+
<<DeviceModel>>
72+
}
73+
74+
class Microscope {
75+
<<DeviceInstance>>
7776
--------------------------------------
7877
attributes
7978
--------------------------------------
80-
**description** : text
79+
technique : text, optional
80+
}
81+
82+
class MicroscopyRig {
83+
<<NWBContainer>>
8184
--------------------------------------
82-
groups
85+
attributes
8386
--------------------------------------
84-
**indicator** : Indicator
87+
description : text
8588
--------------------------------------
8689
links
8790
--------------------------------------
88-
**photodetector** : Photodetector
89-
emission_filter : OpticalFilter, optional
91+
microscope : Microscope
92+
excitation_source : ExcitationSource, optional
93+
excitation_filter : OpticalFilter, optional
9094
dichroic_mirror : DichroicMirror, optional
91-
--------------------------------------
92-
methods
93-
--------------------------------------
94-
get_emission_wavelength()
95-
get_indicator_label()
95+
photodetector : Photodetector, optional
96+
emission_filter : OpticalFilter, optional
9697
}
9798
9899
class ExcitationSource {
99-
<<DeviceModel>>
100+
<<DeviceInstance>>
100101
--------------------------------------
101102
attributes
102103
--------------------------------------
@@ -119,7 +120,7 @@ classDiagram
119120
}
120121
121122
class OpticalFilter {
122-
<<DeviceModel>>
123+
<<DeviceInstance>>
123124
--------------------------------------
124125
attributes
125126
--------------------------------------
@@ -147,7 +148,7 @@ classDiagram
147148
}
148149
149150
class DichroicMirror {
150-
<<DeviceModel>>
151+
<<DeviceInstance>>
151152
--------------------------------------
152153
attributes
153154
--------------------------------------
@@ -159,7 +160,7 @@ classDiagram
159160
}
160161
161162
class Photodetector {
162-
<<DeviceModel>>
163+
<<DeviceInstance>>
163164
--------------------------------------
164165
attributes
165166
--------------------------------------
@@ -181,21 +182,15 @@ classDiagram
181182
injection_coordinates_in_mm : float[3], optional
182183
}
183184
184-
DeviceModel <|-- ExcitationSource : extends
185-
DeviceModel <|-- OpticalFilter : extends
186-
DeviceModel <|-- Photodetector : extends
187-
DeviceModel <|-- DichroicMirror : extends
188-
ExcitationSource <|-- PulsedExcitationSource : extends
189-
OpticalFilter <|-- BandOpticalFilter : extends
190-
OpticalFilter <|-- EdgeOpticalFilter : extends
191-
192-
ExcitationLightPath o--> ExcitationSource : links
193-
ExcitationLightPath o--> OpticalFilter : links
194-
ExcitationLightPath o--> DichroicMirror : links
195-
EmissionLightPath o--> Photodetector : links
196-
EmissionLightPath o--> OpticalFilter : links
197-
EmissionLightPath o--> DichroicMirror : links
198-
EmissionLightPath *-- Indicator : contains
185+
DeviceModel <|-- MicroscopeModel : extends
186+
DeviceInstance <|-- Microscope : extends
187+
188+
Microscope o--> MicroscopeModel : links
189+
MicroscopyRig o--> Microscope : links
190+
MicroscopyRig o--> ExcitationSource : links
191+
MicroscopyRig o--> OpticalFilter : links
192+
MicroscopyRig o--> DichroicMirror : links
193+
MicroscopyRig o--> Photodetector : links
199194
```
200195

201196
#### Illumination Pattern Components
@@ -296,14 +291,9 @@ classDiagram
296291
class MicroscopySeries {
297292
<<TimeSeries>>
298293
--------------------------------------
299-
links
300-
--------------------------------------
301-
**microscope** : Microscope
302-
**excitation_light_path** : ExcitationLightPath
303-
**emission_light_path** : EmissionLightPath
304-
--------------------------------------
305294
groups
306295
--------------------------------------
296+
**microscopy_rig** : MicroscopyRig
307297
**microscopy_channel** : MicroscopyChannel
308298
309299
}
@@ -376,13 +366,21 @@ classDiagram
376366
voxel_size_in_um : float64[3], optional
377367
}
378368
379-
class Microscope {
380-
<<Device>>
369+
class MicroscopyRig {
370+
<<NWBContainer>>
381371
--------------------------------------
382372
attributes
383373
--------------------------------------
384-
model : text, optional
385-
technique : text, optional
374+
description : text
375+
--------------------------------------
376+
links
377+
--------------------------------------
378+
microscope : Microscope
379+
excitation_source : ExcitationSource, optional
380+
excitation_filter : OpticalFilter, optional
381+
dichroic_mirror : DichroicMirror, optional
382+
photodetector : Photodetector, optional
383+
emission_filter : OpticalFilter, optional
386384
}
387385
388386
MicroscopySeries <|-- PlanarMicroscopySeries : extends
@@ -393,9 +391,7 @@ classDiagram
393391
PlanarMicroscopySeries *-- PlanarImagingSpace : contains
394392
VolumetricMicroscopySeries *-- VolumetricImagingSpace : contains
395393
MultiPlaneMicroscopyContainer *-- PlanarMicroscopySeries : contains
396-
MicroscopySeries o--> Microscope : links
397-
MicroscopySeries o--> ExcitationLightPath : links
398-
MicroscopySeries o--> EmissionLightPath : links
394+
MicroscopySeries *-- MicroscopyRig : contains
399395
MicroscopyChannel *-- MicroscopySeries : contains
400396
MicroscopyChannel --* Indicator : contains
401397
```
@@ -530,7 +526,7 @@ For detailed documentation, including API reference and additional examples, ple
530526

531527
To help ensure a smooth Pull Request (PR) process, please always begin by raising an issue on the main repository so we can openly discuss any problems/additions before taking action.
532528

533-
The main branch of ndx-microscopy is protected; you cannot push to it directly. You must upload your changes by pushing a new branch, then submit your changes to the main branch via a Pull Request. This allows us to conduct automated testing of your contribution, and gives us a space for developers to discuss the contribution and request changes. If you decide to tackle an issue, please make yourself an assignee on the issue to communicate this to the team. Dont worry - this does not commit you to solving this issue. It just lets others know who they should talk to about it.
529+
The main branch of ndx-microscopy is protected; you cannot push to it directly. You must upload your changes by pushing a new branch, then submit your changes to the main branch via a Pull Request. This allows us to conduct automated testing of your contribution, and gives us a space for developers to discuss the contribution and request changes. If you decide to tackle an issue, please make yourself an assignee on the issue to communicate this to the team. Don't worry - this does not commit you to solving this issue. It just lets others know who they should talk to about it.
534530

535531
From your local copy directory, use the following commands.
536532

@@ -546,7 +542,7 @@ $ git checkout -b <new_branch>
546542

547543
Make your changes. Add new objects related to optical experiment or add more attributes on the existing ones. To speed up the process, you can write mock function (see _mock.py) that would be used to test the new neurodata type
548544

549-
We will automatically run tests to ensure that your contributions didnt break anything and that they follow our style guide. You can speed up the testing cycle by running these tests locally on your own computer by calling pytest from the top-level directory.
545+
We will automatically run tests to ensure that your contributions didn't break anything and that they follow our style guide. You can speed up the testing cycle by running these tests locally on your own computer by calling pytest from the top-level directory.
550546
Push your feature branch to origin (i.e. GitHub)
551547

552548
```bash
@@ -555,9 +551,9 @@ $ git push origin <new_branch>
555551

556552
Once you have tested and finalized your changes, create a pull request (PR) targeting dev as the base branch:
557553
Ensure the PR description clearly describes the problem and solution.
558-
Include the relevant issue number if applicable. TIP: Writing e.g. fix #613 will automatically close issue #613 when this PR is merged.
554+
Include the relevant issue number if applicable. TIP: Writing e.g. "fix #613" will automatically close issue #613 when this PR is merged.
559555
Before submitting, please ensure that the code follows the standard coding style of the respective repository.
560-
If you would like help with your contribution, or would like to communicate contributions that are not ready to merge, submit a PR where the title begins with [WIP].
556+
If you would like help with your contribution, or would like to communicate contributions that are not ready to merge, submit a PR where the title begins with "[WIP]."
561557

562558
Update the CHANGELOG.md regularly to document changes to the extension.
563559

docs/source/api.rst

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,39 +9,27 @@ This section provides detailed documentation for all classes and methods in the
99
Device Components
1010
===========
1111

12-
Microscope
13-
---------
14-
.. autoclass:: ndx_microscopy.Microscope
12+
MicroscopeModel
13+
---------------
14+
.. autoclass:: ndx_microscopy.MicroscopeModel
1515
:members:
1616
:undoc-members:
1717
:show-inheritance:
1818

19-
Light Path Components
20-
===================
21-
22-
ExcitationLightPath
23-
------------------
24-
.. autoclass:: ndx_microscopy.ExcitationLightPath
19+
Microscope
20+
---------
21+
.. autoclass:: ndx_microscopy.Microscope
2522
:members:
2623
:undoc-members:
2724
:show-inheritance:
2825

29-
Methods
30-
^^^^^^^
31-
.. automethod:: ndx_microscopy.ExcitationLightPath.get_excitation_wavelength
32-
33-
EmissionLightPath
34-
----------------
35-
.. autoclass:: ndx_microscopy.EmissionLightPath
26+
MicroscopyRig
27+
-------------
28+
.. autoclass:: ndx_microscopy.MicroscopyRig
3629
:members:
3730
:undoc-members:
3831
:show-inheritance:
3932

40-
Methods
41-
^^^^^^^
42-
.. automethod:: ndx_microscopy.EmissionLightPath.get_emission_wavelength
43-
.. automethod:: ndx_microscopy.EmissionLightPath.get_indicator_label
44-
4533
MicroscopyChannel
4634
---------------
4735
.. autoclass:: ndx_microscopy.MicroscopyChannel

docs/source/description.rst

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,16 @@ Key Features
1010

1111
Device and Optical Components
1212
^^^^^^^^^^^^^^^^^^^^^^^^^^^
13-
- Microscope metadata
13+
- MicroscopeModel for defining microscope models
14+
- Microscope instances with technique specifications
15+
- MicroscopyRig for organizing optical components
1416
- Integration with ndx-ophys-devices for:
1517
- Excitation sources (continuous and pulsed)
1618
- Optical filters (band and edge types)
1719
- Dichroic mirrors
1820
- Photodetectors
1921
- Fluorescent indicators
2022

21-
Light Path Configuration
22-
^^^^^^^^^^^^^^^^^^^^^
23-
- Excitation light path tracking
24-
- Emission light path tracking
25-
- Comprehensive optical component specifications
26-
- Wavelength and power specifications
27-
2823
Illumination Pattern Support
2924
^^^^^^^^^^^^^^^^^^^^^
3025
- Base illumination pattern class for general use cases
@@ -58,12 +53,11 @@ The extension organizes microscopy data hierarchically::
5853

5954
nwbfile
6055
├── devices
56+
│ ├── microscope_model: MicroscopeModel
6157
│ └── microscope: Microscope
62-
├── lab_meta_data
63-
│ ├── excitation_path: ExcitationLightPath
64-
│ └── emission_path: EmissionLightPath
6558
├── acquisition
6659
│ └── MicroscopySeries
60+
│ └── microscopy_rig: MicroscopyRig
6761
└── processing
6862
└── ophys
6963
├── MicroscopyResponseSeriesContainer

0 commit comments

Comments
 (0)