-
Notifications
You must be signed in to change notification settings - Fork 37
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
Seg Array Optimization #208
Conversation
Thanks Steve. If you do have time to test on your hardware at some point during the process that would be very helpful. I think before or after @hackermd has a look would be fine, I don't expect the core numerical process to change much |
A couple of other points to note:
|
Thanks @CPBridge. I will take a look.
|
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.
A few suggestions regarding style.
Co-authored-by: Markus D. Herrmann <hackermd@users.noreply.github.com>
Co-authored-by: Markus D. Herrmann <hackermd@users.noreply.github.com>
Co-authored-by: Markus D. Herrmann <hackermd@users.noreply.github.com>
…icom into seg_array_optimization
Co-authored-by: Markus D. Herrmann <hackermd@users.noreply.github.com>
Co-authored-by: Markus D. Herrmann <hackermd@users.noreply.github.com>
…athology/highdicom into seg_array_optimization
@hackermd I have refactored out all the database logic and I think this is ready to go |
Co-authored-by: Markus D. Herrmann <hackermd@users.noreply.github.com>
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.
@hackermd I have addressed the various comments, mostly just accepting all suggestions. I have attempted to improve the docstrings for the _SegDBManager
class
A few improvements focused on improving the efficiency of building segmentation arrays from loaded Segmentation objects.
This was achieved through:
_frames_lut
more than necessary.combine_segments
option, rather than implementing it as a postprocessing of the standard routine. This reduces memory consumption significantly as it is now O(1) rather than O(n) in the number of segments requested.skip_overlap_checks
), which results in a further modest speed-up.@pieper you should now find that your example from #202 runs significantly faster and uses much less memory than before when
combine_segments=True
(especially in the case where the full set of segments is requested).I went a little way down the path of JITing the methods with numba, but it actually slowed things down. There may be a bit more performance improvement possibly using threading, but we are hitting on some numpy limitations