fs.tracts.lengths: Get the number of points of each tract.

View source: R/fs_tracts.R

fs.tracts.lengthsR Documentation

Get the number of points of each tract.

Description

Returns one integer per tract, the number of points it consists of. The coordinates of tract i are the rows (cumsum(c(1, lengths))[i]):(cumsum(lengths)[i]) of fs.tracts.coords().

Usage

fs.tracts.lengths(tracts)

Arguments

tracts

an fs.tracts instance, as returned in the tracks entry of read.dti.tck or read.dti.trk.

Value

integer vector with one entry per tract.

Examples

## Not run: 
tck <- read.dti.tck("brain.tck");
lengths <- fs.tracts.lengths(tck$tracks);
mean(lengths);

## End(Not run)


freesurferformats documentation built on Sept. 25, 2026, 1:07 a.m.