Closed kingmiaomiao closed 8 months ago
this is more of a caiman question than mesmerize question, @EricThomson might have an answer
Yes there is a use_residual
keyword that currently has no effect when calculating dff
. See https://github.com/flatironinstitute/CaImAn/issues/1188
Thanks @EricThomson for pointing to that open issue, and working on solving this bug :) I'll comment on the CaImAn repo's thread for that issue.
Thank you! In the meantime, can I just change this one line in CaImAn, when estimates calls detrend_df_f
, replacing self.YrA
with R
?
I will update caiman when you push the fixed code. I assume you will create a new release?
That's the fix :smile: it's currently in a PR that should be in the next release.
It works!! Thank you!!!
Hi, I'm trying to understand the df/f calculation, and when (or if) residuals are used (this is related to the message I posted on Gitter). When I call
df.iloc[1].cnmf.run_detrend_dfof(use_residuals = False)
, mesmerize then callsestimates.detrend_df_f
, which eventually goes todetrend_df_f
inCaImAn/caiman/source_extraction/cnmf/utilities.py
. However, before that, the code in estimates.py seem to ignore the flaguse_residuals = False
:Could you explain what happens there, and how to get a denoised df/f, without the residuals? What should I change to my code below?
Right now the df/f does not seem to be denoised.![image](https://github.com/nel-lab/mesmerize-core/assets/8517447/d6767192-5a31-4045-ac1e-f52b379d67f5)
Thanks in advance for your help!