-
Notifications
You must be signed in to change notification settings - Fork 241
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
Motion corrected tiff-files only have one frame #647
Comments
is this a function of tiff size / formatting? how to read tiffs with tifffile (from documentation https://pypi.org/project/tifffile/):
how we write tiffs: Line 59 in 4b6c3a9
happy to accept pull requests on tiff writing if you think there's a better format |
Thank you for the simple solution, that seems to work! It's strange because the tifffile.imread method worked fine when I originally wrote the code to use the suite2p extracted tifffiles. |
I'm observing the same thing when saving tiffs after motion correction using def format_suite2p_stack(filename):
tif = tifffile.TiffFile(filename)
tif_stack = tifffile.imread(filename, key=range(len(tif.pages)))
tifffile.imwrite(filename, tif_stack) Is there a reason however not to save the tiffs using Update: |
Issue: When setting
'reg_tif': True
, the extracted tiff-files seem to only have one frame, at least when imported with the tifffile package.To reproduce: Run the example analysis on some existing tifffiles, and set
'reg_tif': True
in the options.Then, load a registered tiff file as follows:
Which returns
(176, 156)
indicating only a single frame instead of a stack of frames.
This was reproduced with both our own example tiffs, and yours.
Package version:
tifffile==2021.3.17
suite2p==0.10.0
Expected behavior
Which should return
(num_frames, 176, 156)
It is very possible I am reading the tifffile in the wrong way of course. However, when I read the original tiffiles using the above methods, it correctly creates a 3-D array.
In our own neuripil separation package this leads to problems in our current Suite2P implementation: rochefort-lab/fissa#148
One of our users also posted a solution there to work directly with the binary data file. We are reworking our example to work directly with the binary data file instead also, but still thought I'd point this out. For future use, using the tifffile would probably also be more resistant to API changes.
The text was updated successfully, but these errors were encountered: