MouseLand / suite2p

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

ROIs with Values of 0 Over All Frames #977

Open jmdelahanty opened 1 year ago

jmdelahanty commented 1 year ago

In a recording I'm processing, I'm running into ROIs that have a value of 0 raw fluorescence over all frames but the y-axis goes from 0 to 500. It looks something like this:

image

With the average image:

image

The ROI example shown here is ROI 71. When I inspect the ROI in python like this:

>>> import numpy as np
>>> f = np.load("/snlkt/specialk_cs/2p/processed/CSC022/20230325/suite2p/plane0/F.npy")
>>> f[70]
array([0., 0., 0., ..., 0., 0., 0.], dtype=float32)
>>> np.mean(f[70])
0.0

It looks like the ROI has values that are zero or probably quite close to it.

It seems odd too see values of legitimate looking ROIs containing nothing but 0s. One lab suggested that it could be that the ROI in question is extra bright maybe, but that doesn't make much intuitive sense to me.

Any advice fellow suite2peasinapod?

scientist-in-pain commented 1 year ago

Hi, just to say I have also come across the same issue. For some recordings it's as high as 30% of extracted ROIs. Happens to both automatically extracted and manually labelled ROIs. With the manual labelling I can notice it as I label and delete and relabel. That seems to fix it most but not all of the times. Any help appreciated.

jmdelahanty commented 1 year ago

Looking through the issues I found this and also the RTD talk a little about this. Looking through my ops, it does indeed appear that I had allow_overlap set to 0.

We're happy enough with the cells we detected and it's been determined that it's not quite necessary to get the couple cells that have this problem, so I might not get around to re-running this recording to test it out. But it can be worth looking into to confirm this is indeed the reason for the 0 value ROIs.