niftyreg.nonlinear
. A subvoxel location is target space is returned unless the nearest voxel is requested.transformWithControlPoints(points, controlPointImage, source, target,
nearest = FALSE)
transformWorldToVoxel
for a function to convert from ``real wo"nifti"
containing the control points parameterising the transformation."nifti"
object representing the source image for the transformation."nifti"
object representing the target image for the transformation.TRUE
, the return value contains just the location of the nearest voxel to each requested location. This is computationally more efficient than simply rounding the result.The method is to first convert the control points to a deformation field (cf. getDeformationField
), which encodes the location of each target space voxel in the source space. The target voxel closest to the requested location is found by searching through this deformation field, and returned if nearest
is TRUE
or it coincides exactly with the requested location. Otherwise, a block of four voxels in each dimension around the point of interest is extracted from the deformation field, and the final location is estimated by cubic spline regression.
niftyreg.nonlinear
, getDeformationField