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
627 stars 365 forks source link

mult-session registration question about dealing with drop-out and drop-in #1372

Open smbaca opened 2 months ago

smbaca commented 2 months ago

Hoping to get a bit of help with the following issue. Easiest to just explain our datasets and what we would like to do.

We have three in vitro slice sessions recorded in the same day but at different times (waiting for drugs to wash-in). CONTROL | DRUG | ACTIVATE

ACTIVATE is just where we apply a glutamate uptake blocker to activate as many cells as possible in the field.

Anyway, we would like to collect ALL the ROIs active in ANY session and then plot the cleaned calcium trace of each ROI. We use the multi-session registration after analyzing each session independently. This give us the ROIS that are the same across sessions as well as identifies those that are only active in one session. BUT we want to take every cell activated in ANY session and then plot the calcium signal but this results in very weird results in any of the cells that are not seen as active in all of the sessions.

I think the solution is to do what we have been doing to get the ROIS and then use them to redo the calcium trace extraction from each session...a bit wonky and time-intensive but wondering if that is the only way to handle these recordings? Also, I am unclear on how the program deals with normalizing the signals between sessions or if that is something that has to be done after the trace extraction.

We are explicitly interested in cells that become active or that dropout in DRUG condition so just finding cells active in all sessions is insufficient and somewhat misleading about what is going on in the brain area imaged.

Suggestions welcome!

pgunn commented 2 months ago

On first glance, I think you're doing the right thing; in theory you could use the offline algorithms, but they're older and don't perform as well (I think). We can see if @kushalkolar has any other ideas, but I'm guessing he'll say the same thing.

On the second question, I believe the multisession notebook demo includes calls that do that, but I'll need to make sure (I haven't looked at that code in awhile).

smbaca commented 2 months ago

Yes, after looking at the one demo example, I realize that some of their approach and code will work for me. I just need to make the changes given that I don’t have a file set up the way that they do to start that notebook. While I appreciate that researchers contribute material for demos, it seems like a good demo notebook should not depend on someone’s custom pickled file but only use a downloadable demo movie or a .HDF5 file that is made from saving the results of a CNMFE or CNMF session? Hopefully I can provide something to the group soon that does just that. Sent from my iPhoneOn Jul 17, 2024, at 5:30 PM, Pat Gunn @.***> wrote: On first glance, I think you're doing the right thing; in theory you could use the offline algorithms, but they're older and don't perform as well (I think). We can see if @kushalkolar has any other ideas, but I'm guessing he'll say the same thing. On the second question, I believe the multisession notebook demo includes calls that do that, but I'll need to make sure (I haven't looked at that code in awhile).

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>