suite2p icon indicating copy to clipboard operation
suite2p copied to clipboard

manual labeling extraction

Open immj22 opened this issue 2 years ago • 3 comments

Describe the issue:

Hi,

If I run the analysis after setting the 'anatomical_only' as 3, I cannot extract any data from manual labeling. However, if I set anatomical_only as 0, I could use manual labeling extraction function with the same data set. I'm wondering this error is normal because the analysis mode is different.

Reproduce the code example:

Traceback (most recent call last):
  File "C:\Users\Minju\anaconda3\envs\suite2p\lib\site-packages\suite2p\gui\menus.py", line 22, in <lambda>
    loadProc.triggered.connect(lambda: io.load_dialog(parent))
  File "C:\Users\Minju\anaconda3\envs\suite2p\lib\site-packages\suite2p\gui\io.py", line 179, in load_dialog
    load_proc(parent)
  File "C:\Users\Minju\anaconda3\envs\suite2p\lib\site-packages\suite2p\gui\io.py", line 307, in load_proc
    load_to_GUI(parent, basename, output)
  File "C:\Users\Minju\anaconda3\envs\suite2p\lib\site-packages\suite2p\gui\io.py", line 332, in load_to_GUI
    make_masks_and_enable_buttons(parent)
  File "C:\Users\Minju\anaconda3\envs\suite2p\lib\site-packages\suite2p\gui\io.py", line 97, in make_masks_and_enable_buttons
    parent.xyrat = parent.ops["diameter"][0] / parent.ops["diameter"][1]
ZeroDivisionError: division by zero
1 cells added to manual GUI

Error message:

Traceback (most recent call last):
  File "C:\Users\Minju\anaconda3\envs\suite2p\lib\site-packages\suite2p\gui\drawroi.py", line 415, in proc_ROI
    F, Fneu, F_chan2, Fneu_chan2, spks, ops, stat = masks_and_traces(self.parent.ops, stat0, self.parent.stat)
  File "C:\Users\Minju\anaconda3\envs\suite2p\lib\site-packages\suite2p\gui\drawroi.py", line 32, in masks_and_traces
    stat_all = roi_stats(stat_all, ops['Ly'], ops['Lx'], aspect=ops.get('aspect', None), diameter=ops['diameter'])
  File "C:\Users\Minju\anaconda3\envs\suite2p\lib\site-packages\suite2p\detection\stats.py", line 230, in roi_stats
    ellipse = roi.fit_ellipse(dy, dx)
  File "C:\Users\Minju\anaconda3\envs\suite2p\lib\site-packages\suite2p\detection\stats.py", line 180, in fit_ellipse
    return fitMVGaus(self.ypix[self.soma_crop],
  File "C:\Users\Minju\anaconda3\envs\suite2p\lib\site-packages\suite2p\detection\stats.py", line 296, in fitMVGaus
    radii, evec = np.linalg.eig(cov)
  File "<__array_function__ internals>", line 180, in eig
  File "C:\Users\Minju\anaconda3\envs\suite2p\lib\site-packages\numpy\linalg\linalg.py", line 1312, in eig
    _assert_finite(a)
  File "C:\Users\Minju\anaconda3\envs\suite2p\lib\site-packages\numpy\linalg\linalg.py", line 209, in _assert_finite
    raise LinAlgError("Array must not contain infs or NaNs")
numpy.linalg.LinAlgError: Array must not contain infs or NaNs

Version information:

suite2p v0.12.0

Context for the issue:

No response

immj22 avatar Mar 01 '23 01:03 immj22

I also have the same problem. After I manually add ROIs, it reads 1 cell added to manual GUI, 2 cells added to manual GUI etc. However, the second I click extract ROIs, i get the same error messages ending on 'numpy.linalg.LinAlgError: Array must not contain infs or NaNs.'

I am also using anatomical = 3

ni3927 avatar Mar 12 '23 22:03 ni3927

what are your diameters? it looks like you have two of them, were they user-inputted?

carsen-stringer avatar May 14 '23 01:05 carsen-stringer

I use the GUI, and I leave the diameter as 0. Thanks so much Carsen!

ni3927 avatar May 15 '23 16:05 ni3927