MouseLand / suite2p

cell detection in calcium imaging recordings
http://www.suite2p.org
GNU General Public License v3.0
334 stars 239 forks source link

ValueError: operands could not be broadcast together with shapes #1123

Closed C57B6J closed 2 weeks ago

C57B6J commented 1 month ago

Describe the issue:

I am having difficulty opening a tiff stack in suite2p. I read through the only guide I could find, but it doesn't seem to describe how to get files to load properly. https://suite2p.readthedocs.io/en/latest/gui.html

I tried changing the block size, I tried converting the tiff stack to 32 bit grayscale instead of a lone green channel as well. Neither seem to make a difference. Any insight into how to use this software and what this error means would be very helpful.

Thanks in advance.

Reproduce the code example:

{'data_path': ["C:/Users/...Suite2p Analysis of GCaMP", "C:/Users/.../Suite2p Analysis of GCaMP", "C:/Users/.../Suite2p Analysis of GCaMP/Data"], 'subfolders': [], 'save_path0': "C:/Users/.../Suite2p Analysis of GCaMP", 'fast_disk': "C:/Users/.../Suite2p Analysis of GCaMP", 'input_format': 'tif'}
tif

Error message:

** Found 3 tifs - converting to binary **
>>>ERROR<<<
Traceback (most recent call last):
  File "C:\ProgramData\anaconda3\envs\suite2p\lib\runpy.py", line 197, in _run_module_as_main
>>>ERROR<<<
    return _run_code(code, main_globals, None,
  File "C:\ProgramData\anaconda3\envs\suite2p\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\ProgramData\anaconda3\envs\suite2p\lib\site-packages\suite2p\__main__.py", line 84, in <module>
    main()
  File "C:\ProgramData\anaconda3\envs\suite2p\lib\site-packages\suite2p\__main__.py", line 77, in main
>>>ERROR<<<
    run_s2p(ops, db)
  File "C:\ProgramData\anaconda3\envs\suite2p\lib\site-packages\suite2p\run_s2p.py", line 505, in run_s2p
    ops0 = io.tiff_to_binary(ops.copy())
  File "C:\ProgramData\anaconda3\envs\suite2p\lib\site-packages\suite2p\io\tiff.py", line 210, in tiff_to_binary
    ops1[j]["meanImg"] += im2write.astype(np.float32).sum(axis=0)
ValueError: operands could not be broadcast together with shapes (512,512) (512,512,3) (512,512) 
Interrupted by error (not finished)

Version information:

suite2p v0.14.4

Context for the issue:

I am trying to establish an analytical pipeline that I can consistently rely on to compare confocal imaging data of GCaMP signal which I can reliably use to validate my rather challenging imaging preparation. Currently, this is a bottleneck preventing additional experiments.

C57B6J commented 3 weeks ago

I resolved this issue by opening my tiff stack in Fiji and converting it to 8 bit (grayscale), and now it loads fine.