-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add option to scale sample image #26
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #26 +/- ##
==========================================
+ Coverage 82.08% 83.05% +0.96%
==========================================
Files 9 9
Lines 402 425 +23
==========================================
+ Hits 330 353 +23
Misses 72 72 ☔ View full report in Codecov by Sentry. |
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.
Generally code changes look good and are very clear - made some tiny comments.
Joint local testing suggests double-checking manually is a worthy next step?
I've now cached the original moving image data to allow for multiple rescaling operations to be completed. I've also disallowed pixel sizes of 0 to prevent undefined behaviour. |
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.
Manual testing suggest this works nice and smoothly, and as expected, now 🎉
Some tiny final comments to take or leave :)
@@ -58,9 +58,11 @@ def __init__(self, parent=None): | |||
rotation_range = 360 | |||
|
|||
self.adjust_moving_image_voxel_size_x = QDoubleSpinBox(parent=self) | |||
self.adjust_moving_image_voxel_size_x.setDecimals(5) | |||
self.adjust_moving_image_voxel_size_x.setDecimals(2) | |||
self.adjust_moving_image_voxel_size_x.setMinimum(0.01) |
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.
(not sure) Should we allow the maximum to be > the default 99.99 (given that we have a 100um atlas)?
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 set it to be 100.00 just to catch that edge case, I don't think anyone will be acquiring anything at that coarse of a resolution but it's good to be prepared just in case.
self.layout().addRow(QLabel("Adjust the moving image: ")) | ||
self.layout().addRow(QLabel("Adjust the moving image scale:")) | ||
self.layout().addRow( | ||
"Sample image X pixel size:", self.adjust_moving_image_voxel_size_x |
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.
"Sample image X pixel size:", self.adjust_moving_image_voxel_size_x | |
"Sample image X pixel size [\u03BCm]:", self.adjust_moving_image_voxel_size_x |
Worth specifying micron as unit for clarity?
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.
Definitely, great suggestion!
Before submitting a pull request (PR), please read the contributing guide.
Please fill out as much of this template as you can, but if you have any problems or questions, just leave a comment and we will help out :)
Description
What is this PR
Why is this PR needed?
The plugin didn't have an option to handle images that are of a different resolution to the atlas.
What does this PR do?
There are now fields to enter the pixel size of the sample image and a button that downsamples it to the atlas resolution.
References
#19
How has this PR been tested?
Tests have been added to cover new functionality.
Is this a breaking change?
No.
Does this PR require an update to the documentation?
No.
Checklist: