-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Extend image metadata #18951
Extend image metadata #18951
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
The problem with black will be solved here #18955 |
This is more consistent with the terminology used in https://github.com/cgohlke/tifffile/blob/8a25a0d4738390af0a1f693705f29875d88fc320/tifffile/tifffile.py#L4676
This comment was marked as outdated.
This comment was marked as outdated.
Just had the same problem and my solution for this was 887b1aa |
Thanks @bernt-matthias this solved it. |
The integration test failures look real, is that because of a missing library ?
|
Also know that the files placed in lib/galaxy/datatypes/test must match the datatype, so if you're placing invalid files there you have to change the extension. |
This comment was marked as outdated.
This comment was marked as outdated.
I think I found the issue. Image files currently use Pillow for sniffing the image type:
However, reading these two images with Pillow fails. Edit: This is now fixed in 8432024. TIFFs are now sniffed using tifffile, which is more reliable than Pillow. In addition, im_corrupted.tif is removed in 9a8d944, because it isn't recognized as a TIFF file by tifffile anyways. |
This PR was merged without a "kind/" label, please correct. |
Thanks a lot @kostrykin! |
This PR adds a series of basic metadata elements for image data, including:
width
,height
,depth
of the image, as well as the number ofchannels
andframes
(the terminology is consistent with Add support for arbitrarily ordered image axes in image content assertions #18891)axes
of the image (e.g.,YXC
orZCYX
)dtype
: The data type of the image pixels or voxels (e.g.,uint8
orfloat64
)num_unique_values
: The number of unique values in the imageThis is useful to define validators for input data when working with images. Some examples of when this will be useful:
num_unique_values
is1
or2
.dtype
: Some tools might not supportfloat
but onlyint
image data (or vice versa).channels
is0
or1
: Restrict input data to single-channel images.axes
,depth
,channels
,frames
: Require that an image has one or more z-slices / channels / time steps.TIFF files are read using the tifffile library, other image types are tried to be read using Pillow. The new metadata is defined as optional, because Pillow might not be installed, or it might not be possible to read an image using Pillow (e.g., due to an image format that Pillow does not support).
For multi-page TIFF files, the metadata is determined for each page individually, and then
joined into aprovided as a JSON-encoded list of items (with the order corresponding to the order of the pages in the series).,
-separated stringHow to test the changes?
(Select all options that apply)
License