MouseLand / suite2p

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

BUG: Error when ROI Detection is started #948

Closed maristanye closed 1 year ago

maristanye commented 1 year ago

Describe the issue:

Hi there,

Thanks for the nice app! I get the following error when trying to analyze through tifs with the following size (512x512x54) (see below):

ValueError: could not broadcast input array from shape (8,416,452) into shape (7,416,452) Interrupted by error (not finished)

here is a screenshot of the ops window Ops_error

Reproduce the code example:

----------- ROI DETECTION
Binning movie in chunks of length 13
>>>ERROR<<<
Traceback (most recent call last):
  File "C:\Users\user\anaconda3\envs\suite2p\lib\runpy.py", line 194, in _run_module_as_main
>>>ERROR<<<
    return _run_code(code, main_globals, None,
  File "C:\Users\user\anaconda3\envs\suite2p\lib\runpy.py", line 87, in _run_code
>>>ERROR<<<
    exec(code, run_globals)
  File "C:\Users\user\anaconda3\envs\suite2p\lib\site-packages\suite2p\__main__.py", line 78, in <module>
    main()
  File "C:\Users\user\anaconda3\envs\suite2p\lib\site-packages\suite2p\__main__.py", line 71, in main
    run_s2p(ops, db)
  File "C:\Users\user\anaconda3\envs\suite2p\lib\site-packages\suite2p\run_s2p.py", line 429, in run_s2p
>>>ERROR<<<
    op = run_plane(op, ops_path=ops_path)
  File "C:\Users\user\anaconda3\envs\suite2p\lib\site-packages\suite2p\run_s2p.py", line 292, in run_plane
>>>ERROR<<<
    ops = pipeline(f_reg, f_raw, f_reg_chan2, f_raw_chan2, run_registration, ops, stat=stat)
  File "C:\Users\user\anaconda3\envs\suite2p\lib\site-packages\suite2p\run_s2p.py", line 129, in pipeline
    ops, stat = detection.detection_wrapper(f_reg,
  File "C:\Users\user\anaconda3\envs\suite2p\lib\site-packages\suite2p\detection\detect.py", line 112, in detection_wrapper
    mov = bin_movie(f_reg, bin_size, yrange=yrange, 
  File "C:\Users\user\anaconda3\envs\suite2p\lib\site-packages\suite2p\detection\detect.py", line 60, in bin_movie
    mov[ik : ik + n_bins] = data
ValueError: could not broadcast input array from shape (8,416,452) into shape (7,416,452)
Interrupted by error (not finished)

Error message:

Traceback (most recent call last):
  File "C:\Users\user\anaconda3\envs\suite2p\lib\runpy.py", line 194, in _run_module_as_main
>>>ERROR<<<
    return _run_code(code, main_globals, None,
  File "C:\Users\user\anaconda3\envs\suite2p\lib\runpy.py", line 87, in _run_code
>>>ERROR<<<
    exec(code, run_globals)
  File "C:\Users\user\anaconda3\envs\suite2p\lib\site-packages\suite2p\__main__.py", line 78, in <module>
    main()
  File "C:\Users\user\anaconda3\envs\suite2p\lib\site-packages\suite2p\__main__.py", line 71, in main
    run_s2p(ops, db)
  File "C:\Users\user\anaconda3\envs\suite2p\lib\site-packages\suite2p\run_s2p.py", line 429, in run_s2p
>>>ERROR<<<
    op = run_plane(op, ops_path=ops_path)
  File "C:\Users\user\anaconda3\envs\suite2p\lib\site-packages\suite2p\run_s2p.py", line 292, in run_plane
>>>ERROR<<<
    ops = pipeline(f_reg, f_raw, f_reg_chan2, f_raw_chan2, run_registration, ops, stat=stat)
  File "C:\Users\user\anaconda3\envs\suite2p\lib\site-packages\suite2p\run_s2p.py", line 129, in pipeline
    ops, stat = detection.detection_wrapper(f_reg,
  File "C:\Users\user\anaconda3\envs\suite2p\lib\site-packages\suite2p\detection\detect.py", line 112, in detection_wrapper
    mov = bin_movie(f_reg, bin_size, yrange=yrange, 
  File "C:\Users\user\anaconda3\envs\suite2p\lib\site-packages\suite2p\detection\detect.py", line 60, in bin_movie
    mov[ik : ik + n_bins] = data
ValueError: could not broadcast input array from shape (8,416,452) into shape (7,416,452)
Interrupted by error (not finished)

Version information:

suite2p v0.11.1

Context for the issue:

It prevents me from preprocessing the data.

chriski777 commented 1 year ago

Hi @maristanye, this may be related to issue #935. Can you try pulling the latest changes on the refactor branch and see if this issue still persists? If so, could you possibly upload a small snippet of the dataset and the settings you had to reproduce this error? Thanks in advance.

carsen-stringer commented 1 year ago

Going to close as a potential duplicate