-
Notifications
You must be signed in to change notification settings - Fork 995
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 arbitrarily ordered image axes in image content assertions #18891
base: dev
Are you sure you want to change the base?
Conversation
This is a huge work. Thank you so much! |
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.
Found a typo
Co-authored-by: Lucille Delisle <[email protected]>
Co-authored-by: Lucille Delisle <[email protected]>
2d9910a: The failing
|
@kostrykin the tests are failing in other PRs as well. They are unrelated. |
Image content assertions were introduced in #17581, but only had support for 2-D images with the axes of the image ordered like
YX
orYXC
, i.e. the channel axis is the last axis of the image (if present at all). However, TIFF files can also have three and more dimensions (aka axes) and their order may vary. The axes are described in the metadata of the TIFF file.This PR adds support for using the content assertions with higher-dimensional TIFF files and arbitrarily ordered image axes by relying on the metadata of the TIFF file. The supported axes are
T
time steps,Z
slices,Y
vertical coordinates,X
horizontal coordinates,C
channels, andS
samples. Only theYX
axes are mandatory, all other axes are optional.This is accomplished by normalizing all images to
TZYXC
when they are loaded. Normalization is performed without modifying the loaded image, but using numpy functions which yield views, and is thus efficient. TheS
axis is treated as an alias of aC
axis (it doesn't make sense to include both in a TIFF file).In addition, the following assertions are added:
has_image_depth
to verify the number of slices along theZ
axishas_image_frames
to verify the number of time steps along theT
axisThe optional
slice
andframe
attributes are added to the existing content checking assertions to restrict those to specific slices, frames, or combinations thereof.Fix #18851 cc @lldelisle
How to test the changes?
(Select all options that apply)
[add testing steps and prerequisites here if you didn't write automated tests covering all your changes]License