MINC/SoftwareDevelopment/MINC1 File Format Reference

=MINC 1.0 Name and Usage Conventions=

The MINC (Medical Imaging NetCDF) 1.0 file format was designed as a specification for medical imaging data building upon the NetCDF (Network Common Data Format) standard.

This document is intended to describe the specifics of this layering by defining the essential variables, attributes, and conventions used by MINC files. While this information applies specifically to the implementation of MINC 1.0, much of this information is expected to apply to MINC 2.0. The major change will be in the adaptation or elimination of structural objects as a result of the transition from NetCDF to HDF5 (Hierarchical Data Format). MINC 2.0 probably will require considerable expansion and clarification of this specification.

Much of the information in this document is excerpted from the {\it MINC Programmer's Reference Manual} by Peter Neelin.

NOTE: Throughout this document, literal MINC variable names, attribute names, and predefined values are set in a font.

=Dimensions=

MINC associates the dimensions of a medical image with standard textual names, such as ' ' or ' '. This association serves both to clarify the interpretation of each dimension and to specify the relationships among variables which share the same coordinate space. The length of a dimension is defined when the file is created.

NetCDF's model of a dimension is very simple, associated just a name, a numeric identifier, and a length with each dimension. To extend this model to represent the full set of attributes associated with a MINC dimension object, MINC relies on the concept of a 'dimension variable', which is a variable with the same name as the corresponding dimension object.

While specialized applications can and occasionally do define additional dimensions, MINC defines the following standard dimension names:


 * - Spatial axis, defined to increase from patient left to patient right.
 * - Spatial axis, defined to increase from patient posterior to patient anterior.
 * - Spatial axis, defined to increase from patient inferior to patient superior.
 * - Time axis.
 * - Spatial frequency axis.
 * - Spatial frequency axis.
 * - Spatial frequency axis.
 * - Temporal frequency axis.
 * - Axis used for components of a vector field. If present, this dimension should be the fastest-varying dimension of the   variable.  Unlike the rest of the dimensions, this dimension is not associated with a dimension variable.

=Variables=

MINC variables fall into one of four classes. The first is the {\it group} class, which define data objects and names which are used to hold actual image data and supporting information. The second is the var-attribute class, which contain data qualifying another variable, for example, by specifying the range of the other variable's data. The third and fourth are the dimension class and the {\it dimension-width} class, which are used to specify the properties of the dimensions in a MINC file.

Standard MINC Variable Names

 * - This variable, which is of class {\it group}, exists for structural purposes only. It forms the base of the MINC variable hierarchy.
 * - The  variable is of class group. It is the variable which actually contains image data in a MINC file, so it is defined using whatever type and dimensions are required to represent the image.  By convention, MINC considers the first spatial dimension of the   variable to be the 'slice' dimension, and any other spatial dimensions are considered to be 'image' dimensions. The {\tt image variable is the only variable whose presence in a MINC file is mandatory}.


 * - The  variable is of class {\it var-attribute}.  If per-slice scaling of the image data is enabled, this variable will contain 64-bit floating-point data which provides the lowest value of the real range for each slice.  The dimensionality of this and the   variable will correspond to the dimensionality of the   variable, omitting the 'image' dimensions and vector dimension, if used.  For example, for typical fMRI data, the   variable will be a 2D array with {\tt time} and the first spatial declared as its dimensions.  Note that is is legal for the   to have lower dimensionality.  For example, the variable may be a scalar to specify a single, global maximum real value.
 * - The  is the counterpart to the    variable.  Its use and structure is directly analogous,  however it contains the maximum value of the real data range for each  data slice.
 * - This variable is of class group. It contains no useful data, but serves only to group those attributes which contain information about the study of which this image is a part. Since the variable contains no data, the type is irrelevant.
 * - Like the  variable, this variable is of class group and contains no data.  It serves to group the attributes which specify the identification and characteristics of the patient.
 * - The  variable is of class group.  Like the   and   variables, the   variable never contains useful data, but serves only to group those attributes which contain information about the image acquisition parameters, modality, etc.
 * - Variable of class dimension which groups the attributes specifying the X axis.
 * - Variable of class dimension which groups the attributes specifying the Y axis.
 * - Variable of class dimension which groups the attributes specifying the Z axis.
 * - Variable of class dimension which groups the attributes specifying the time axis.
 * - Variable of class dimension which groups the attributes specifying the spatial frequency axis.
 * - Variable of class dimension which groups the attributes specifying the spatial frequency axis.
 * - Variable of class dimension which groups the attributes specifying the spatial frequency axis.
 * - Variable of class dimension which groups the attributes specifying the temporal frequency axis.
 * - Variable of class dimension-width which groups the attributes specifying the width of samples along the X axis.
 * - Variable of class dimension-width which groups the attributes specifying the width of samples along the Y axis.
 * - Variable of class dimension-width which groups the attributes specifying the width of samples along the Z axis.
 * - Variable of class dimension-width which groups the attributes specifying the width of samples along the time axis.
 * - Variable of class dimension-width which groups the attributes specifying the width of samples along the spatial frequency axis.
 * - Variable of class dimension-width which groups the attributes specifying the width of samples along the spatial frequency axis.
 * - Variable of class dimension-width which groups the attributes specifying the width of samples along the spatial frequency axis.
 * - Variable of class dimension which groups the attributes specifying the width of samples along the temporal frequency axis.

Hierarchy
In MINC 1.0, group and var-attribute variables may be considered to exist in a tree-structured hierarchy. The base of the hierarchy is located at the. This variable exists solely to form the base node of the hierarchy tree. The , ,, and   variables form the next layer of the hierarchy. Below the  variable are the and  variables.

Other, non-standard variables may be added to this hierarchy as desired.

Because NetCDF is a non-hierarchical format, MINC uses a the {\tt parent} and  attributes to implement this hierarchy. In actual practice, the MINC 1.0 format relies this hierarchy very loosely, if at all. However, MINC 2.0, being based on a fundamentally hierarchical format (HDF5), will use and extend this hierarchy.

=Attributes=

In MINC, attributes are used to specify additional information about an object. These attributes can be considered to fall into three broad categories: Those which are defined by the NetCDF standard itself, those which play a structural role in defining the MINC file organization, and those which contain actual data or parameters associated with the file.

NetCDF attributes may be either global to the file or local to a specific variable. Only two global attributes are used as part of the MINC specification,  and. These string attributes are both part of the NetCDF specification. All other MINC attributes are local to a specific variable.

Standard NetCDF Attribute Usage
These attributes are defined by the NetCDF standard itself.
 * - String which specifies the units of a variable's data, if applicable. The units should be compatible with the UCAR udunits  library.  In MINC 1.0, this attribute is generally included for informational purposes only and is not interpreted by the MINC library code.
 * - String giving a human-readable textual description of the variable. Included for informational purposes.
 * - A vector of two numbers which specifies both the minimum and maximum valid values for this variable. Values outside this range must be treated as missing or uninitialized.  In MINC, the order of the two values in the vector is not significant.

This attribute must not be defined if either the  or the   attributes are defined.

These attributes should be considered mandatory for the MINC variable, unless the variable uses the default range, which is defined to be the full range of an (possibly signed or unsigned) integer type or the interval [0.0, 1.0] for floating point types. They are not required for any other MINC variable.
 * - Scalar number which gives the maximum value allowed for the variable. Note that the presence of   and   are mutually exclusive.


 * - Scalar number which gives the minimum value allowed for the variable. Note that the presence of   and   are mutually exclusive.


 * This is a scalar numeric value which gives the value to be used to fill in any value which is not explicitly written, or which falls outside the defined valid range of the data.


 * - A global string attribute for an audit trail. This is a character array with a line for each invocation of a program that has modified the dataset. All MINC and NetCDF applications should append a line containing: date, time of day, user name, program name and command arguments for each processing step. This attribute should be considered mandatory.


 * - A global string attribute which provides a description of the MINC file's contents. In practice this is optional and somewhat rarely used.

MINC Structural Attributes
Many MINC attributes are used to describe the types of variables and the relationships among variables.

These variables are considered 'structural' in the sense that they convey no useful information about the medical image stored in the MINC file, but instead serve to support the MINC format itself.

Each of these attributes should be considered mandatory for any MINC standard variable, with the following exceptions: The {\tt signtype} attribute is required only for variables of integral type, and the  and   attributes are required only for variables of class group or var-attribute. They are not used for variables of class dimension or dimension-width.


 * - String identifying the type (or class) of the variable. It must be one of ' ', '{\tt  dimension____}', ', or ' '.
 * - String which identifies the variable's relationship to the MINC specification. All MINC standard variables should set this attribute to ' '.  Non-standard variables may either ignore this attribute or set it to some other string value.
 * - Because MINC, unlike NetCDF, differentiates between signed and unsigned integral types, this attribute is required to define the format of variables which store data of an integral type. The only legal values are either the string '{\tt signed__}' or the string ' '.  For 8-bit integers, the default is , for all other integer types the default is.
 * - String identifying by name the parent variable of this variable. If the string is empty (of length zero), the variable is at the root of the hierarchy.
 * - List of the names of the variables which are considered children of this variable. The list is separated by newline characters.
 * - String identifying the version of this variable. In MINC 1.0, this string is always set to ' ' for MINC standard variables.

MINC Informational Attributes
Informational attributes in MINC may be of either a text string or a number.

Some string attributes are 'freeform' and may contain any value without restrictions on format and length. Other string attributes are assumed to have a specific format. Still other string attributes must contain one of several well-known values. When this is the case, the well-known strings are padded with underscore characters to the length of the longest legal value.

Another type of string attribute is the 'pointer' or 'variable' attribute. These attributes take the form '{\tt --->{\it var-name}}'. A typical example is the  variable's '{\tt image-max}' attribute, which in most MINC files contains the value ' ', indicating that the  attribute value is stored in the variable of the same name.

Numeric attributes may be either integer or floating-point format. MINC includes attribute access routines which will automatically convert a value to the desired type on retrieval.

variable attributes

 * - An string 'pointer' attribute containing the variable name that stores the real value maximum for the image. In most cases the variable has the same name as the attribute.


 * - Like, but points to the {\tt image-min} variable for the image.


 * - A boolean attribute (with values ' ' or ' ') that indicates whether the variable has been written in its entirety. This can be used to detect program failure when writing out images as they are processed :  is set to {\tt false} at the beginning and set to   when all data has been processed and written to the file.

variable attributes
These attributes are grouped with the  variable for purposes of namespace organization. They are modeled after ACR-NEMA conventions. All of these attributes are optional, and have no default value defined.


 * - String giving the time and date of the start of the study, in the format ' ', where ' ' is an string representation of fractional seconds. Either the entire time representation, or the fractional seconds, may be omitted if not required.
 * - Number giving the year of the start of date the study.
 * - Number giving the month (1-12) of the start date of the study.
 * - Number giving the day (1-31) of the start date of the study.
 * - Number giving the hour (0-23) of the start time of the study.
 * - Number giving the minute (0-59) of the start time of the study.
 * - Number giving the seconds (including fractions of a second, if required) of the start time of the study.
 * - String which represents the imaging modality used, one of: ,  ,  ,  ,  ,  ,  ,  ,  , or.
 * - String specifying the name of the imaging device manufacturer.
 * - String specifying the model of the imaging device.
 * - String identifying the institution conducting the study.
 * - String identifying the department conducting the study.
 * - String identifying the specific imaging system which generated the image.
 * - String giving the name of the patient's primary physician.
 * - String giving the name of the physician administering the examination.
 * - String giving the name of the radiologist interpreting the examination.
 * - String giving the name of the operator of the imaging device.
 * - String description of the admitting diagnosis.
 * - String description of the procedure employed.
 * - String identifying the study.

variable attributes
These attributes are grouped with the  variable for purposes of namespace organization. They are modeled after ACR-NEMA conventions for patient identification. All of these attributes are optional, and have no default value defined.


 * - String specifying the full name of the patient.
 * - String giving other names for the patient.
 * - String specifying identification information for the patient.
 * - String giving other identification information for the patient.
 * - String specifying the patient's birthdate in the form ' '.
 * - String specifying the patient's sex: ' ', ' ' or ' '.
 * - Number giving the patient's age in years.
 * - Number patient's weight in kilograms.
 * - Number giving patient's height or length in metres.
 * - String giving the patient's address.
 * - String giving the patient's insurance plan id.

variable attributes
These attributes store parameters about the acquisition. All of these attributes are optional, and have no default value defined.


 * - String description of the protocol for image acquisition.
 * - String description of type of data taken (eg. for MR - IR, SE, PS, etc.).
 * - Number giving the time in seconds between pulse sequences.
 * - Number giving the time in seconds between the middle of a 90 degree pulse and the middle of spin echo production.
 * - Time in seconds after the middle of the inverting RF pulse to the middle of the 90 degree pulse to detect the amount of longitudinal magnetization.
 * - Number of times a given pulse sequence is repeated before any parameter is changed.
 * - Precession frequency in Hz of the imaged nucleus.
 * - String specifying the nucleus that is resonant at the imaging frequency.
 * - String specifying the isotope administered.
 * - String identifying the contrast or bolus agent.
 * Half-life of radionuclide in seconds.
 * - String identifying tracer labeled with radionuclide that was injected.
 * - String giving time (and date) of injection.
 * - Integer giving year of injection.
 * - Integer giving month (1-12) of injection.
 * - Integer giving day (1-31) of injection.
 * - Integer giving hour (0-23) of injection.
 * Integer giving minute (0-59) of injection.
 * - Floating-point number giving seconds of injection.
 * - Number giving the time duration of the injection (in seconds).
 * - Total dose of radionuclide or contrast agent injected (in units specified by ).
 * - String giving units of dose.
 * - Number giving the volume of injection in milliliters.
 * - String identifying administration route of injection.

Dimension variable attributes
The attributes associated with either dimension or dimension width variables are given in this section.


 * - String with value ' ' for a regularly spaced grid or ' ' for irregular spacing of samples. If the value of this attribute is ', then the dimension variable must be a vector varying with the dimension of the same name. If this attribute is absent, a value of  should be assumed.  Can be used for both dimension and dimension width variables.


 * - Number indicating the step size between samples for regular spacing. This value may be negative to reverse orientation (to specify that  runs from patient right to left, for example). If the spacing is , then the value can be an average step size. If this attribute is absent, a value of 1.0 should be assumed. Applies only to dimension variables.


 * - Number specifying the coordinate of the index 0 of the dimension. If this attribute is absent, a value of 0.0 should be assumed. Applies only to dimension variables.


 * - String identifying the type of coordinate space. Currently one of ' ' (the coordinate system of the scanner), ' ' (a standardized coordinate system for brain images), or ' ' (another standardized coordinate system). If this attribute is absent, the {\tt spacetype} should be assumed to be native. Applies only to dimension variables.


 * - String indicating the position of the coordinates relative to each sample, one of ' ', '{\tt centre}', or ' '. If this attribute is absent, it is assumed to be   for the   dimension or   for spatial dimensions.  Applies only to dimension variables.


 * - Numeric vector with 3 elements giving the direction cosines of the axes. Although axes are labeled x, y and z, they may in fact have a significantly different orientation - this attribute allows the direction relative to the true axes to be specified exactly. The vectors should be normalized unit vectors.

If these attributes are not present, they are assumed to have the following default values:

For : [1, 0, 0], for  : [0, 1, 0], and for : [0, 0, 1]

The  attributes apply only to dimension variables.


 * - Numeric attribute which gives the full-width half-maximum width of all samples for regularly sampled dimensions. It can be used for irregular widths to specify the average width. If this attribute is absent, a value of 1.0 should be assumed. Applies only to dimension width variables.


 * - String specifying the shape of the convolving filter. Currently, can be one of ' ', '{\tt gaussian__}' or ' '. If this attribute is absent, a value of  should be assumed.  Applies only to dimension width variables.

=Minimal MINC file= Of all of the variables, dimensions, and attributes described here, only the ' ' variable and its associated dimensions are required to define a valid MINC file.

Any missing attributes are assumed to have default values, or to be undefined.

=Non-Standard Objects= While MINC specifies the structure and interpretation of a number of objects, typical MINC programs will operate gracefully with MINC files which contain non-standard constructs. This imposes two requirements on MINC programs. First, MINC programs must operate correctly on files which contain non-standard variables and attributes. Second, MINC programs must copy non-standard attributes and variables from the input file to the resulting output file without alteration.

This behaviour allows the addition of arbitrary variables and/or attributes for informational purposes that extend the standard MINC namespace.

=References= Russell K.~Rew et al, 'NetCDF User's Guide for C' [online], Unidata Program Center, Boulder, CO, 1997 (http://www.unidata.ucar.edu/packages/netcdf/guidec/). 'HDF5: A New Generation of HDF' [online], National Center for Supercomputing Applications, University of Illinois, Urbana-Champaign, IL 2003 (http://hdf.ncsa.uiuc.edu/HDF5/). Peter Neelin, 'MINC Programmer's Reference Manual' [online], Montreal Neurological Institute, Montreal, QC, 1993 American College of Radiology, National Electrical Manufacturers Association (ACR-NEMA) Standards Publication Number 300-1985, {\bf Digital Imaging and Communications}, National Electrical Manufacturers Association (NEMA), Washington, DC, 1986.

=Author= Robert D. Vincent