-
Notifications
You must be signed in to change notification settings - Fork 57
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
ROI_number attribution #78
base: main
Are you sure you want to change the base?
Conversation
Modify the ROI_number attribution
Modification of the ROI number attribution to prevent duplicated and error in opening.
Hey thanks for tackling this! We should write some tests for this if possible :) Scenarios:
|
j = j+1 | ||
return j | ||
|
||
"""choose a ROI number which has not been attributed to the ROI already existing the original RTstructure. This might prevent duplicate and error in opening""" |
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.
Comment should be placed after the function declaration
def roi_number(self):
"""
choose a ROI number which has not been attributed to the ROI already existing the original RTstructure. This might prevent duplicate and error in opening
"""
ROI_list = self.ds.StructureSetROISequence | ||
ROI_number = [] | ||
for i in range(len(ROI_list)): | ||
ROI_number.append(ROI_list[i].ROINumber.numerator) |
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.
We can use list comprehension here to simplify
ROI_list = self.ds.StructureSetROISequence | |
ROI_number = [] | |
for i in range(len(ROI_list)): | |
ROI_number.append(ROI_list[i].ROINumber.numerator) | |
roi_numbers = [roi.ROINumber.numerator for roi in self.ds.StructureSetROISequence ] |
note we have been using lowercase for ROI, we should remain consistent
Side note, it looks like some existing unit tests are failing, will need to update those Also, this looks like it has all of your previous commits that have been merged in, perhaps you need to sync your fork with the mainline repo |
Thank you for your answer. |
When trying to automatize addition of ROI in several RTstructure files, one problem is that ROI number in RTstructure might differ and are not successive (sometime going from 10 to 50).
Here is a proposition to check if the ROI number exists and give an original ROI number to prevent error in opening of the RT
structure in software.