niftyreg.linear
function performs linear registration for two and
three dimensional images. 4D images may also be registered volumewise to a
3D image, or 3D images slicewise to a 2D image. Rigid-body (6 degrees of
freedom) and affine (12 degrees of freedom) registration can currently be
performed.niftyreg.linear(source, target, scope = c("affine", "rigid"), init = NULL,
sourceMask = NULL, targetMask = NULL, symmetric = TRUE, nLevels = 3L,
maxIterations = 5L, useBlockPercentage = 50L, interpolation = 3L,
verbose = FALSE, estimateOnly = FALSE, sequentialInit = FALSE)
"nifti"
or
"internalImage"
, or a plain array, or a NIfTI-1 filename. Must have
2, 3 or 4 dimensions."nifti"
or
"internalImage"
, or a plain array, or a NIfTI-1 filename. Must have
2 or 3 dimensions."affine"
(12 DOF), "rigid"
(6 DOF) or "nonlinear"
(high DOF, with the exact number dependiNULL
, for no initialisation, or an affine matrix or control point
image (nonlinear only). For multiple registration, where the source image
has one more dimension than the target, symmetric
is FALSE
.TRUE
, the code will give
some feedback on its progress; otherwise, nothing will be output while the
algorithm runs. Run time can be seconds or more, depending on the size and
dimensionality of the images.TRUE
, transformations will be
estimated, but images will not be resampled.TRUE
and source
has higher
dimensionality than target
, transformations which are not
explicitly initialised will begin from the result of the previous
registration.niftyreg
.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 is achieved.
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.
The source image may have 2, 3 or 4 dimensions, and the target 2 or 3. The dimensionality of the target image determines whether 2D or 3D registration is applied, and source images with one more dimension than the target (i.e. 4D to 3D, or 3D to 2D) will be registered volumewise or slicewise, as appropriate. In the latter case the last dimension of the resulting image is taken from the source image, while all other dimensions come from the target. One affine matrix is returned for each registration performed.
M. Modat, D.M. Cash, P. Daga, G.P. Winston, J.S. Duncan & S. Ourselin (2014). Global image registration using a symmetric block-matching approach. Journal of Medical Imaging 1(2):024003.
niftyreg
, which can be used as an interface to this
function, and niftyreg.nonlinear
for nonlinear registration.
Also, forward
and reverse
to extract
transformations, and applyTransform
to apply them to new
images or points.