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
639 stars 370 forks source link

fix bug in correlation image calculation #1304

Open EricThomson opened 8 months ago

EricThomson commented 8 months ago

Description

Fixes bug pointed out by @rcalfredson and implements fix suggested by @j-friedrich in discussion #1190

Type of change

Has your PR been tested?

caimanmanager test passes.

I ran: np.allclose(corr_im_local, corr_im_fft, rtol=1e-05, atol=1e-05, equal_nan=True)

Where corr_im_local is the output of the buggy function cm.local_correlations(), and corr_im_fft is the output of the more canonical fft-based correlation function cm.summary_images.local_correlations_fft()

until it came back True.

I haven't added this to the test suite. It might be a good idea though.

EricThomson commented 7 months ago

I will add test to this, but not sure when -- I'm on vacation most of this week, so let's do after upcoming release.