MouseLand / suite2p

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

BUG: manual ROI extraction error #1084

Closed EunJungHwang closed 2 months ago

EunJungHwang commented 5 months ago

Describe the issue:

I have 2 channel (GC and tom) 2p data. When I added an ROI manually and tried to extract it, I got an error complaining that it needs "number of frames n_frames when writing file".

Reproduce the code example:

Used the GUI native feature.

Error message:

1 cells added to manual GUI
Masks made in 0.26 sec.
Extracted fluorescence from 1 ROIs in 83442 frames, 132.92 sec.
Traceback (most recent call last):
  File "C:\Users\eunjung\anaconda3\envs\suite2p\lib\site-packages\suite2p\gui\drawroi.py", line 445, in proc_ROI
    F, Fneu, F_chan2, Fneu_chan2, spks, ops, stat = masks_and_traces(
  File "C:\Users\eunjung\anaconda3\envs\suite2p\lib\site-packages\suite2p\gui\drawroi.py", line 53, in masks_and_traces
    F, Fneu, F_chan2, Fneu_chan2 = extract_traces_from_masks(ops, manual_cell_masks,
  File "C:\Users\eunjung\anaconda3\envs\suite2p\lib\site-packages\suite2p\extraction\extract.py", line 148, in extract_traces_from_masks
    with BinaryFile(Ly=ops["Ly"], Lx=ops["Lx"],
  File "C:\Users\eunjung\anaconda3\envs\suite2p\lib\site-packages\suite2p\io\binary.py", line 36, in __init__
    raise ValueError(
ValueError: need to provide number of frames n_frames when writing file

Version information:

v0.14.3

Context for the issue:

No response

chriski777 commented 4 months ago

Hi @EunJungHwang, have you tried pulling the fix from #1086 and seeing if that addresses your issue?

EunJungHwang commented 2 months ago

Yes, the fix from #1086 solved the issue perfectly. Thanks!