BIAS FIELD CORRECTION EXAMPLE

OVERVIEW

In MRI images, intensity inhomogenieties which are caused by
magnetic settings, patients' postion, and other factors are not
unusual. This example has several small utilities that can be used to
reduce such bias field. To estimate the bias field, we use Legendre
polynomials. The 1+1 evolutionary optimizer searches for the best
paramters of a Legendre polynomial (bias field estimate) which
minimizes the total energy value of each image after bias field
is eleminated.  

All softwares and methods ,except the slab identification method, 
for the bias correction in this directory was initially developed 
and implemented by Martin Styner, Univ. of North Carolina at Chapel Hill,
and his colleagues.

For more details. refer to the following articles.
"Parametric estimate of intensity inhomogeneities applied to MRI" 
Martin Styner, G. Gerig, Christian Brechbuehler, Gabor Szekely,  
IEEE TRANSACTIONS ON MEDICAL IMAGING; 19(3), pp. 153-165, 2000, 
(http://www.ia.unc.edu/public/styner/docs/tmi00.pdf)

"Evaluation of 2D/3D bias correction with 1+1ES-optimization" 
 Martin Styner, Prof. Dr. G. Gerig (IKT, BIWI, ETH Zuerich), TR-197
(http://www.ia.unc.edu/public/styner/docs/StynerTR97.pdf)

NOTE: All utilities supports only metaimage file format (.mha or .mhd).

HOW TO COMPILE

Before compile the utilities in this example, you have to turn on the
BUILD_AUXILIARY option and BUILD_EXAMPLE option which you can find
in the CMakeList.txt file in the root of the Insight source
directory. Then, turn on the BUILD_MRI_BIAS_CORRECTION option in the
CMakeLists.txt file in the Insight/Example directory.


HOW TO USE UTILITIES

Just type the name of the utility you want to use in command line
without any option. The utility will show its usage.

UTILITIES

1. BiasFieldEstimator
This utility basically searches for the best set of coefficients for the
bias field using some image files (target image, mask images) and
parameters which you will type in as a command line arguments. It
returns some command line arguments values and the list of the best
set of coefficients to screen. 

2. ImageCorrector (previously named BiasCorrector)
This utility creates a bias field corrected image using an image and a
set of bias field estimate coefficients which will be the result from
the BiasFieldEstimator.

3. BiasImageGenerator
This utility creates the image of a bias field estimate which is
defined by the set of coefficients which is probably the result of the
BiasFieldEstimator

4. InterSliceIntensityCorrector
This utility corrects the difference between slices using the Legendre
plynom of the zeroth degree. User can use this utility as a
preprocessing for the BiasFieldEstimator. 

5. IntensityHistogram3D
This utility creates a list of sets of slice number, mean intensity,
and frequency. Users can use this list to plot a 3D histogram with
slice number, intensity, and frequency axes.

6. EnergyTablePlotter
This utility creates a list of pairs of intenisty and its energy
value using class statistics given by users. Users can use the list to
adjust to tissue class sigma. 

7. SlabIdentifier (New)
This utility search for slabs in an MR ansiogram (MRA) image. 
In many cases, a 3D MRA image is constructed by merging  smaller 3D 
blocks (slabs) which were acquired with different settings such as magnetic
settings and patient positions. Therefore, stripe like patterns with slabs 
can be present in the resulting image. Such artifacts are called "slab 
boundardy" artifacts or "venetian blind" artifacts.

With the slab boundary artifacts in an image, even a same tissue class's
intensity values might vary significantly along the borders of slabs.
Such rough value changes are not appropriate for some image processing
methods. For example, MRIBiasFieldCorrectionFilter assumes a smooth bias 
field. However, with the slab boundary artifacts, the bias field estimation
scheme that MRIBiasFieldCorrectionFilter uses might not adopt well.
So, the MRIBiasFieldCorrectionFilter creates regions for slabs using the 
MRASlabIdentifier and then apply its bias correction scheme to each slab.

8. BiasCorrector (New)
This utility performs slab identification, inter-slice intensity correction,
, bias field estimation, and corrected image generation all together using 
itkMRIBiasFieldCorrectionFilter (in the Code/BasicFilter directory). The main
purpose of this utility is to show how to use the filter.
The InterSliceIntensityCorrector utility also uses the same filter.


POSSIBLE USE SENARIOS

0. Image Preprocessing
1) original image -> InterSliceIntensityCorrector -> preprocessed
image

2) original image -> GradientAnisotropicDiffusionFilter (noise
reduction, coming soon) -> preprocessed image 


1. Bias Field Estimation

1) original image (or preprocessed image) -> BiasFieldEstimator ->
coefficients of the bias field estimate

2) original image (or preprocessed image) -> BiasFieldEstimator ->
coefficients of the bias field estimate -> ... -> BiasFieldEstimator
-> coefficients of the bias field estimate 

2. Bias Correction

1) original image + the coefficients of the bias field estimate (from
BiasFieldEstimator) -> BiasCorrector -> bias field corrected image

3. Bias Image Generation
1) the coefficients of the bias field estimate + result image
dimension and size -> BiasImageGenerator -> bias image
