Skip to content

Commit 9ddbe53

Browse files
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.ci
1 parent 068fc81 commit 9ddbe53

File tree

6 files changed

+1368
-92
lines changed

6 files changed

+1368
-92
lines changed

monailabel/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919

2020
def is_package_installed(name):
21-
return name in (x.metadata.get("Name") for x in distributions())
21+
return name in (x.metadata.get("Name") for x in distributions() if x.metadata is not None)
2222

2323

2424
class Settings(BaseSettings):

0 commit comments

Comments
 (0)