Skip to content

BIC-MNI/libminc

Repository files navigation

MINC - Medical Image NetCDF or MINC isn't netCDF

INTRODUCTION
------------
The MINC file format is a highly flexible medical image file format
built on the HDF5 generalized data format. The format is
simple, self-describing, extensible, portable and N-dimensional, with
programming interfaces for both low-level data access and high-level
volume manipulation. On top of the libraries is a suite of generic
image-file manipulation tools. The format, libraries and tools are
designed for use in a medical-imaging research environment : they are
simple and powerful and make no attempt to provide a pretty interface
to users.

Minc tools are hosted in https://github.com/BIC-MNI/minc-tools

Additional tools are available from the Montreal Neurological
Institute (MNI).

    https://packages.bic.mni.mcgill.ca/tgz


SUPPORT FOR HDF5 "MINC 2.0" FORMAT FILES
----------------------------------------

This change requires that HDF5 must be installed before MINC can be
built. You can obtain HDF5 from, current version is 1.8.11:

   https://www.hdfgroup.org/

You should NOT need to become an HDF5 expert to use MINC 2.0.
However, two tools included with HDF5 may prove useful, "h5dump" and
"h5ls".  h5dump is roughly equivalent to netCDF's ncdump utility.
There is no exact netCDF tool analogous to h5ls.  h5ls is useful for
exploring and extracting bits of the HDF5 hierarchy.

3. TENTATIVE ".mincrc" AND ENVIRONMENT VARIABLE SUPPORT

This is implemented as a way to control certain behaviors of the library
which are not readily available through other means. These variables may
be defined either in your environment, or in the .mincrc file in your
home directory.  The value in the environment should override the one in
.mincrc. 

Here's what exists so far:

# Force output files to MINC 2.0 format, regardless of the "-2" option.
#
MINC_FORCE_V2 = {1, 0}

# Desired ZLIB compression level.  Zero implies no compression, a value
# of 4 gives a good tradeoff of compression and performance.
#
MINC_COMPRESS = {0..9} 

# Desired HDF5 chunking dimension.  This controls the size of the
# "hypercube" used by HDF5 to store the file.  If set to zero, the
# file will not be stored in a chunked format, unless compression is
# enabled.  The chunk size will automatically be reduced if it exceeds
# any actual dimension of the volume.  If chunking is enabled
# automatically because of compression, the default chunk dimension is
# 32.
#
MINC_CHUNKING = {0..N}

# Log file - path to the desirned output file for messages.  The default
# is the standard error (stderr) stream.  To redirect to standard output,
# set this variable to "stdout" or "-".  Otherwise the variable is taken
# to be the path to the desired log file.  If the path name begins with
# a '+' character, the log file should be appended rather than recreated.
#
MINC_LOGFILE = [+]<pathname>|stdout|-

# Logging level.  Not really useful yet, but intended to allow setting
# of 'verbosity' of messages.  A value of zero would inhibit all but
# fatal messages, a value of 4 would allow debugging messages.
#
MINC_LOGLEVEL = 0-4


# Maximum memory buffer, used in some minc programs
#
MINC_MAX_FILE_BUFFER_KB = <N>

# Maximum allocated memory, used in some minc programs
#
MINC_MAX_MEMORY_KB = <N>

# Memory cache for MINC2 files, per open file
#
MINC_FILE_CACHE_MB = <N>

# Creation of HDF5 checksums for the volume, only works for MINC2 
# file format 
# default 0
#
MINC_CHECKSUM = {1,0}

# Prefer using MINC2 API inside Volume IO
# default 0
#
MINC_PREFER_V2_API = {1,0}



DOCUMENTATION
-------------

https://en.wikibooks.org/wiki/MINC