-
Notifications
You must be signed in to change notification settings - Fork 250
Stop copying whole image before cropping #1308
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
Stop copying whole image before cropping #1308
Conversation
…ijn/torchio into 1305-PatchSamper_speedup
@nicoloesch could you please comment on the general design? I can then fix formatting etc. |
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.
Really like the changes @StijnvWijn and this is exactly how I would have done it. Some changes are purely stylistic, others require some feedback from @fepegar about formatting and docstring description to make it as clear as possible.
Most of my comments are suggestions instead of requirements.
I fixed it, but now the apply_transform function has some less beautiful code to make a new subject, copy it and all its attributes, it uses the dict and class attributes, but I added some comments, so hopefully it is clear why. |
@nicoloesch Do you have any comments on the new copy mechanism? |
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.
All my comments have been addressed! Thank you @StijnvWijn
@allcontributors please add @nicoloesch for design, maintenance, question, review |
I've put up a pull request to add @nicoloesch! 🎉 |
@allcontributors please add @StijnvWijn for code |
I've put up a pull request to add @StijnvWijn! 🎉 |
Thank you both for your contribution! |
Fixes #1305.
Description
A slowdown while sampling patches that are much smaller than the image in Torchio >= 0.20.4
Checklist
CONTRIBUTING
docs and have a developer setup ready