mesmerize-core icon indicating copy to clipboard operation
mesmerize-core copied to clipboard

Fix motion correction and CNMF for 3D movies

Open ethanbb opened this issue 1 year ago • 4 comments

The mcorr algorithm currently fails when run on a 3D movie during correlation image calculation. This is due to some code in caiman that could probably also be changed to get it to work (flatironinstitute/caiman#1363 does half of it), but this PR should fix mcorr in a way that is also compatible with existing caiman versions:

  • By passing the file in as a string rather than list, load_file_chain does not get called, which means is3D is not needed (otherwise this throws an error).
  • I added a try/catch that should catch the specific bug fixed in flatironinstitute/caiman#1363 and tries again without baseline removal to avoid it.

This PR is dependent on #298 (to avoid an ugly merge) so I'm submitting it as a draft for now. Also, it would be good to add a test case for 3D motion correction (with test data and everything). But at least the current tests pass (except for the 2 that are always failing) so it doesn't break 2D mcorr.

ethanbb avatar Jun 14 '24 20:06 ethanbb

rebase this on main once #298 is merged

kushalkolar avatar Jun 15 '24 07:06 kushalkolar

wait until next release of caiman and then pin the next release of mescore to that

kushalkolar avatar Jul 16 '24 18:07 kushalkolar

Caiman PR is merged, but still waiting for next release to mark as ready for review.

ethanbb avatar Jul 24 '24 19:07 ethanbb

Caiman 1.11.2 is released

ethanbb avatar Jul 31 '24 16:07 ethanbb

Lgtm!

kushalkolar avatar Aug 22 '24 14:08 kushalkolar