BUG: GUI, error ROI detection cannot convert float infinity to integer
klab-buffalo opened this issue · 4 comments
Describe the issue:
updated version (updated Feb 14, 2024), using GUI, during ROI detection there was an error.
'cannot convert float infinity to integer'
Windows10
Reproduce the code example:
(suite2p) C:\Users\priv.skuhlman>python -m suite2p
loaded default ops
saved current settings in GUI as default ops
Input format: sbx
{'data_path': ['//itorg.ad.buffalo.edu/ubfs/research/JSMBS/PHB/skuhlman/data1/RawCaDataArchive/Brian/slc200_1R/slc200_1R_220602', '//itorg.ad.buffalo.edu/ubfs/research/JSMBS/PHB/skuhlman/data1/RawCaDataArchive/Brian/slc200_1R/slc200_1R_220726'], 'subfolders': [], 'sbx_ndeadcols': -1, 'save_path0': '//itorg.ad.buffalo.edu/ubfs/research/JSMBS/PHB/skuhlman/data1/ProcessedDataArchive/Sandy/Brian_Ex_RFMstability/slc200_1R', 'fast_disk': '//itorg.ad.buffalo.edu/ubfs/research/JSMBS/PHB/skuhlman/data1/ProcessedDataArchive/Sandy/Brian_Ex_RFMstability/slc200_1R', 'input_format': 'sbx'}
Running suite2p with command:
python -u -W ignore -m suite2p --ops C:\Users\priv.skuhlman\.suite2p\ops\ops.npy --db C:\Users\priv.skuhlman\.suite2p\ops\db.npy
Error message:
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>
>>>ERROR<<<
main()
File "C:\ProgramData\anaconda3\envs\suite2p\lib\site-packages\suite2p\__main__.py", line 77, in main
run_s2p(ops, db)
File "C:\ProgramData\anaconda3\envs\suite2p\lib\site-packages\suite2p\run_s2p.py", line 547, in run_s2p
op = run_plane(op, ops_path=ops_path)
File "C:\ProgramData\anaconda3\envs\suite2p\lib\site-packages\suite2p\run_s2p.py", line 342, in run_plane
>>>ERROR<<<
ops = pipeline(f_reg, f_raw, f_reg_chan2, f_raw_chan2, run_registration, ops,
File "C:\ProgramData\anaconda3\envs\suite2p\lib\site-packages\suite2p\run_s2p.py", line 171, in pipeline
ops, stat = detection.detection_wrapper(f_reg, ops=ops, classfile=classfile)
File "C:\ProgramData\anaconda3\envs\suite2p\lib\site-packages\suite2p\detection\detect.py", line 178, in detection_wrapper
stat = select_rois(
File "C:\ProgramData\anaconda3\envs\suite2p\lib\site-packages\suite2p\detection\detect.py", line 246, in select_rois
ops, stat = sourcery.sourcery(mov=mov, ops=ops)
File "C:\ProgramData\anaconda3\envs\suite2p\lib\site-packages\suite2p\detection\sourcery.py", line 405, in sourcery
S, StU, StS = getStU(ops, U)
File "C:\ProgramData\anaconda3\envs\suite2p\lib\site-packages\suite2p\detection\sourcery.py", line 67, in getStU
S = create_neuropil_basis(ops, Lyc, Lxc)
File "C:\ProgramData\anaconda3\envs\suite2p\lib\site-packages\suite2p\detection\sourcery.py", line 128, in create_neuropil_basis
ntilesY = 1 + 2 * int(
OverflowError: cannot convert float infinity to integer
Interrupted by error (not finished)
Version information:
suite2p v0.14.3
Context for the issue:
Necessary to use ROI detect in GUI
Thank you for your comment.
We face the same issue in our lab, but only when setting the sparse mode option to zero.
Since working in sparse mode reduces the number of detected ROIs, we would like to know how can we avoid this error ("cannot convert float infinity to integer") when sparse_mode=0.
Any idea would be very much appreciated.
Hmm could your diameter be set to zero?
suite2p/suite2p/detection/sourcery.py
Line 128 in be8830d
Oh yeah sorry the documentation is unclear here, it should be in pixel units. It is used for sourcery and for Cellpose (if you are in anatomical mode).