MRtrix streamlines files (TCK for the tracks, TSF for per-point values along the tracks) share one header format, they only differ in the identifier line and in the meaning of the payload. The header is ASCII text, and its length is stored within the header itself as the offset at which the binary payload starts.
build.mrtrix.header(header_id, entries, datatype, count, offset)character string, the header including the terminating newline.
character string, the file type identifier, one of 'mrtrix tracks' (TCK) or 'mrtrix track scalars' (TSF).
named list of additional header entries.
character string, the datatype.
integer, the number of streamlines.
numeric, the byte offset at which the payload starts.