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

List of shifts for pw_rigid motion correction is difficult to interpret

Open ethanbb opened this issue 1 year ago • 0 comments

Just want to bring up this part of the code in get_shifts:

https://github.com/nel-lab/mesmerize-core/blob/6f46b98bfee8daf3078fa0b72e90909180feed61/mesmerize_core/caiman_extensions/mcorr.py#L115-L123

My understanding is that shifts has a shape of (n_dims, n_frames, n_patches). This code flattens that to a list of length n_dims * n_patches of 1D arrays of length n_frames. Is there a good reason for this? For consistency with the rigid case, imo it would make more sense to keep the output as a list of length n_dims where each entry is an n_frames x n_patches matrix (or the transpose).

If z shifts are also added to the output (which I just added to #300), this change will make it much easier to pull out shifts along a particular dimension (without necessarily knowing whether mcorr was done in 2D or 3D).

ethanbb avatar Jul 24 '24 21:07 ethanbb