Commit 9ddbe53
committed
Replace pydicom-seg with highdicom and upgrade pydicom to 3.0.1
Major changes:
- Replace unmaintained pydicom-seg library with well-established highdicom
- Upgrade pydicom from 2.4.4 to 3.0.1, enabling HTJ2K support
Refactoring in monailabel/datastore/utils/convert.py:
- Split nifti_to_dicom_seg into dispatcher + two implementations:
* _highdicom_nifti_to_dicom_seg: Highdicom-based conversion
* _itk_nifti_to_dicom_seg: Dcmqi/itkimage2segimage conversion
- Rename itk_image_to_dicom_seg → _dcmqi_nifti_to_dicom_seg for consistency
Tests in tests/unit/datastore/test_convert.py:
- Test both highdicom and ITK implementations via helper methods
- Validate metadata preservation, geometry, pixel data, and segment remapping
- Tests for non-sequential label remapping (1,5,10 → 1,2,3)
- Round-trip conversion tests with 3% tolerance for both implementations
- Handle ITK-specific behavior (stores only non-empty slices)
Minor improvements:
- Update pynrrd from 1.0.0 to 1.1.3 (former caused problem with numpy 2.x)
- Add documentation for optional dcmqi dependency
Signed-off-by: Joaquin Anton Guirao <[email protected]>
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Code review fixes
Signed-off-by: Joaquin Anton Guirao <[email protected]>
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Lint fixes
Signed-off-by: Joaquin Anton Guirao <[email protected]>
More code review fixes
Signed-off-by: Joaquin Anton Guirao <[email protected]>
More fixes
Signed-off-by: Joaquin Anton Guirao <[email protected]>
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci1 parent 068fc81 commit 9ddbe53
File tree
6 files changed
+1368
-92
lines changed- monailabel
- datastore/utils
- endpoints
- tests/unit/datastore
6 files changed
+1368
-92
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
0 commit comments