-
Notifications
You must be signed in to change notification settings - Fork 6
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
TIFF stack correctly being parsed but axis assignment fails. #491
Comments
This file contains erroneous information. It has some metadata from tifffile that says it is Probably if it had been written |
See girder/large_image#1273 for a change that hardens against this sort of badly written file. |
@manthey The command that you suggested didn't work. The UI thought that the image had 1000 channels. |
Can you send a code snippet of what you are doing with tifffile to make the image stack (with numpy zero arrays, for instance)? I find it odd that you have to specify axes manually and then it can't read them back. It makes me think that tifffile is inconsistent or the api is different than you expect. |
This is akin to the original code I had written. import numpy as np
import tifffile
image = np.zeros((1, 1, 4, 1000, 1000))
tifffile.imwrite('test.tif', image, metadata={'axes': 'ZTCYX'}) |
Hmm... When I use tifffile to write things out, they end up the expected way (that is, my dimensions and axes correspond -- as you note, my example would have produced 1000 channels). I can't make a tiff file that is broken in the manner that you shared. Your tiff file had some interesting properties (tifftools dump is shown below), such as white points and chromacities. Are you using some other library to facilitate writing these? Even overriding the photometric and planar arrangement still gets me good files (not like yours).
|
Nope, I'm running the code exactly as is using tifffile 2023.8.12. |
Could you provide me an example TIFF from your end that is considered a "good file" and the code you used to generate it? |
@zjniu Your code snippet worked for me directly. |
Re |
I created a TIFF stack using the
tifffile
package and specifying the axis order usingtifffile.imwrite('image.tif', image, metadata={'axes': 'CYX'})
. Here is one such TIFF to this issue, which has a total of 4 channels. While the parser successfully detects the channels, as shown below, it fails to assign the axes properly. The size of each axis is displayed as a question mark.The text was updated successfully, but these errors were encountered: