niftyreg function performs registration for three dimensional images. Rigid-body (6 degrees of freedom) and affine (12 degrees of freedom) registration can currently be performed.niftyreg(source, target, targetMask = NULL, initAffine = NULL, scope = c("affine", "rigid"), nLevels = 3, maxIterations = 5, useBlockPercentage = 50, verbose = FALSE)"nifti". Package oro.nifti defines this class and provides functions for reading and writing NIfTI files."nifti"."nifti" object), whose nonzero region will be taken as the region of interest for the registration. Must have the same voxel and image dimensions as the target image.NULL, the identity matrix is used, with an appropriate offset to account for differences in the image origins."affine" (12 DOF) and "rigid" (6 DOF) are currently supported.TRUE, the code will give some feedback on its progress; otherwise, nothing will be output while the algorithm runs."niftyreg" with components"nifti" representing the registered and resampled source image in the space of the target image.The algorithm is based on a block-matching approach and Least Trimmed Squares (LTS) fitting. Firstly, the block matching provides a set of corresponding points between a target and a source image. Secondly, using this set of corresponding points, the best rigid or affine transformation is evaluated. This two-step loop is repeated until convergence to the best transformation.
In the NiftyReg implementation, normalised cross-correlation between the target and source blocks is used to evaluate correspondence. The block width is constant and has been set to 4 voxels. A coarse-to-fine approach is used, where the registration is first performed on down-sampled images (using a Gaussian filter to resample images), and finally performed on full resolution images.
Ourselin, S., Roche, A., Subsol, G., Pennec, X. and Ayache, N. (2000). Reconstructing a 3D structure from serial histological sections. Image and Vision Computing 19(1-2):25-31.
Ourselin, S., Stefanescu, R. and Pennec, X. (2002). Robust registration of multi-modal images: towards real-time clinical applications. Medical Image Computing and Computer-Assisted Intervention. Vol. 2489 of Lecture Notes in Computer Science, pp. 140-147.
nifti (no relation!), in the oro.nifti package, for creating the image objects passed to this function