CaImAn icon indicating copy to clipboard operation
CaImAn copied to clipboard

Large number of non-neuron spatial footprints

Open jchutrue opened this issue 3 years ago • 8 comments

  • Tell us a bit about your setup:
  1. Operating system (Linux/macOS/Windows): Ubuntu Linux 19.04

  2. Python version (3.x): 3.7

  3. Working environment (Python IDE/Jupyter Notebook/other): Jupyter Notebook

  4. Which of the demo scripts you're using for your analysis (if applicable): N/A

  5. CaImAn version*: 1.8.5 (dev branch commit f92f96296b325fecf182f0a5d571a59a52868252)

  6. CaImAn installation process (pip install ./pip install -e ./conda): pip install -e .

*You can get the CaImAn version by creating a params object and then typing params.data['caiman_version']. If the field doesn't exist, type N/A and consider upgrading)

When running CNMF-E on 1p Miniscope data, there was a high number of spatial footprints that didn't correspond to a neuron. Using manual ROIs, I found about 150 neurons, but in the automatic analysis 350 were accepted. The picture below shows the 350 components against the maximum intensity projection image I used to select ROIs manually.

high-false-positives

The input consisted of 7350 frames. When looking at the maximum intensity projection image, I saw that the average neuron diameter was about 25 pixels. So I used the following parameters:

p = 0 K = None gSig = (11, 11) gSiz = (25, 25) Ain = None merge_thr = .7 rf = 80 stride_cnmf = 30 tsub = 2 ssub = 2 them here as boolean vectors low_rank_background = None gnb = 0 nb_patch = 0 min_corr = .8 min_pnr = 10 ssub_B = 2 ring_size_factor = 1.2 only_init = True update_background_components = True min_corr = 0.8 min_pnr = 10 center_psf = True del_duplicates = True border_pix = 0

It seems that many components are just fluctuations in the background, but I'm not sure. Would greatly appreciate any help!

jchutrue avatar Sep 23 '20 00:09 jchutrue

Are you still having the problem? If you post a link to a short movie that reproduces the problem someone will take a look. I have seen some strange things in my data, but not this. I'd be happy to take a look if the movie is in a standard format and not too large/time consuming . That definitely looks strange, and your data looks very nice. How is the motion correction?

Just looking at your parameters, gSig seems pretty large when your neuronal diameter is 25. Have you tried setting it to 6 or so? In general I think you want it so that gSize ~ gSig*4+1.

EricThomson avatar Oct 03 '20 22:10 EricThomson

Indeed, gSig seems quite large.

Further, the threshold for min_corr determined using caiman.utils.visualization.nb_inspect_correlation_pnr might be too low because you use downscaling during the initialization (tsub>1, ssub>1). Whereas min_pnr is automatically adjusted here min_corr is not. Consider using caiman.utils.visualization.nb_inspect_correlation_pnr on the downscaled data to help setting those thresholds.

j-friedrich avatar Oct 06 '20 20:10 j-friedrich

@EricThomson @j-friedrich The average diameter of a neuron was 25 pixels when I looked at the maximum intensity projection image in ImageJ, so that's how I chose gSig I did not realize that min_corr was for the downscaled data during initialization so I'll look into that.

EDIT: Disregard the gSig part, I was talking about the gSiz selection of 25. I'll lower gSig

jchutrue avatar Oct 06 '20 21:10 jchutrue

@jchutrue did you solce your issue? Please close if this is the case, thank you!

agiovann avatar Jan 26 '21 00:01 agiovann

@agiovann sorry no, still haven't resolved this issue. Wondering if it will help to share the data with some developers?

jchutrue avatar Feb 02 '21 13:02 jchutrue

@jchutrue if you post a link to a smallish clip in the cloud I'm sure someone would take a look at some point.

EricThomson avatar Feb 02 '21 15:02 EricThomson

@EricThomson I don't encounter this problem nearly as much with small data. I noticed it on 20-30 minute (30 fps) recordings (~166 GB), where I made sure the issue wasn't caused by unstable motion correction.

jchutrue avatar Feb 02 '21 16:02 jchutrue

@jchutrue this is worth worth exploring I think. I recommend find out the minimal movie required to get the funky results and try to figure it out from there.

EricThomson avatar Feb 02 '21 23:02 EricThomson

Closing due to lack of activity.

EricThomson avatar Apr 28 '23 19:04 EricThomson