Learn R Programming

freesurferformats (version 1.1.0)

fs.tracts.lengths: 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)

Value

integer vector with one entry per tract.

Arguments

tracts

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

Examples

Run this code
if (FALSE) {
tck <- read.dti.tck("brain.tck");
lengths <- fs.tracts.lengths(tck$tracks);
mean(lengths);
}

Run the code above in your browser using DataLab