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

View source: R/tracts.R

streamlines.to.segmentsR Documentation

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)

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).

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).


fsbrain documentation built on Sept. 27, 2026, 1:07 a.m.