Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing SegmentDescription in PydicomReader #6937

Merged
merged 11 commits into from
Sep 4, 2023
4 changes: 3 additions & 1 deletion monai/data/image_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,9 @@
all_segs = np.zeros([*spatial_shape, n_classes])

for i, (frames, description) in enumerate(self._get_frame_data(img)):
class_name = description.SegmentDescription
class_name = (

Check warning on line 769 in monai/data/image_reader.py

View check run for this annotation

Codecov / codecov/patch

monai/data/image_reader.py#L769

Added line #L769 was not covered by tests
description.SegmentLabel if hasattr(description, "SegmentLabel") else description.SegmentDescription
)
wyli marked this conversation as resolved.
Show resolved Hide resolved
if class_name not in metadata["labels"].keys():
metadata["labels"][class_name] = i
class_num = metadata["labels"][class_name]
Expand Down
Loading