Open
Conversation
Modify the ROI_number attribution
Modification of the ROI number attribution to prevent duplicated and error in opening.
Contributor
|
Hey thanks for tackling this! We should write some tests for this if possible :) Scenarios:
|
asim-shrestha
suggested changes
Feb 26, 2023
| 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""" |
Contributor
There was a problem hiding this comment.
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
"""
Comment on lines
+30
to
+33
| ROI_list = self.ds.StructureSetROISequence | ||
| ROI_number = [] | ||
| for i in range(len(ROI_list)): | ||
| ROI_number.append(ROI_list[i].ROINumber.numerator) |
Contributor
There was a problem hiding this comment.
We can use list comprehension here to simplify
Suggested change
| 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
Contributor
|
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 |
Author
|
Thank you for your answer. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.