Software: Data Processing: MINC

MINC

The MINC file format and toolbox was originally conceived, written and released by Peter Neelin in 1992 due to the frustrations of dealing with multiple file formats from varying scanners and research groups.

Description

In the ensuing years many associated tools (image registration, normalisation, visualisation, etc.) were written and have also been released. The original MINC file format and tools were based upon the NetCDF data format but problems were being encountered with multi-gigabyte datasets, as such a large rewrite of the library was undertaken in 2003 in which the data format was changed to HDF in order to support large files and other new features, resulting in MINC2. Development work on MINC1 was halted at version 1.5.1 in 2006. The current MINC2 library and tools are maintained by a group of developers in various image research labs around the world. 

Another development effort, called the MINC toolkit, lead by Dr Vladimir Fonov, based solely on the MINC2 library (which can read MINC1 data). If you are new to MINC, then we suggest that you start here but keep in mind that this package is bleeding edge. The package was officially released on April 23 2012. This toolkit contains most of the commonly used MINC tools in one precompiled 64-bit binary package of Debian, Ubuntu and Mac OS X. Also contains interactive tools like register and Display, and some advanced tools such as patch-based segmentation, denoising and brain masking.

MINCView

MincView is the IGNS platform’s viewing application.

Installing MINCView

Download the tar file here:

http://packages.bic.mni.mcgill.ca/tgz/mincview-1.6.2.tar.gz
file _readme_ is included in the tarball.

Go to the directory where you downloaded it and extract the file. It will create a directory called mincview.

cd /home/downloads
tar xvzf mincview-1.6.2.tar.gz

Make a directory where you want to build the package

mkdir /home/MincView

Run CMake

cd /home/MincView
ccmake /home/downloads/mincview

Configure CMake. You shall find examples of CMake options in the readme packaged with MincView. Compile the program

make

If you have administration rights you can type

make install

 

Display

Display which is part of MINC tools, is the most complex of all of the visualization tools available. It’s primary uses are the display of multiple imaging modalities (PET, fMRI, etc.), as well as for manual segmentation of MRIs, aka “Brain Painting.”

FAQ

How do I create a 3D rendering of a label?

Open the label in Display. Click somewhere on the part of the label that you want to render in 3D. Go to the “Create Surface” menu (G). Select “Label Bin-Isosurface” (G). Then, in the terminal, type the min and max of the label - for example, if your value is 1, type 0.5 1.5. This should do a marching cubes rendering of the label in the objects window.

How do I crop a volume?

Start display with your volume to crop as input: Display volume_to_crop.mnc

Then press on: H - Volume cropping F - Set Crop Source (Enter file name in terminal window) S - Pick Crop Box

A green contour will appear around the MR planes. y/ou can move the side of this crop window with yoru mouse.

Save new cropped volume by pressing on: R - Crop to file (Enter file name in terminal window)

How do I superimpose the peaks of a T-map on an anatomical image?

Do Display anatomical.mnc tstat.mnc (this makes your current volume to be tstat.mnc, using the color bar to left-adjust it to your desired threshold value.)

On the main menu click on “color coding” and choose “spectral”. in this same menu you have to make your current volume (i.e. the thresholded tstat.mnc) transparent. To do so, click on “over” or “under” (by default they are set to BLACK and WHITE) and then in the console type “transparent”. Now you should see the anatomical.
If you need to adjust the intensity of the anatomical image, press “pop” and go back to the main menu.
Click on “slice view”. You will see that “curr volume” is set to 2. Just click on it and it will change your current volume to 1, which is your anatomical one. now you can adjust the intensity using the bar on the left.

Alternative

You may use ray_trace to make complex representation of your results. There is a tutorial provided by David McDonald: http://www.bic.mni.mcgill.ca/users/david/Ray_trace/ray_trace_tutorial.html.

Additionally, here are some extra features:

(bold options are those not listed in the help menu. Claude Lepage has kindly suggested to upgrade ray_trace and to release a new version with the next quarantine after CIVET7.0)

Show positive and negative statistic maps on the entire brain surface.

ray_trace -output outfile.rgb -light -usercc cold_map.txt −13 −6 BOLD_contrast_t.mnc 0 1 -under transparent -over transparent -hot 6 11 BOLD_contrast_t.mnc 0 1 -over transparent -under transparent midsurface.obj -size 400 400 -bg black -crop -bottom

