Skip to content

Motion Correct

Compute Credits

This tool uses 2.0 compute credits per hour.

The motion correction algorithm attempts to remove any frame-to-frame motion in the movie so a pixel approximately corresponds to the same location in your field of view across all frames.

Motion Correction should be applied to preprocessed microscope movies unless the movies being processed contain little or no motion.

Inputs

Parameter Required? Default Description
Input movie files True N/A paths to the input movie files
Maximum Translation True 20 The maximum translation allowed by motion correction in pixels.
Low Bandpass Cutoff False N/A If not None, then the low cutoff of the spatial filter applied to each frame prior to motion estimation.
High Bandpass Cutoff False N/A If not None, then the high cutoff of the spatial filter applied to each frame prior to motion estimation.
ROI False N/A ROI vertices for motion estimation. If input is empty, the algorithm will use the entire frame
Reference Segment Index True 0 If a reference frame is to be specified, this parameter indicates the index of the movie whose frame will be utilized, with respect to the input movie files. If only one movie is specified to be motion corrected, this parameter must be 0.
Reference Frame Index True 0 Use this parameter to specify the index of the reference frame to be used, with respect to the movie referred to by the reference segment index. If the reference file name is specified, this parameter, as well as the reference segment index, is ignored.
Reference File Name False N/A If an external reference frame is to be used, this parameter should be set to path of the .isxd filethat contains the reference image.
Global Registration Weight True 1 When set to 1, only the reference frame is used for motion estimation. When less than 1, the previous frame is also used for motion estimation. The closer to 0, the more the previous frame is used and the less the reference frame is used.
Preserve Input Dimensions True False If true, the output movie will be padded along the edges to match the dimensions of the input movie. The padding value will be set to the 5th percentile of the pixel value distribution collected from 10 evenly sampled frames from the input movie.

File Inputs

Source Parameter File Type File Format
Input movie files miniscope_movie, miniscope_movie isxd, isxc
Reference File Name miniscope_image isxd

Description

For each frame of the movie, motion correction first estimates a translation that minimizes the difference between the transformed frame and the reference frame, using an image registration method described in1.

If the Use region(s) of interest parameter is used, then the image registration method only focuses on minimizing the difference between frames in the regions specified. This is useful if there are static artifacts in your movie, such as lens boundaries, that may confound the image registration method and should be avoided. Ideally, you should crop out these artifacts using the Preprocess tool and not specify regions here.

If the Low cut-off and High cut-off parameters are used, this algorithm spatially filters the input movie frames to improve the translation estimate. This filtering is a temporary operation and does not persist to the output movie data. If you want the filtering to persist or for information on these parameters, please refer to the Spatial Bandpass Filter tool. By default, these parameters will only be used if the corresponding filters were not previously applied with that algorithm.

The motion correction algorithm then transforms each frame of the movie using these translations to produce an output movie. If some non-negligible motion is estimated, some regions in the output movie may not contain valid data. This algorithm automatically finds the region across all transformed frames that contain only valid data and crops the movie to that region.

Global Registration Weight

The motion correction algorithm can apply an incremental (frame-to-frame) registration with "drift correction". This is accomplished by first registering each frame to a common fixed frame. This result is used to nudge the frame-to-frame motion estimate towards the registration result obtained using the common fixed frame. The objective of this adjustment is to eliminate any growing drift caused by repeated accumulation of incremental frame-to-frame registrations. The Global Registration Weight parameter represents the amount of adjustment.

Image registration is run twice, with the final result being the weighted sum of those two results. The Global Registration Weight parameter represents the weight of a registration where all frames are registered with respect to a fixed frame, the global reference frame (\(x\)). In the second registration, each frame is registered with respect to its predecessor (and the weight is \(1-x\)). The end result of this image registration method will be the linear combination of these two results. A Global Registration Weight value of one will result in a single pass where all frames are registered to the global frame only. A value of zero will result in a frame-to-frame registration. In cases where registration to a global frame fails due to little resemblance of specific frames to that reference frame, temporally closer frames might exhibit higher spatial correlation. Therefore, by using the predecessor frame as reference, a better registration output is possible. To avoid excessive drifting, the minimum possible value of the Global Registration Weight parameter is 0.05. The default value is set to 1.0, which results in a common fixed frame registration.