dti.track.count: Count the tracts in a DTI tract file.

View source: R/dti_tracks_utils.R

dti.track.countR Documentation

Count the tracts in a DTI tract file.

Description

Counts the tracts in a TRK, TCK or TSF file without reading their coordinates, so this works on arbitrarily large tractograms with a small and constant amount of memory. This is the equivalent of tckinfo <file> -count in MRtrix.

Usage

dti.track.count(filepath, chunk_values = 4e+06)

Arguments

filepath

character string, path to the TCK or TSF file to read. Gzip-compressed files (i.e., .tck.gz) are supported and the compression is detected from the file content, not the file name.

chunk_values

integer, the number of payload values to read per chunk. Advanced tuning parameter, see read.dti.tck.

Value

integer, the number of tracts in the file. Note that this can differ from the count entry in the file header, which the MRtrix documentation explicitly describes as unreliable, and which does not count empty tracts.

Examples

## Not run: 
dti.track.count("brain.tck");

## End(Not run)


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