-
Notifications
You must be signed in to change notification settings - Fork 56
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
Parameter to reduce the error to a warning #63 #64
Conversation
rt_utils/rtstruct_builder.py
Outdated
f"Loaded RTStruct references image(s) that are not contained in input series data. " | ||
+ f"Problematic image has SOP Instance Id: {contour_image.ReferencedSOPInstanceUID}" | ||
) | ||
else: | ||
raise Exception( | ||
f"Loaded RTStruct references image(s) that are not contained in input series data. " | ||
+ f"Problematic image has SOP Instance Id: {contour_image.ReferencedSOPInstanceUID}" |
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.
Lets extract the message in a common variable and reuse within the two cases
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.
Absolutely! Done here 41aa821
Change the Exception to a warning message if warn_only is set to True
rt_utils/rtstruct.py
Outdated
@@ -12,9 +12,10 @@ class RTStruct: | |||
Wrapper class to facilitate appending and extracting ROI's within an RTStruct | |||
""" | |||
|
|||
def __init__(self, series_data, ds: FileDataset, ROIGenerationAlgorithm=0): | |||
def __init__(self, series_data, ds: FileDataset, ROIGenerationAlgorithm=0, warn_only: bool = False): |
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.
Same thing as other comment, do we need this?
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.
Same as above 7798fde
rt_utils/rtstruct_builder.py
Outdated
@@ -20,18 +20,18 @@ def create_new(dicom_series_path: str) -> RTStruct: | |||
|
|||
series_data = image_helper.load_sorted_image_series(dicom_series_path) | |||
ds = ds_helper.create_rtstruct_dataset(series_data) | |||
return RTStruct(series_data, ds) | |||
return RTStruct(series_data, ds, warn_only=warn_only) |
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.
Lets remove warn_only here (causing build failures)
Try running pytest in the root directory to see if failures persist
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.
Done, pytest ran with no error
Thanks for making all of the changes! |
Pull request for issue #63