-
Notifications
You must be signed in to change notification settings - Fork 34
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
Fixes to dimension indices #92
Conversation
Also added a release notes page to the docs that should guide users through the backwards-incompatible removal of |
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.
Thanks @CPBridge. Looks nice! The constructor has become quite a beast now and I am wondering whether we could factor some of the code out into separate methods. It's tricky because instance attributes are being set all over the place, but some parts could probably be separated into functions with no (or only very few) side effects. What do you think?
@hackermd I have moved some of the low hanging fruit to methods, unfortunately I don't think there's much more that can be done without passing huge parameter list around |
Yeah, I also found this difficult on other classes. The changes that you've made are nice. The constructor has already lost quite a bit of weight. |
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.
Looks very! Thanks @CPBridge. I only have one minor additional suggestion.
Co-authored-by: Markus D. Herrmann <hackermd@users.noreply.github.com>
This PR fixes a few known issues with the way highdicom deals with the dimension indices in the Segmentation Image IOD. The following changes are implemented:
add_segments()
method of theSegmentation
class because information about all segments is required when the instance is created in order to correctly calculate the dimension index value for every segment. To make this possible, the constructor can now accept a 4D array, where multiple segments (that would have previously been added sequentially viaadd_segments
) may be concatenated along the fourth (final) dimension. This has a nice side effect of bringing the constructor in line with the "decoding" behaviour in Segmentation Parsing #74, which returns 4D arrays with the same interpretation.