Learn R Programming

fsbrain (version 1.0.0)

streamlines.to.segments: Compute the line segments of streamlines.

Description

Converts streamlines (a list of point sequences) into the pair of point matrices that describes the line segments between their consecutive points, which is the representation used by fs.coloredpaths. This is vectorized: the segments of all streamlines are computed in one go, no matter how many there are.

Usage

streamlines.to.segments(tracts)

Value

named list with entries from (matrix of segment start points), to (matrix of segment end points) and lengths (integer vector, the number of segments of each streamline).

Arguments

tracts

an fs.tracts instance (as returned in the tracks entry of freesurferformats::read.dti.trk and freesurferformats::read.dti.tck), an (n, 3) matrix of points (a single streamline), or a list of (n, 3) matrices (one per streamline).