Skip to content
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

imread methods shows different frame number compare with ImageJ #136

Closed
po60nani opened this issue May 24, 2022 · 5 comments
Closed

imread methods shows different frame number compare with ImageJ #136

po60nani opened this issue May 24, 2022 · 5 comments
Labels
question Further information is requested

Comments

@po60nani
Copy link

I'd like to read Tiff's video using imread techniques from your package, however, I received more frames than what I see in ImageJ. When I use tif = TiffFile('temp.tif') and check the len, it gives me the same result (len(tif. pages)). This occurs in only a few of the videos. Is there any particular explanation for this?

@cgohlke cgohlke added the question Further information is requested label May 24, 2022
@cgohlke
Copy link
Owner

cgohlke commented May 24, 2022

it gives me the same result (len(tif. pages))

Do you mean the same result as imread or as ImageJ?

Some TIFF readers (not sure about ImageJ) can only read 2^16 pages/frames.
Older versions of ScanImage produce TIFF files where the last frames are not accessible by regular TIFF readers.

@po60nani
Copy link
Author

When I used this vid_ = tifffile.imread(filename) I reached to (12614, 700, 672) for array shape, while I used tif = tifffile.TiffFile(filename) and check the length (len(tif.pages)) of it, I see 4541 for number of frames.

If I opened the same video in ImageJ, I found the number of frames is equal to 4541 frames. This is only happens for some of my files.

@cgohlke
Copy link
Owner

cgohlke commented May 25, 2022

Could be that the series metadata are wrong or parsed wrongly. Can you share a file or the output of python -m tifffile filename.tif?

@cgohlke cgohlke closed this as completed May 27, 2022
@po60nani
Copy link
Author

image

@cgohlke
Copy link
Owner

cgohlke commented May 30, 2022

In this case tifffile is using the OME metadata in the file, which obviously does not match the image data. This could be due to an interrupted acquisition. Try to use imread(filename, is_ome=False) or imread(filename, is_ome=False, is_imagej=False) to ignore the corrupted metadata.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants