How to install and use precompiled MINC tools

by Rick Hoge

Contents

About this document

What is MINC?

What's included here

What is not provided

Installation and configuration

Locating sessions in the NMR Center archive

File and directory naming

Basic Operations on MINC Files

Administrative Functions


About this document

In the image transfer stream now implemented for the new Siemens MRI systems at the NMR Center, the MINC file format is used for storage of image data following mosaic unpacking. This document describes currently existing utilities for viewing and manipulating image data in this format. It does not cover Doug Greve's unpacking and analysis stream or the database browser written by Tony Harris. The main purpose of this document is to describe processing tools which might be useful to users at the NMR Center.

Another objective is to make it as easy as possible for people to check their MINC data immediately following conversion, to ensure integrity of the data. Please report any conversion errors (missing or misplaced slices, etc.) to me at rhoge@nmr.mgh.harvard.edu. Detailed information on the type of scan that failed (pulse sequence, mosaic parameters, whether the scan or adjacent ones were aborted, etc.) is helpful.


What is MINC?

MINC is a medical imaging oriented extension of the NetCDF file format. NetCDF stands for `Network Common Data Form' and it is widely used in many areas of scientific data storage. Its main advantages are support for coordinate systems, extensibility, self-description, and portability across different computer platforms. With a few simple tools, it is extremely easy to read in both the data and descriptive information about the data. Click here for more technical information on the MINC file format.


What's included here

The packages available through this page constitute a fairly comprehensive set of tools for manipulating and viewing minc files. Most of the applications were developed at the Montreal Neurological Institute. Other than the image display utilities (which can't be scripted), all the applications are stand-alone programs that can be run from the command line or scripted. Many have a man page and all produce usage info if given the -help option. All tools are public domain and source code is available on request (I'll put it here at some point).

The main features which may be of interest are listed below:


What is not provided

These packages provide intermediate level tools for data manipulation. The basic tool-set does not include a statistical analysis program - such applications exist, but currently most available ones are matlab-based. There is also at least one standalone application, xfmri (by Gerard Crelier at University Hospital in Zurich), which integrates correlation-type and GLM (SPM-like) analyses as well as visualization, overlay, and plotting capabilities (this is available at the NMR Center).

The basic utilities included in this package have been extensively debugged and tested. Because they are considered relatively mature, upgrades for addition of new functionality of specific applications are not likely in the near future. These utilities are better viewed as building blocks from which new analysis methods can be implemented.

A number of the utilities described here are used internally in software developed and maintained at the NMR Center. However, since these tools (the MINC utilities) are not a local product, support by MGH core personnel may be limited. The object of this web page is to provide some basic documentation so that MGH computer staff will not be burdened by requests for support of this externally developed software.


Installation and configuration

Note:

Please see the MNI ftp site for current minc distributions.


Locating sessions in the NMR Center archive

(Warning: this section subject to change!)

Where do the images go?

Image transfers from the Siemens MR scanners at the MGH NMR Center currently take place in two stages:

  1. Image files in the proprietary Siemens format (.ima files) are copied onto a separate disk array (/space/sharbot/*/siemens/) that is visible to laboratory workstations. At this stage, individual .ima files may contain mosaics of multi-slice data, and a number of image header fields are either incorrect or absent.

  2. After being copied onto the disk array, the .ima files are read by a program which fixes a number of irregularities (mosiac images are broken into proper slices with correct position information, time-series are properly ordered and labelled). This program saves the cleaned up data in a separate location on the disk array (/space/sharbot/2/minc/) in the MINC file format (a generic format for storage of multi-dimensional data).

What if browse-sessions can't find my study?

In the current system, the program `browse-sessions' looks for the MINC data created in stage 2. If your session does not show up when running `browse-sessions', it is probably because the second stage has failed (this has been happening due to instabilities on the computer used for archiving - should be fixed soon).

If the data have passed stage 1 (as is usually the case), you can just re-do the cleanup and storage in MINC, generating the files required by browse-sessions.

