-
Notifications
You must be signed in to change notification settings - Fork 8
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 support for the get_transform
analog to set_transform
#264
base: main
Are you sure you want to change the base?
Conversation
This reverts the formatting changes that were accidentally included with commit 0c21a73.
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 for your contribution! I've left my comments inline.
Re: CI failure: please refer to the contributing guide. |
passed the precommit checks 👍 |
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.
Edit: I remembered it wrong |
Isn't it as simple as returning the |
You're right! I mistakenly thought that |
iohub/ngff/nodes.py
Outdated
) | ||
scale = [s1 * s2 for s1, s2 in zip(scale, trans.scale)] | ||
return scale | ||
return self.get_effective_scale("*").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.
This used to be the scale of the highest resolution, so it should be the first array instead 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.
I think this is why tests are failing for 6fc5ad6.
…olution image metadata
…ve scale and translation transforms
…d of TransformationMeta
Separated into 2 unit tests, return plain list of floats instead of |
arr_name=short_alpha_numeric, | ||
) | ||
def test_get_effective_scale_image(transforms, ch_shape_dtype, arr_name): | ||
"""Test `iohub.ngff.Position.set_transform()`""" |
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.
"""Test `iohub.ngff.Position.set_transform()`""" | |
"""Test `iohub.ngff.Position.get_effective_scale()`""" |
arr_name=short_alpha_numeric, | ||
) | ||
def test_get_effective_translation_image(transforms, ch_shape_dtype, arr_name): | ||
"""Test `iohub.ngff.Position.set_transform()`""" |
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.
"""Test `iohub.ngff.Position.set_transform()`""" | |
"""Test `iohub.ngff.Position.get_effective_translation()`""" |
given a set of scale and translation transforms, defined on both the group and individual individual images, each image will have a final scale and translation. These can now be conveniently retrieved with a little helper function that fetches all appropriate translations and applies them consecutively.
small test added to cover changes.