Learn R Programming

fsbrain (version 0.6.0)

mesh.ras2crs: Transform surface vertices from surface RAS to 0-based volume 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).

Usage

mesh.ras2crs(surface)

Value

a modified copy of the input surface with vertices in 0-based CRS space.

Arguments

surface

an fs.surface instance, as returned by read.fs.surface.