nel-lab / mesmerize-core

High level pandas-based API for batch analysis of Calcium Imaging data using CaImAn
Other
59 stars 15 forks source link

Error when play the motion correction with new notebook #251

Closed zhouyi0812 closed 9 months ago

zhouyi0812 commented 10 months ago

Hello! When trying to plot with LazyTiff with demo movie, there is an error. Thank you!

AttributeError                            Traceback (most recent call last)
Cell In[57], line 1
----> 1 a = LazyTiff(df.iloc[0].caiman.get_input_movie_path())
      2 a.shape

File C:\Users\Public\anaconda3\envs\mescore\lib\site-packages\mesmerize_core\arrays\_tiff.py:27, in LazyTiff.__init__(self, path, shape)
     13 """
     14 Lazy reader for tiff files. WIP, works for some tiff files.
     15 Try ``tifffile.memmap`` first before trying ``LazyTiff``
   (...)
     23     manually set shape
     24 """
     26 self._tif = tifffile.TiffFile(path)
---> 27 tiffseries = self._tif.series[0].levels[0]
     29 if shape is None:
     30     # TODO: someone who's better with tiff can help on this
     31     if len(self._tif.pages) == 1:

AttributeError: 'TiffPageSeries' object has no attribute 'levels'
kushalkolar commented 10 months ago

LazyTiff doesn't work with all tiff files, if you convert your tiff files using tiffit you should be able to use tifffile.memmap

https://github.com/EricThomson/tiffit

kushalkolar commented 9 months ago

closing, I guess you got this fixed