Skip to content

Commit 9d28fcb

Browse files
Rename Segmentation2D to PlanarSegmentation and Segmentation3D to VolumetricSegmentation (#64)
* Refactor segmentation classes: Rename Segmentation2D to PlanarSegmentation and Segmentation3D to VolumetricSegmentation * Update release notes and changelog for version 0.3.0: document segmentation class refactor
1 parent d63d29c commit 9d28fcb

19 files changed

+154
-146
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
- 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)
1414
- Added `dimensions_in_pixels` to `PlanarImagingSpace` and `dimensions_in_voxels` to `VolumetricImagingSpace` object Sub-Issue[#52](https://github.com/catalystneuro/ndx-microscopy/issues/52)
1515
- Added `MultiChannelMicroscopyContainer` object Sub-Issue[#53](https://github.com/catalystneuro/ndx-microscopy/issues/53)
16+
- Refactored segmentation classes: Sub-Issue[#56](https://github.com/catalystneuro/ndx-microscopy/issues/56)
17+
- Renamed `Segmentation2D` to `PlanarSegmentation`
18+
- Renamed `Segmentation3D` to `VolumetricSegmentation`
1619

1720
# v0.2.1 (March 28, 2025)
1821

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ A Neurodata Without Borders (NWB) extension for storing microscopy data and asso
3030
- `MultiPlaneMicroscopyContainer`
3131
- `MultiChannelMicroscopyContainer`
3232
- ROI/segmentation storage:
33-
- `Segmentation2D`
34-
- `Segmentation3D`
33+
- `PlanarSegmentation`
34+
- `VolumetricSegmentation`
3535
- `SegmentationContainer`
3636
- `MicroscopyResponseSeries`
3737
- `MicroscopyResponseSeriesContainer`
@@ -429,7 +429,7 @@ classDiagram
429429
summary_images : SummaryImage[0..*]
430430
}
431431
432-
class Segmentation2D {
432+
class PlanarSegmentation {
433433
<<Segmentation>>
434434
--------------------------------------
435435
datasets
@@ -450,7 +450,7 @@ classDiagram
450450
image_to_pixel()
451451
}
452452
453-
class Segmentation3D {
453+
class VolumetricSegmentation {
454454
<<Segmentation>>
455455
--------------------------------------
456456
datasets
@@ -512,13 +512,13 @@ classDiagram
512512
**microscopy_response_series** : MicroscopyResponseSeries[1..*]
513513
}
514514
515-
Segmentation <|-- Segmentation2D : extends
516-
Segmentation <|-- Segmentation3D : extends
515+
Segmentation <|-- PlanarSegmentation : extends
516+
Segmentation <|-- VolumetricSegmentation : extends
517517
SegmentationContainer *-- Segmentation : contains
518518
Segmentation *-- SummaryImage : contains
519519
MicroscopyResponseSeriesContainer *-- MicroscopyResponseSeries : contains
520-
Segmentation2D *-- PlanarImagingSpace : contains
521-
Segmentation3D *-- VolumetricImagingSpace : contains
520+
PlanarSegmentation *-- PlanarImagingSpace : contains
521+
VolumetricSegmentation *-- VolumetricImagingSpace : contains
522522
```
523523

524524
---

docs/source/api.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -133,33 +133,33 @@ Segmentation
133133
:undoc-members:
134134
:show-inheritance:
135135

136-
Segmentation2D
136+
PlanarSegmentation
137137
-------------
138-
.. autoclass:: ndx_microscopy.Segmentation2D
138+
.. autoclass:: ndx_microscopy.PlanarSegmentation
139139
:members:
140140
:undoc-members:
141141
:show-inheritance:
142142

143143
Methods
144144
^^^^^^^
145-
.. automethod:: ndx_microscopy.Segmentation2D.add_roi
146-
.. automethod:: ndx_microscopy.Segmentation2D.pixel_to_image
147-
.. automethod:: ndx_microscopy.Segmentation2D.image_to_pixel
148-
.. automethod:: ndx_microscopy.Segmentation2D.create_roi_table_region
145+
.. automethod:: ndx_microscopy.PlanarSegmentation.add_roi
146+
.. automethod:: ndx_microscopy.PlanarSegmentation.pixel_to_image
147+
.. automethod:: ndx_microscopy.PlanarSegmentation.image_to_pixel
148+
.. automethod:: ndx_microscopy.PlanarSegmentation.create_roi_table_region
149149

150-
Segmentation3D
150+
VolumetricSegmentation
151151
-------------
152-
.. autoclass:: ndx_microscopy.Segmentation3D
152+
.. autoclass:: ndx_microscopy.VolumetricSegmentation
153153
:members:
154154
:undoc-members:
155155
:show-inheritance:
156156

157157
Methods
158158
^^^^^^^
159-
.. automethod:: ndx_microscopy.Segmentation3D.add_roi
160-
.. automethod:: ndx_microscopy.Segmentation3D.voxel_to_image
161-
.. automethod:: ndx_microscopy.Segmentation3D.image_to_voxel
162-
.. automethod:: ndx_microscopy.Segmentation3D.create_roi_table_region
159+
.. automethod:: ndx_microscopy.VolumetricSegmentation.add_roi
160+
.. automethod:: ndx_microscopy.VolumetricSegmentation.voxel_to_image
161+
.. automethod:: ndx_microscopy.VolumetricSegmentation.image_to_voxel
162+
.. automethod:: ndx_microscopy.VolumetricSegmentation.create_roi_table_region
163163

164164
SegmentationContainer
165165
-------------------

docs/source/examples.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Complete example of two-photon calcium imaging with full optical path configurat
2525
MicroscopyChannel,
2626
PlanarImagingSpace,
2727
PlanarMicroscopySeries,
28-
Segmentation2D,
28+
PlanarSegmentation,
2929
SummaryImage,
3030
MicroscopyResponseSeries,
3131
MicroscopyResponseSeriesContainer,
@@ -264,7 +264,7 @@ Complete example of two-photon calcium imaging with full optical path configurat
264264
)
265265
266266
# Create segmentation
267-
segmentation = Segmentation2D(
267+
segmentation = PlanarSegmentation(
268268
name='rois',
269269
description='Manual ROI segmentation',
270270
planar_imaging_space=imaging_space,
@@ -357,7 +357,7 @@ Example of volumetric imaging with 3D ROI segmentation:
357357
MicroscopyRig,
358358
VolumetricImagingSpace,
359359
VolumetricMicroscopySeries,
360-
Segmentation3D,
360+
VolumetricSegmentation,
361361
SummaryImage,
362362
MicroscopyResponseSeries,
363363
MicroscopyResponseSeriesContainer,
@@ -590,7 +590,7 @@ Example of volumetric imaging with 3D ROI segmentation:
590590
)
591591
592592
# Create 3D segmentation
593-
segmentation = Segmentation3D(
593+
segmentation = VolumetricSegmentation(
594594
name='volume_rois',
595595
description='3D ROI segmentation',
596596
volumetric_imaging_space=volume_space,
@@ -685,7 +685,7 @@ Example of multi-plane imaging with an electrically tunable lens:
685685
PlanarImagingSpace,
686686
PlanarMicroscopySeries,
687687
MultiPlaneMicroscopyContainer,
688-
Segmentation2D,
688+
PlanarSegmentation,
689689
SummaryImage,
690690
MicroscopyResponseSeries,
691691
MicroscopyResponseSeriesContainer,
@@ -926,7 +926,7 @@ Example of multi-plane imaging with an electrically tunable lens:
926926
)
927927
928928
# Create segmentation for this plane
929-
segmentation = Segmentation2D(
929+
segmentation = PlanarSegmentation(
930930
name=f'rois_{depth}',
931931
description=f'ROI segmentation at {depth} µm',
932932
planar_imaging_space=plane_space,

docs/source/format.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -450,14 +450,14 @@ Base type for segmentation data.
450450
doc: Summary images that are related to the segmentation, e.g., mean, correlation, maximum projection.
451451
quantity: "*"
452452
453-
Segmentation2D
453+
PlanarSegmentation
454454
^^^^^^^^^^^
455455
For 2D segmentation data.
456456

457457
.. code-block:: yaml
458458
459459
groups:
460-
- neurodata_type_def: Segmentation2D
460+
- neurodata_type_def: PlanarSegmentation
461461
neurodata_type_inc: Segmentation
462462
doc: Results from image segmentation of a specific planar imaging space.
463463
datasets:
@@ -496,14 +496,14 @@ For 2D segmentation data.
496496
- neurodata_type_inc: PlanarImagingSpace
497497
doc: PlanarImagingSpace object from which this data was generated.
498498
499-
Segmentation3D
499+
VolumetricSegmentation
500500
^^^^^^^^^^^
501501
For 3D segmentation data.
502502

503503
.. code-block:: yaml
504504
505505
groups:
506-
- neurodata_type_def: Segmentation3D
506+
- neurodata_type_def: VolumetricSegmentation
507507
neurodata_type_inc: Segmentation
508508
doc: Results from image segmentation of a specific volumetric imaging space.
509509
datasets:

docs/source/release_notes.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ Deprecations and Changes
1313
* Removed `ExcitationLightPath` and `EmissionLightPath` classes in favor of a more integrated approach with `MicroscopyRig`
1414
* Changed `Microscope` to inherit from `DeviceInstance` instead of `Device`
1515
* Updated `MicroscopySeries` to use `MicroscopyRig` instead of individual `microscope`, `excitation_light_path`, and `emission_light_path` references
16+
* Refactored segmentation classes:
17+
* Renamed ``Segmentation2D`` to ``PlanarSegmentation``
18+
* Renamed ``Segmentation3D`` to ``VolumetricSegmentation``
1619

1720
Features
1821
--------
@@ -92,7 +95,7 @@ Features
9295
* Advanced light path configurations: ``ExcitationLightPath``, ``EmissionLightPath``
9396
* Imaging space definitions: ``PlanarImagingSpace``, ``VolumetricImagingSpace``
9497
* Support for 2D and 3D imaging: ``PlanarMicroscopySeries``, ``VolumetricMicroscopySeries``, ``MultiPlaneMicroscopyContainer``
95-
* ROI/segmentation storage: ``SummaryImages``, ``Segmentation2D``, ``Segmentation3D``, ``SegmentationContainer``, ``MicroscopyResponseSeries``, ``MicroscopyResponseSeriesContainer``
98+
* ROI/segmentation storage: ``SummaryImages``, ``PlanarSegmentation``, ``VolumetricSegmentation``, ``SegmentationContainer``, ``MicroscopyResponseSeries``, ``MicroscopyResponseSeriesContainer``
9699
* Abstract Neurodata types: ``ImagingSpace``, ``MicroscopySeries``, ``Segmentation``
97100

98101
Changes

docs/source/user_guide.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ Workflow for ROI segmentation:
554554
)
555555
556556
# 2. Create segmentation
557-
segmentation = Segmentation2D(
557+
segmentation = PlanarSegmentation(
558558
name='rois',
559559
description='Manual ROI segmentation',
560560
planar_imaging_space=imaging_space,

examples/multi_plane_imaging_example.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
" PlanarImagingSpace,\n",
4242
" PlanarMicroscopySeries,\n",
4343
" MultiPlaneMicroscopyContainer,\n",
44-
" Segmentation2D,\n",
44+
" PlanarSegmentation,\n",
4545
" SummaryImage,\n",
4646
" MicroscopyResponseSeries,\n",
4747
" MicroscopyResponseSeriesContainer,\n",
@@ -381,7 +381,7 @@
381381
" )\n",
382382
"\n",
383383
" # Create segmentation for this plane\n",
384-
" segmentation = Segmentation2D(\n",
384+
" segmentation = PlanarSegmentation(\n",
385385
" name=f\"rois_{depth}\",\n",
386386
" description=f\"ROI segmentation at {depth} µm\",\n",
387387
" planar_imaging_space=plane_space,\n",

examples/one-photon_calcium_imaging_example.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
" MicroscopyChannel,\n",
3939
" PlanarImagingSpace,\n",
4040
" PlanarMicroscopySeries,\n",
41-
" Segmentation2D,\n",
41+
" PlanarSegmentation,\n",
4242
" SummaryImage,\n",
4343
" MicroscopyResponseSeries,\n",
4444
" MicroscopyResponseSeriesContainer,\n",
@@ -380,7 +380,7 @@
380380
")\n",
381381
"\n",
382382
"# Create segmentation\n",
383-
"segmentation = Segmentation2D(\n",
383+
"segmentation = PlanarSegmentation(\n",
384384
" name='rois',\n",
385385
" description='Manual ROI segmentation',\n",
386386
" planar_imaging_space=imaging_space,\n",

examples/two-photon_calcium_imaging_example.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
" LineScan,\n",
3939
" PlanarImagingSpace,\n",
4040
" PlanarMicroscopySeries,\n",
41-
" Segmentation2D,\n",
41+
" PlanarSegmentation,\n",
4242
" SummaryImage,\n",
4343
" MicroscopyResponseSeries,\n",
4444
" MicroscopyResponseSeriesContainer\n",
@@ -383,7 +383,7 @@
383383
")\n",
384384
"\n",
385385
"# Create segmentation\n",
386-
"segmentation = Segmentation2D(\n",
386+
"segmentation = PlanarSegmentation(\n",
387387
" name='rois',\n",
388388
" description='Manual ROI segmentation',\n",
389389
" planar_imaging_space=imaging_space,\n",

0 commit comments

Comments
 (0)