-
Notifications
You must be signed in to change notification settings - Fork 36
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
Add coordinate for Measurement in SR #307
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
|
||
from highdicom.sr.coding import CodedConcept | ||
from highdicom.sr.content import ( | ||
FindingSite, | ||
CoordinatesForMeasurement, FindingSite, | ||
LongitudinalTemporalOffsetFromEvent, | ||
ImageRegion, | ||
ImageRegion3D, | ||
|
@@ -2386,7 +2386,7 @@ def __init__( | |
finding_sites: Optional[Sequence[FindingSite]] = None, | ||
method: Optional[Union[CodedConcept, Code]] = None, | ||
properties: Optional[MeasurementProperties] = None, | ||
referenced_images: Optional[Sequence[SourceImageForMeasurement]] = None, | ||
referenced_images: Optional[Sequence[Union[SourceImageForMeasurement, CoordinatesForMeasurement]]] = None, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I created another option and used the same Another solution I see would be to expand If a |
||
referenced_real_world_value_map: Optional[RealWorldValueMap] = None | ||
): | ||
""" | ||
|
@@ -2429,8 +2429,8 @@ def __init__( | |
Measurement properties, including evaluations of its normality | ||
and/or significance, its relationship to a reference population, | ||
and an indication of its selection from a set of measurements | ||
referenced_images: Union[Sequence[highdicom.sr.SourceImageForMeasurement], None], optional | ||
Referenced images which were used as sources for the measurement | ||
referenced_images: Union[Sequence[Union[highdicom.sr.SourceImageForMeasurement, highdicom.sr.CoordinatesForMeasurement]], None], optional | ||
Referenced images or coordinates which were used as sources for the measurement | ||
referenced_real_world_value_map: Union[highdicom.sr.RealWorldValueMap, None], optional | ||
Referenced real world value map for referenced source images | ||
|
||
|
@@ -2495,10 +2495,10 @@ def __init__( | |
content.extend(properties) | ||
if referenced_images is not None: | ||
for image in referenced_images: | ||
if not isinstance(image, SourceImageForMeasurement): | ||
if not isinstance(image, (SourceImageForMeasurement, CoordinatesForMeasurement)): | ||
raise TypeError( | ||
'Arguments "referenced_images" must have type ' | ||
'SourceImageForMeasurement.' | ||
'SourceImageForMeasurement or CoordinatesForMeasurement.' | ||
) | ||
content.append(image) | ||
if referenced_real_world_value_map is not None: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has nothing to do with ImageRegion, but I reused
SourceImageForRegion
here as it needs to be an image withSELECTED FROM
relationship. Not sure if there's a better option.