I have set up an experimental web-based utility for locating and re-converting a session, available at the link indicated below (only from NMR Center computers). You will need to know the date of the session and the model name of the scanner it was done on (`sonata' or `allegra' respectively for the 1.5T and 3T systems).


File and directory naming

MINC files generated using the transfer software in place as of April 2000 are placed in a separate directory for each session and get automatically generated file names. The following is an example of the directory and file naming used, with an explanation of the different fields:

Directory name:

Files:

In general the directory and file names consist of a set of dash-separated fields according to the following convention:

Init-ID-Scanner-Date-Time/Init-ID-Scanner-Date-Time-Scan-mri.mnc

The meaning of the different fields is given below:

field value in example meaning
Init js Subject's initials: This is based on the information entered in the Patient Name field on the scanner console. The entries `john smith' or `smith, john' will both be converted to js. By design, if a single word is typed in (including underscore-separated fields) this will not be converted to initials. This allows a descriptive title to be assigned to the experiment in phantom or animal studies.
ID 0 Subject's ID code: based on Patient ID field on scanner console. In this case a zero was typed in.
Scanner sonata Scanner model name: Can be either sonata, allegra, vision, etc.
Date 20000312 Session start date (yyyymmdd): This is the date on which data entry at the Patient Register window was completed. Individual scans have their own start dates, which are indicated inside the headers.
Time 171630 Session start time (hhmmss): This is the time at which data entry at the Patient Register window was completed. Individual scans have their own start times, which are indicated inside the headers.
Scan 1,2,3 Scan number in session: Generally, any time the `start' button is pressed on the scanner a new scan number is allocated. Note that aborted scans may result in skipped numbers.

Basic Operations on MINC Files

here I'll give a list of basic operations that might be performed on hypothetical MINC files with suggestive names - like anatomic.mnc and epi.mnc.

Seeing what scans are in what files

Viewing an image

Plotting time-intensity curves

Getting info about a file

Registering scans of a given subject from different days

(not available yet on Sun due to Perl issues)

Let's say on day 1 you acquire anatomic1.mnc and epi1.mnc. On day 2, you scan the same subject to get anatomic2.mnc and epi2.mnc. All the MINC files from both days contain the images in the scanner coordinate system (XYZ in mm from scanner isocenter), but the subject's head will be in different positions on the two days. You can transform the scans from day 2 to match the head position of day 1 using the following steps:

  1. mritoself anatomic2.mnc anatomic1.mnc day2_to_day1.xfm

    (produces the output file day2_to_day1.xfm containing the transformation matrix describing the shift in head position between day 2 and day 1)

  2. mincresample -like anatomic1.mnc -transform day2_to_day1.xfm anatomic2.mnc anatomic2_in_day1space.mnc

    (produces output scan anatomic2_in_day1space.mnc on same sampling grid as anatomic1.mnc)

    mincresample -like epi1.mnc -transform day2_to_day1.xfm epi2.mnc epi2_in_day1space.mnc

    (produces output scan epi2_in_day1space.mnc on same sampling grid as epi1.mnc)

    etc. for other scans on day2

Registering scans of a given subject to talairach space

(not available yet on Sun due to Perl issues)

The program mritotal computes the transformation required to optimally match a target brain composed of the average of 305 brains that have been manually bootstrapped into talairach space. This is done using the following steps:

  1. mritotal anatomic.mnc anatomic_to_tal.xfm

    (produces the output file anatomic_to_tal.xfm containing the transformation matrix describing the shift in head position and scalings needed to bring anatomic.mnc into talairach space).

  2. mincresample -like $MINC_ROOT/lib/model/average_305.mnc -transform anatomic_to_tal.xfm anatomic.mnc anatomic_in_talspace.mnc

    (produces output scan anatomic_in_talspace.mnc on same sampling grid as the 305 brain average)

    mincresample -like epi.mnc -transform anatomic_to_tal.xfm epi.mnc epi_in_talspace.mnc

    (produces output scan epi_in_talspace.mnc on same sampling grid as 305 brain average)

    etc. for other scans of that subject in same session

Converting a MINC file to the bshort format

Dumping the binary image data in a MINC file to a file or STDOUT


Administrative Functions

There are several data transfer and conversion tools used in moving data from the Siemens system to offline workstations. The following documents describe aspects of these that may be of interest in system adminstration and installation