% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/imaging-registration-native.R
\name{apply_transform3d}
\alias{apply_transform3d}
\title{Apply a linear \verb{RAS} transform to resample a 3D volume}
\usage{
apply_transform3d(
  volume,
  vox2ras,
  transform,
  reference_dim = dim(volume),
  reference_vox2ras = vox2ras,
  interpolation = c("trilinear", "nearest", "bspline"),
  na_fill = 0
)
}
\arguments{
\item{volume}{moving 3D array to resample}

\item{vox2ras}{the moving volume's voxel-to-\verb{RAS} 4x4 transform}

\item{transform}{4x4 \verb{RAS}-to-\verb{RAS} transform (fixed to moving)}

\item{reference_dim}{output dimension (the fixed grid); defaults to
\code{dim(volume)}}

\item{reference_vox2ras}{the fixed grid's voxel-to-\verb{RAS} transform;
defaults to \code{vox2ras}}

\item{interpolation}{\code{'trilinear'} (default), \code{'nearest'}, or
\code{'bspline'} (cubic \verb{Catmull-Rom})}

\item{na_fill}{value for out-of-bounds voxels; default \code{0}}
}
\value{
The resampled volume on the reference grid, with a \code{'vox2ras'}
attribute equal to \code{reference_vox2ras}.
}
\description{
Warps a moving volume onto a reference grid given a 4x4
\verb{RAS}-to-\verb{RAS} transform (such as the \code{transform} returned
by \code{\link{register_volume3d}}). The transform maps reference (fixed)
\verb{RAS} coordinates to moving \verb{RAS} coordinates.
}
\seealso{
\code{\link{register_volume3d}}
}
