Open andrestrocyte opened 1 year ago
Before we dig into this, could you please upgrade to our most recent version of Caiman (1.9.16)? This probably won't make a difference, as you are on a Mac, but just in case.
Thanks a lot for your help Eric. Indeed, I upgraded to caiman 1.9.16 and was able to run all the cells of the script again but not visualise the movie of my imaging session, 1 bigtiff of 3.8GB. With Fiji I am able to play it. I am not sure why openCV does not work with it. I am able to play the demo video though. Thanks so much.
Just discovered that caiman is detecting my tif file as a movie of just 1 frame as print(m_orig.shape) gives (1, 512, 512) as output.
However, using PIL library the same script detects the .tif as having 7000 frames.
Could you use tiffit to extract info about your movie and print it here? https://github.com/EricThomson/tiffit
Try converting to a "good" tiff format using tiffit convert in.tiff out.tiff
. Note tiffit is a command line interface so you use it from the shell.
Caiman doesn't like things that have been saved by ImageJ. We probably should just automate this it comes up too often and ImageJ is a common but idiosyncratic package when it comes to tiff.
Here it is:
Info about bigtiff_1.tif: Number of images: 7202 Dimensions of first image: (512, 512) Byte representation: uint16 ImageJ format? False BigTIFF format? True
PS: I ran into the exact same trouble after converting my tiff into a well behaving tiff using fittiff.
Thanks for the indications
Dang it's not going to be as simple as I hoped. your movie is imagej=False
and BigTiff=True
, which is good.
How much RAM do you have? What happens when you try with the Sue demo movie?
The problem is that cm.load_movie_chain is importing my multi frame (7202 frames) big tiff into a single frame movie.
The Sue movie runs well and is detected correctly as a 3000 frames movie. I have 16GB =. Thanks so much!
Could you trim your movie down to 2000 frames resave and see if it is still a problem? It probably isn’t it but just checking the obvious stuff. If still a problem do you mind sharing the smaller movie?
The problem persists with less than 2000 frames.
You can download the small tiff here:
https://drive.google.com/file/d/1Sy-hBVuZoZWOLaacDih5qsL4sIQP_udc/view?usp=sharing
Thanks a lot!
I reproduced this behavior. I will have to look more deeply at the metadata for your movie my guess is it is something we've never seen before. It's just loading a single image from a 2000-frame stack. At least it isn't mac specific. 😬
Even just tifffile.imload()
is seeing it as a single image, so this problem is bubbling down even into the back end tiff loader that we use for pretty much everything. I probably won't be able to get to this until after Thanksgiving vacation which is this week. But it is truly strange. the more information you can get me about this movie the better. Where is this data from how did you collect it, i.e., is it some proprietary image acquisition system or something custom?
If you can get me an even shorter version that would be helpful (like 400 frames), and with your permission I'll probably follow up with the developer of tifffile if I can't crack it. I've looked at the metadata in some detail and am not seeing anything particularly alarming. It opens fine in ImageJ, which is just bizarre.
The shared bigtiff_1.tif
file contains 1994 separate "series". Tifffile returns the first series by default. Looks like the software used to produce the file did not use tifffile correctly to write a single-series multi-page TIFF.
Thanks a lot @cgohlke and @EricThomson.
The images are taken using a 2p microscope Bruker system and Prairie View. However, as the output were single image tiffs, I combined them into a big tiff using custom written code. As it passed the sanity check of ImageJ, I considered it was good.
I will check my code to generate single-series TIFFs and retry. I will come back here to confirm it is solved.
Thanks a lot for the help and Happy Thanksgiving!
Thanks a lot @cgohlke! That sounds like it will be the issue. I will have to figure out a way to check for this and hopefully correct for it in tiffit.
One thing at the workshop at SFN we realized we should provide is a method to convert a pile of tiff to a single multi page file. This comes up a lot.
@andrestrocyte feel free to share your code here, or I will post some that works when I get a chance.
Hello, @EricThomson . Thanks again for the help. I wrote some simple code that now appends all the individual single TIFFs into a single plane, single series, multipage big tiff.
It works well with the scripts for 20000 frames videos (9GB).
Should I still keep the videos below 4GB even if my bigger Bigtiffs are multipage? Would you be interested in me sharing the custom code?
Good to hear! You don't need to keep files under 4GB. Bigtiff can handle very large file sizes (many petabytes), so it's more a matter of how you want to organize things.
I'd definitely be curious to see what you did. Feel free to email it to me if you'd rather do that. I was planning to work on it this week so it would be good to see something that worked :smile:
Sure, I copy-paste, like this anyone with the same issue can benefit from it. Feel free to indicate any potential flaws.
Thanks a lot!
Sure, I copy-paste, like this anyone with the same issue can benefit from it. Feel free to indicate any potential flaws.
Thanks a lot!
Thanks that's really helpful: I was thinking of using PIL
but I will copy you and use tifffile
! BTW I love the logo! :smile:
I'll post more later. If we end up doing something like this in Caiman I'll let you know we should make you a contributor!
🙂Thanks for the help along the way!
Hello! I ran the demo pipeline on a test imaging session that I took (single tiff, 3.8GB).
I can successfully go through all the steps, except when trying to display the movie, having an Error message from OpenCV. I have tried to troubleshoot it with no success.
Any input would be appreciated. Thanks a lot!
Please fill in the following for any issues
Your setup: