MINC/SoftwareDevelopment/Tag file format reference

From Wikibooks, open books for an open world
(Redirected from MINC/Reference/Tag file format reference)
Jump to navigation Jump to search

Introduction[edit | edit source]

The MNI .tag file format was designed as a simple storage format for representations of selected points on either a single 3-dimensional data volume, or on a pair of such volumes. The .tag file is an ASCII file format only - it provides no support for other character sets or binary data.

All of the original design and implementation of this format was the work of David MacDonald. This document borrows extensively from David’s existing comments and documentation.

Format[edit | edit source]

The file is an ASCII file, and normally uses a single linefeed as a newline character. Spaces, tabs, and newlines may be used to delimit fields. Carriage return characters are ignored.

Header[edit | edit source]

A .tag file always begins with a single line containing the exact text:

MNI Tag Point File

This header line is mandatory and should appear exactly as shown (capitalization is significant).

The header is followed by the keyword Volumes followed by an equals sign, either the digit ’1’ or ’2’, and a semicolon, e.g. either:

Volumes = 1;

or:

Volumes = 2;

This field indicates whether the tag point file applies to one or two volumes. Again, capitalization is significant.

The next field defines the points themselves. It starts with a keyword:

Points =

followed by a list of point records. The list of point records is terminated with another semicolon.

Point records[edit | edit source]

Each point record simply consists of either 3 or 6 floating-point numbers, represented in ASCII, and separated by spaces. The floating point numbers give the X, Y, and Z coordinates in the world space of the volume(s) to which the tag applies.

The coordinates of the point are mandatory. Other fields may be included as needed, as follows:

  • A floating-point weight[1].
  • An integer structure ID[2].
  • An integer patient ID.
  • A text label.

These fields must either all be present for a tag, they may all be absent, or the text label alone may be present. The text label may be surrounded by quotes to allow it to include space characters.

Each point record normally ends with an end-of-line character, but this is optional.

Comments[edit | edit source]

Comments can occur anywhere in the file. They are indicated by the character ’#’ or ’%’, and are terminated by an end-of-line character.

There is an informal convention of using comments to indicate the specific volume files to which the tags apply.

  1. This corresponds to the size when markers are saved as tags in MNI-Display
  2. This corresponds to a paint label value when labels are saved as tags in MNI-Display