Skip to content

Commit

Permalink
Revert 2 out of 3 list comprehension changes
Browse files Browse the repository at this point in the history
The order of the returned list should not be modified.
  • Loading branch information
DimitriPapadopoulos committed Oct 11, 2023
1 parent f68275b commit b58899c
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/highdicom/seg/sop.py
Original file line number Diff line number Diff line change
Expand Up @@ -2595,9 +2595,12 @@ def segmented_property_categories(self) -> List[CodedConcept]:
descriptions in this SEG image.
"""
return list(
{desc.segmented_property_category for desc in self.SegmentSequence}
)
categories = []
for desc in self.SegmentSequence:
if desc.segmented_property_category not in categories:
categories.append(desc.segmented_property_category)

return categories

@property
def segmented_property_types(self) -> List[CodedConcept]:
Expand All @@ -2610,9 +2613,12 @@ def segmented_property_types(self) -> List[CodedConcept]:
descriptions in this SEG image.
"""
return list(
{desc.segmented_property_type for desc in self.SegmentSequence}
)
types = []
for desc in self.SegmentSequence:
if desc.segmented_property_type not in types:
types.append(desc.segmented_property_type)

return types

def _get_pixels_by_seg_frame(
self,
Expand Down

0 comments on commit b58899c

Please sign in to comment.