Motion Correction
Following video downsampling, it is necessary to correct motion artifacts in each individual session.
For this we use the following function.
Output File
Running this function produces a .mat
file with the _mc
tag, containing both the motion corrected video data and the CaliAli_options
structure. By default, the output file name matches the input video, and the save path defaults to the location of the input video. A typical file name may be vid_01_ds_mc.mat
.
Limitations of the non-rigid registration module
This code is experimental and may introduce undesired deformations when adjusting for non-rigid deformation.
How long it takes to motion correct videos?
- Rigid: processes ~5,000 frames in about 2 minutes on a modern CPU.
- Non-rigid: substantially slower at roughly 10 frames per second.
Crop after motion correction
Use CaliAli_crop() to interactively draw a shared region of interest across the motion-corrected sessions. The tool opens representative frames, lets you define the final field of view, and rewrites each _mc
file in-place so downstream detrending and alignment run on the trimmed data.
Important
Ensure to visually inspect the motion-corrected video before proceeding to the next step: view_Ca_video()
After finishing downsampling and motion correction you can proceed to Inter-session Alignment