MotionCorrection3DEx 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.MotionCorrection3DEx(strVTCFileNameIn, strVTCFileNameOut, intInterpolationMethod,
objDocument
.MotionCorrection3DEx(boolReducedDataSet, intMaxIterations, boolMovies, boolExtendedLogFile)

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 perform motion detection and correction. The method operates identical as the MotionCorrection3D version but allows to specify all available parameters. The source VTC file (strVTCFileNameIn) and a file name for the resulting VTC file (strVTCFileNameOut) must be specified. The source VTC file will be linked to objDocument and loaded into memory prior to spatial smoothing. The processed file will be saved to disk under the specified "Out" file name. The resulting VTC file is linked automatically to objDocument. Two interpolation methods are available, trilinear interpolation if intInterpolationMethodand is set to "0" and sinc interpolation if it is set to "1". The latter method is extremely slow and appears not to improve the result as compared to trilinear interpolation. For the alignment of a volume with the reference, all voxels can be used if boolReducedDataSet is set to "0" or only one eighth of the data if it is set to "1". Our tests have shown that using the reduced data set produces results indistinguishable from the one obtained when using the full data set. Each volume is individually fitted to the reference volume until an optimum has been achieved which does normally require 10-50 iterations. A good value for intMaxIterations proved to be "100". Set the boolMovies parameter to "1", if you want to let BrainVoyager create two AVI movie files, one before and one after motion correction. To better see possible motion, you should zoom the size of the movie when playing it. During motion correction, a standard log file is saved to disk (see below) which shows for each volume the number of iterations to obtain an optimal fit as well as the 3 translation and 3 rotation parameters. If you want to see information of the change in goodness of fit across the iterations of fitting a volume to the reference, you must set boolExtendedLogFile to "1".

The beginning of a standard motion correction log file:


InterpolationMethod: Trilinear
FullDataSet: No

MaxNrOfLevMarqIterations: 100

-> volume: 2 n_its: 3 dx: -0.0015 dy: 0.0017 dz: -0.0012 rx: -0.0005 ry: -0.0002 rz: 0.0002

-> volume: 3 n_its: 4 dx: -0.0044 dy: -0.0042 dz: -0.0022 rx: 0.0035 ry: -0.0022 rz: -0.0036

-> volume: 4 n_its: 11 dx: 0.0058 dy: -0.0165 dz: -0.0140 rx: 0.0053 ry: -0.0046 rz: -0.0165

-> volume: 5 n_its: 8 dx: 0.0053 dy: -0.0142 dz: -0.0104 rx: 0.0069 ry: -0.0060 rz: -0.0123

:


Example

' VBScript
Set doc = BrainVoyager.
OpenDocument("subject.vmr")
doc.
MotionCorrection3DEx "cg_objects_SC.vtc", "cg_objects_SC_MC.vtc", 0, 1, 100, 1, 1

// JScript
doc = BrainVoyager.
OpenDocument("subject.vmr");
doc.
MotionCorrection3DEx("cg_objects_SC.vtc", "cg_objects_SC_MC.vtc", 0, 1, 100, 1, 1);

# PerlScript
$doc = $BrainVoyager->
OpenDocument("subject.vmr");
$doc->
MotionCorrection3DEx("cg_objects_SC.vtc", "cg_objects_SC_MC.vtc", 0, 1, 100, 1, 1);