next up previous
Next: Further information Up: readme Previous: System requirements

Building and installating N3 from source code

In order to make MNI N3:

0a)
You will need a recent C++ compliter (eg. gcc 3.0 or later).

In addition, you will also need a GNU version of make (gmake on some systems), available at any GNU ftp site.

ftp://prep.ai.mit.edu/pub/gnu/

1)
You may have to build and install the netCDF library.

2)
You may have to build and install the MINC library (check that you have version 1.0 or later).

3)
You may have to build and install Perl 5. (check using perl -V that it is version 5.003 or later.)

4)
You may have to build and install the mni_perllib package. If you decide not to install the library in its default location (/usr/local/lib/perl5/site_perl on many systems) then you will need to set your PERLLIB environment variable. For example, if you were to install the libraries to /usr/local/mni/lib/perl5 then you would set the PERLLIB variable with
setenv PERLLIB /usr/local/mni/lib/perl5
(assuming you use a csh-variant) in your ~/.cshrc or the global /etc/cshrc file. (Or, if you're a Bourne-shell, ksh, zsh, or bash type of person, put
PERLLIB=/usr/local/mni/lib/perl5/site_perl ; export PERLLIB
in ~/.profile or /etc/profile.)

Also, note that during installation of the mni_perllib package you will be queried for the default location where model data included with the MNI_N3 package will be stored. In the future, most MNI software packages will install their model data in a subdirectory of a common data directory, which by default is called /usr/local/mni/data. While the default location of model data can be overridden on a package by package basis, doing so will require each user to specify the model data's location using the environment variable MNI_DATAPATH.

5)
You may have to build and install the EBTKS library (check that you have version 1.2 or later).

6)
We have used the GNU autoconf program to create a `configure' script that will automatically determine various system- dependent values and generate Makefiles needed to build the package.

In the directory where you unpacked the MNI_N3 tar file, type

./configure

`configure' works by poking around your system to determine all the system-specific values needed to build and install MNI_N3. Once it has done that, it creates Makefile.include, which is the granddaddy Makefile used by all the programs in the package. If `configure' runs successfully, skip to step 7 below.

If `configure' complains about not being able to find certain things, though, you may have to give it some hints. In particular, this be necessary if you have installed netCDF, MINC, Volume_IO, or Perl 5 in weird places. The easiest way to do that is with the --prefix option; for instance, at the MNI, we keep home-grown software under /usr/local/mni, so here we run `configure' like this:

./configure --prefix=/usr/local/mni --with-build-path=/usr/local/mni
and the MINC and Volume_IO files will be found in various directories under /usr/local/mni. (netCDF is not home-grown, so we keep it under /usr/local. Luckily, `configure' is smart enough to look there if all else fails.)

If you have built shared-library versions of netCDF, MINC, or Volume_io, configure should be able to find these. It looks for libraries first with a ".a" extension, then with ".so"; this appears to be a quite common convention under various Unices, and is known to work under IRIX and Linux. If your system has a different scheme for naming shared libraries, you might need to set the LIBEXT variable; e.g. to only look for ".so" files,

env LIBEXT=".so" ./configure
(LIBEXT is just a space-separated list of extensions, including the dot on each one.)

7)
In the directory where you have unpacked both the MNI_N3 package and the test data, type:
make
make install

Note that you may need to set the environment variable TMPDIR to some more appropriate place than /usr/tmp on systems where /usr/tmp has little available space.

8)
Now, you're ready to test nu_correct on real data. Start by typing
nu_correct -help

nu_correct makes use of a number of other binaries and scripts that are also useful on their own. Their functionality is summarized below:
nu_correct estimates and removes intensity non-uniformity from a volume.
nu_estimate estimates the intensity non-uniformity in a volume, storing the result in a compact format referred to as an .imp file.
nu_evaluate corrects the intensity non-uniformity in a volume using the given .imp file.
imp2field expands an .imp file into a MINC volume representation of the correction field.
field2imp converts a MINC volume representation of a correction field into an .imp file.
volume_stats prints a variety of summary statistic for a volume or region of interest.
volume_hist produces a histogram of a volume.
spline_smooth smoothes a volume using tensor cubic B splines or thin plate splines.


next up previous
Next: Further information Up: readme Previous: System requirements
John G. Sled 2004-03-15