Learn R Programming

freesurferformats (version 1.1.0)

trackvis.affine.to.rasmm: Compute the affine that maps TrackVis coordinates to RAS+ mm.

Description

Computes the affine that turns the streamlines stored in a TRK file into RAS+ mm coordinates in which a coordinate of (0,0,0) is the center of the first voxel, which is the convention used by 'nibabel', DIPY and the TRX format. The stored streamlines refer to the voxel corners and are in "voxelmm" space, so this combines the stored matrix with the voxel sizes, the half-voxel offset, and the orientation stored in the voxel_order header field.

Usage

trackvis.affine.to.rasmm(header)

Value

a 4x4 numeric matrix.

Arguments

header

named list, the header of a TRK file as returned by read.dti.trk.header.