MotionCorrection3D Method


Description

Detects and corrects rigid-body motion within a VTC file. The first volume serves as the reference to which all other 3D volumes are aligned.

Syntax

objDocument.MotionCorrection3D()

Remarks

Valid only if objDocument is of type VMR and if a VTC file has been linked. If the VTC file is referenced but not in memory, BrainVoyager will load the VTC file prior to running the spatial filter. This version uses the default settings as shown in the GUI version (3D Data Preprocessing dialog): trilinear interpolation to perform the rigid-body translation/rotation, a reduced data set (every second voxel in each dimension = one eighth of a full volume = 12.5%), a maximum of 100 iterations to fit a volume to the reference, creation of pre- and post AVI movie files and a standard log file. If you want to change any of these default settings, you can use the MotionCorrection3DEx version.
As in the GUI version, the spatial filter produces a new VTC file which is saved to disk automatically under a new file name. The new file name is based on the name of the linked VTC file prior to starting the filter and adds a substring describing the preprocessing performed. If, for example, the name of the linked VTC file was "cg_objects.vtc", the new name will be "cg_objects_3DMC.vtc". The added substring "_3DMC" describes that motion correction (MC) has been performed in 3D (3DMC), i.e. fitting 3 translation and 3 rotation parameters. All 3D preprocessing steps add such descriptive substrings which makes it easy to get the information about the sequence of steps which has been performed to produce a particular VTC file. If you do not want to use the implicit naming scheme, you might want to use the method MotionCorrection3DEx which allows to specify the source VTC file and the target VTC file.
Note also that the resulting VTC file is linked automatically to objDocument which allows to run a cascade of preprocessing commands without having to link intermediate files.

Example

' VBScript
Set doc = BrainVoyager.
OpenDocument("subject.vmr")
doc.
LinkVTC "cg_objects_SC.vtc"
doc.
MotionCorrection3D
doc.
TemporalSmoothingFD3D 3, 200

// JScript
doc = BrainVoyager.
OpenDocument("subject.vmr");
doc.
LinkVTC("cg_objects_SC.vtc");
doc.
MotionCorrection3D();
doc.
TemporalSmoothingFD3D(3, 200);

# PerlScript
$doc = $BrainVoyager->
OpenDocument("subject.vmr");
$doc->
LinkVTC("cg_objects_SC.vtc");
$doc->
MotionCorrection3D();
$doc->
TemporalSmoothingFD3D(3, 200);