dti.track.bbox: Compute the bounding box of all tract coordinates in a file.

View source: R/dti_tracks_utils.R

dti.track.bboxR Documentation

Compute the bounding box of all tract coordinates in a file.

Description

Streams through the tract file and returns the bounding box of all coordinates, without keeping the coordinates in memory. This is useful to determine the axis limits for plotting a large tractogram.

Usage

dti.track.bbox(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

numeric vector of length 6, c(xmin, xmax, ymin, ymax, zmin, zmax), or NULL if the file contains no coordinates. The coordinates are in the coordinate system used by the file, see the note in read.dti.trk.

Examples

## Not run: 
bbox <- dti.track.bbox("brain.tck");

## End(Not run)


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