flatironinstitute / CaImAn

Computational toolbox for large scale Calcium Imaging Analysis, including movie handling, motion correction, source extraction, spike deconvolution and result visualization.
https://caiman.readthedocs.io
GNU General Public License v2.0
637 stars 370 forks source link

Quality assurance method for ROI detection #1152

Closed zhouyi0812 closed 10 months ago

zhouyi0812 commented 1 year ago

Hello!

May I ask, if there is a way that we can know that I am selecting the right parameters? Like, there is always output with parameters, and how should I know if I am choosing the best parameter that reflects the most relative situation? Or as long as I think that the parameters are able to find out the cells that exist in the experiment that will be the goal?

Thank you!

EricThomson commented 1 year ago

This is the purpose of the evaluate components step, so I would make sure you understand how that works. It is also helpful to view the final output of the model and residuals using play_movie() which is in the demo notebooks.

In longer-term goals, it would be good to provide an interactive version of nb_view_components() (one that lets you view the movie with the traces/contours not just the summary image), which is something that mesmerize provides via fastplotlib: ultimately this would be a really helpful way to pass things through a final eyeball test. @kushalkolar

zhouyi0812 commented 1 year ago

Hello! May I ask a question about df/f. I am using cnm.estimates.F_dff to get the trace for df/f, but it looks like there is not much different between raw trace and df/f.

Thank you!

Screenshot 2023-08-16 170728

EricThomson commented 1 year ago

You are doing CNMFE? There won't be much difference, in fact dfof is actually noisier detrended calcium trace. This is a complicated topic I discuss a little bit here: https://github.com/EricThomson/yacare/blob/main/normalize_1p_traces.ipynb

zhouyi0812 commented 1 year ago

Yes! Thank you very much I will check that code. Also, I am just not sure if my case matches the situation since I am using wild field imaging I assume won't generate much noise compared with 1p data. Do you think it is still applicable? Thank you!

EricThomson commented 1 year ago

Are you cnmf or cnmfe this is the main important distinction rather than 1p or 2p.

zhouyi0812 commented 1 year ago

I am using cnmfe~

EricThomson commented 1 year ago

Yes this is what I thought, then that notebook I linked to is relevant, and the dfof is only returning detrended, not normalized traces.