-
Notifications
You must be signed in to change notification settings - Fork 2
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 offset to account separated scales #11
Add offset to account separated scales #11
Conversation
@@ -133,6 +143,10 @@ def _loadTomogram( | |||
image_attrs["scale"] = tuple( | |||
resolution.scale * s for s in image_attrs["scale"] | |||
) | |||
image_translate = image_attrs.get("translate", (0,) * len(image_attrs["scale"])) |
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.
@kephale : I believe the tomograms don't have translations at the moment, but this assumes they could to a bit of future-proofing. What do you think?
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.
I think this needs to be sensitive to the downsampling method (average over bin, top-left corner, etc.). Since we're processing these zarrs, I guess we can make an assumption about the methd...
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.
Yeah, I'm fine assuming the method here for now.
OME-NGFF does have a place for downsampling method, but looks like we don't currently fill it.
Codecov Report
@@ Coverage Diff @@
## main #11 +/- ##
==========================================
- Coverage 87.34% 86.91% -0.43%
==========================================
Files 13 13
Lines 553 558 +5
==========================================
+ Hits 483 485 +2
- Misses 70 73 +3
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
LGTM
Given the way the tomograms were downsampled, the visualized extent of the different multi-scale level volumes should match. Also given napari's preference, the visualized extent of the volumes should start at (-0.5, -0.5, -0.5).
This PR adds an extra offset via
Layer.translate
to ensure that both these things happen. The related bug explains why the annotations previously looked slightly offset at the lower resolution scales.Thanks to @kephale for helping to catch and debug this!