% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/vis_volume.R
\name{mesh.ras2crs}
\alias{mesh.ras2crs}
\title{Transform surface vertices from surface RAS to 0-based volume CRS space.}
\usage{
mesh.ras2crs(surface)
}
\arguments{
\item{surface}{an \code{fs.surface} instance, as returned by \code{\link[freesurferformats]{read.fs.surface}}.}
}
\value{
a modified copy of the input surface with \code{vertices} in 0-based CRS space.
}
\description{
Applies the inverse of the FreeSurfer vox2ras_tkr matrix to all surface vertices, converting them from surface RAS coordinates to 0-based CRS (column, row, slice) indices. The resulting CRS coordinates can be used to directly index into a brain volume array (after adding 1 for R's 1-based indexing).
}
\keyword{internal}
