Fix motion correction and CNMF for 3D movies
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_chaindoes not get called, which meansis3Dis 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.
rebase this on main once #298 is merged
wait until next release of caiman and then pin the next release of mescore to that
Caiman PR is merged, but still waiting for next release to mark as ready for review.
Caiman 1.11.2 is released
Lgtm!