your cold_map.txt file would contain: (you can play with rgb values and generate different maps)

0.00 0.0 0.0 0.0
0.25 0.0 0.0 0.5
0.50 0.0 0.5 1.0
0.75 0.5 1.0 1.0
1.00 1.0 1.0 1.0

(you can use -bottom, -top, -left, -right to set the view.)

show markers, corresponding to activation peaks of different subjects on your brain object

ray_trace -output output.rgb -light -marker_size 3 -marker_colour red subject1_peaks.tag -light -marker_size 2 -marker_colour blue subject2_peaks.tag -light -marker_size 2 -marker_colour

subject3_peaks.tag average_midsurface.obj -size 500 500 -bg black -bottom

show subcortical peaks on a subcortical object within a brain object

ray_trace -output output.rgb -light -marker_size 3 -marker_colour red subcortical_peaks.tag average_midsurface_transparent.obj subcortical.obj -size 500 500 -bg black -bottom

to make a transparent object:

change the surface opacity

set_object_opacity average_midsurface.obj average_midsurface_transparent.obj 0.05

or make a wiregrid object

polygons_to_lines average_midsurface.obj midsurface_lines.obj

caution

if you use ray_trace with slice objects (as mentioned in David’s tutorial), make sure your tag file does not have coordinates that are not in the slice plane. That will result in a skewed image.

If you are using multiple surface objects you may need to use -one_hit option with ray_trace

Register

Register which is also part of MINC tools, can be used for superimposing two volumes as well as performing manual registrations.

MNI-register - interactive volume display and point tagging program

Synopsis

       register [-version][-help]
         [-rgb][-cmap][-single][-double]
         [-global variable value]
         [volume1_filename] [volume2_filename] [tags.tag]

Register is an interactive graphics application. It can display one or two volumes (typically MR or PET), and the merged image of the two. Some, but not all, versions will allow switching between single and double buffer mode and between RGB and colour map mode, so the options -rgb, -cmap, -single, -double are useful for setting the initial state of the program. There are three viewports for each volume, showing tranverse, sagittal, coronal slices. The user can move throughout the volumes, and create tag points within the volumes. If enough tag points for two volumes are picked, then a transformation is computed for registering the two volumes. This transform is used in displaying the merged image and in allowing the user to start a process which resamples one of the volumes into the same space as the other.
A vector volume will normally be converted to an RGB volume, on input. I don’t know what that means in terms of register’s display. Alternatively, the vector can be converted to a scalar whose value is the mean of the vector components, by setting the global variable Convert_vectors_to_rgb to FALSE.

Author

David MacDonald

User Interface

The user interface is a mouse-based interface composed of buttons, sliders, and text entry. Buttons can be pressed with the left mouse button. Text entries can be changed by pressing the left mouse button on them, then typing text. Typing return signals the text entry is done. Typing escape ends text editting without modifying the text. The delete, cursor left, and cursor right keys may be used. Ctrl-a and ctrl-e move the cursor to the beginning and end of text, respectively. Ctrl-u deletes all text in the text entry.

Main Menu

  • Quit: Quits the program, after confirmation.
  • Resample and Load: Resamples the second volume to place it in the same space as the first, according to the transformation defined by the tag points.
  • Resample Filename: Text entry to set the name of the file to create for the resampling.
  • Synced / Not Synced: Toggle switch to control whether the cursor position in all volumes is enforced to always be the same.
  • Flat / Interpolated: Not implemented yet. Eventually will control the interpolation method for display.
  • Colour Map / RGB: Toggles between colour map mode (faster updates) and RGB mode (truer colours).
  • Double / Single: Toggles between double and single buffer.
  • Load Tags: Loads a set of tag points into the program.
  • Tags Filename: Text entry to set name of filename to be used by load and save tags. A default extension “.tag” is provided automatically.
  • Save Tags: Saves all active tag points to a file. If one volume is loaded, then a set of single tags is saved. If two volumes are loaded, then a set of pairs of tags are saved.
  • Save Transform: Saves the transform defined by the tag points, if it exists.
  • Transform Filename: Text entry to set name of filename to be used by save transform. A default extension “.xfm” is provided automatically.
  • Record Tag: Overwrites the current tag point positions with the current positions within the volumes. If the current tag point is the end of the tags, then it creates a new tag point.
  • Delete Tag: Deletes the current tag point.
  • Delete All Tags: Pops up a confirmation box allowing you to delete all the tags.
  • Transform Type: Pops up a dialog to select 6 parameter, 7 parameter, 12 parameter, or thin-plate spline non-linear fitting.
  • Tags In/Visible: Toggles the display of tag point positions on the slices.
  • Cursor In/Visible: Toggles the display of cursor crosshair on the slices.
  • Interp: Flat/Smooth: Toggles the display of slices between flat and smooth shading. Smooth shading takes much longer to update (a few seconds), but produces higher quality images, especially noticeable when the images are zoomed up.
  • RMS: Displays the average RMS error of the tag points, if a transform exists.

