flatironinstitute / CaImAn

Computational toolbox for large scale Calcium Imaging Analysis, including movie handling, motion correction, source extraction, spike deconvolution and result visualization.
https://caiman.readthedocs.io
GNU General Public License v2.0
640 stars 370 forks source link

Error when the input tif file consisting of 3D images #1231

Closed Anti-Involution closed 10 months ago

Anti-Involution commented 1 year ago

Your setup:

  1. Operating System (Linux, MacOS, Windows): MacOS
  2. Hardware type (x86, ARM..) and RAM: x86
  3. Python Version (e.g. 3.9): 3.9
  4. Caiman version (e.g. 1.9.12): 1.9.16
  5. Which demo exhibits the problem (if applicable):
  6. How you installed Caiman (pure conda, conda + compile, colab, ..): pure pip
  7. Details: When my input is a tif file which consists of 160 images(size: 512*512*3), I got the following error:
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/mesmerize_core/algorithms/mcorr.py", line 67, in run_algo
    mc.motion_correct(save_movie=True)
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/caiman/motion_correction.py", line 242, in motion_correct
    mi = min(mi, next(iterator).min()[()])
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/caiman/base/movies.py", line 2160, in load_iter
    vol[i] = y.asarray()
ValueError: could not broadcast input array from shape (512,512,3) into shape (512,3)
Anti-Involution commented 1 year ago

Anyone meets this problem?

EricThomson commented 1 year ago

Things tend to break if you are running on fewer than 400 images. We should create a more explicit warning/error about this.