-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When I tried to read the dicom segmentation label with LoadImage in MONAI transforms, it reported a bug shown below.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/venv/lib/python3.11/site-packages/monai/transforms/io/array.py", line 290, in __call__
img_array, meta_data = reader.get_data(img)
^^^^^^^^^^^^^^^^^^^^
File "/venv/lib/python3.11/site-packages/monai/data/image_reader.py", line 586, in get_data
data_array, metadata = self._get_seg_data(d)
^^^^^^^^^^^^^^^^^^^^^
File "/venv/lib/python3.11/site-packages/monai/data/image_reader.py", line 770, in _get_seg_data
class_name = description.SegmentDescription
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/venv/lib/python3.11/site-packages/pydicom/dataset.py", line 908, in __getattr__
return object.__getattribute__(self, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Dataset' object has no attribute 'SegmentDescription'
To Reproduce
Steps to reproduce the behavior:
- Install the MONAI main branch.
- Download the attachment dcm file whose md5 is f511acb750076c56ad2d9647dcfe521d.
- Run command
python -c "from monai.transforms import LoadImage; loader = LoadImage(reader='pydicomreader'); loader('./SE000000.dcm');" - If I changed this line to
class_name = description.SegmentDescription if hasattr(description, "SegmentDescription") else description.SegmentLabel, it works. However I am not sure if this modification is good enough.
Expected behavior
Read segmentation correctly.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working