Volume Menus

  • Voxel and World Position Readouts: Displays the position of the volume cursor in voxel and world coordinates. The positions can be changed numerically by clicking on the number and typing in the desired position.
  • Load Volume: Loads the specified volume.
  • Volume Filename: Specifies the volume filename.
  • Reset View: Resets the scale and translation of the slices to fit in the viewports.
  • Filter: Pops up a dialog window that selects the filter type for each of the 3 views of the volume. The filtering applies across slices, but not within slice.
    • The filter types are: nearest neighbour, linear interpolation, box filter, triangle filter, and gaussian filter.
  • Under Colour: Sets the colour displayed for voxels whose values are less than the range.
  • Over Colour: Sets the colour displayed for voxels whose values are greater than the range.
  • Colour Bar Slider: Sets the colour range. The left mouse can be used to drag the upper or lower limit. The middle mouse is used to move both at the same time.
  • Colour Coding Type: Sets the colour coding method to one of gray scale, hot metal, spectral, red, green, or blue.

Merged Menu

  • Voxel and World Position Readouts: Displays the position of the volume cursor in voxel and world coordinates. The positions can be changed numerically by clicking on the number and typing in the desired position.
  • Reset View: Resets the scale and translation of the slices to fit in the viewports.
  • Merge Method Buttons: Sets the merge method to one of blend, weighted, one on two, or two on one. Blend allows blending between the two volumes. Weighted allows arbitrary weights for the two volumes. One on two places volume one on top of volume two, with volume two showing through if volume one is out of range. Two on one is the opposite.
  • Opacity Sliders: Sets the weights of the two volumes. Only used if the merge method is blend or weighted.

Tags Menu

  • Position: Displays and allows setting of tag positions.
  • Name: Sets the name of a tag.
  • On / Ignore: Sets the activity of a tag, whether it contributes to the transformation or not.
  • Dst: Displays the distance of the tag point in the first volume from the position of the transformed

Mouse and Keyboard

In the slice viewports, the following actions are valid:

  • Left Mouse: Sets the volume cursor position.
  • Middle Mouse: Moves slice perpendicular according to y position of mouse.
  • Right Mouse: Adds a new tag point at the current volume cursor positions.
  • Shift/Ctrl/Alt Left Mouse: Translates the slice display
  • Shift/Ctrl/Alt Middle Mouse: Zooms the slice display according to the y position of the mouse.

Volume Caching

Register has the ability to handle volumes larger than virtual memory by caching parts of the volume in memory. The current default for deciding when to cache is volume is 80 Megabytes. See the documentation of the source libraries for MNI-register for more information.

Note that volume caching can have a radical effect on performance. In some cases you may get much better results by disabling caching, especially when working with volumes on NFS-mounted filesystems.

Files

/usr/local/lib/register.globals

/usr/local/lib/register_UI.globals

Getting Started

All BIC software source releases are stored in the tgz directory. Pre-built binaries are also available for a number of operating systems with various levels of support.

Documentation

All MINC documentation is stored on wikibooks such that anyone can contribute. This wikibook like all documentation is always in development, but contains the latest information and documentation.

Licensing

The MINC package itself and most of the associated tools are licensed under a modified BSD license. The MINC license is shown below but be aware that some packages are released under differing licences such as the GPL. Check the COPYING file in the chosen package for details.

Copyright 1993-2014
McConnell Brain Imaging Centre
Montreal Neurological Institute
McGill University

Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies. The author and McGill University make no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.

                           

The Neuro logoMcGill logoMcGill University Health Centre logoKillam logo

                                                                                                                 FacebookinstagramtwitterlinkedInyoutube

Back to top