View source: R/transforms_common.R
| fs.transform | R Documentation |
An fs.transform is a linear transformation matrix together with the coordinate spaces that it
maps between. It is the common representation that all transformation file format readers and writers in this
package return and accept, so that a matrix read from a file always states what its numbers mean: a bare 4x4
matrix does not tell whether it maps voxel indices or world coordinates, in which direction it goes, or
whether the voxel indices are zero- or one-based.
The matrix field always maps from the source to the target, i.e., applying it to a coordinate means
target_coord = matrix \%*\% c(source_coord, 1), which is the same convention that
doapply.transform.mtx uses. The inverse of the transformation is never stored, see
invert.fs.transform.
fs.transform(
matrix,
space_in = NA_character_,
space_out = NA_character_,
voxel_base = NA_integer_,
src = NULL,
dst = NULL,
format = NA_character_,
source = NULL,
type = NULL,
...
)
matrix |
4x4 numerical matrix, the transformation matrix. Required. |
space_in |
character string, the kind of coordinates the matrix maps from, one of 'voxel' (voxel indices
of a volume), 'ras' (world coordinates, right-anterior-superior in millimeters) or 'lps' (world coordinates,
left-posterior-superior in millimeters, used by ITK and ITK-based tools like ANTs). Use |
space_out |
character string, the kind of coordinates the matrix maps to, see |
voxel_base |
integer, either 0 or 1. The index of the first voxel in the coordinates the matrix consumes
and produces, i.e. 1 for the convention used by FreeSurfer and tkregister, and 0 for the one used by
NIfTI, FSL and ITK. Must be |
src |
|
dst |
|
format |
character string, the file format the transform was read from, one of 'lta', 'dat', 'xfm' or
'fslmat'. Use |
source |
|
type |
|
... |
additional named fields to store in the transform, e.g. the parsed header of the file it was read from. They are not validated and are preserved for formats that carry extra metadata. |
an fs.transform instance.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.