RAS transform to resample a 3D volumeWarps a moving volume onto a reference grid given a 4x4
RAS-to-RAS transform (such as the transform returned
by register_volume3d). The transform maps reference (fixed)
RAS coordinates to moving RAS coordinates.
This function is superseded by
apply_transform3d_volume, which additionally applies
deformation fields and whole transform chains, and by
apply_transform3d_points for coordinates. It is kept, with
unchanged behavior and no warning, for existing code; new code should use
apply_transform3d_volume. For a single linear transform the two give
identical results (except that apply_transform3d_volume offers no
'bspline' interpolation).
apply_transform3d(
volume,
vox2ras,
transform,
reference_dim = dim(volume),
reference_vox2ras = vox2ras,
interpolation = c("trilinear", "nearest", "bspline"),
na_fill = 0
)The resampled volume on the reference grid, with a 'vox2ras'
attribute equal to reference_vox2ras.
moving 3D array to resample
the moving volume's voxel-to-RAS 4x4 transform
4x4 RAS-to-RAS transform (fixed to moving)
output dimension (the fixed grid); defaults to
dim(volume)
the fixed grid's voxel-to-RAS transform;
defaults to vox2ras
'trilinear' (default), 'nearest', or
'bspline' (cubic Catmull-Rom)
value for out-of-bounds voxels; default 0
apply_transform3d_volume (the replacement),
register_volume3d