Software - MRI Image Bias Correction
There are two models in the literature for correcting intensity nonuniformities (bias) in MRI images. The first model involves resetting the image to a hypothetical ideal. For example,
N3
changes intensities to sharpen the histogram tissue peaks. The second model uses a template image with known voxel intensities and compares the subject image to it. The idea here is that deviations in the ratios of corresponding voxel intensities identify nonuniformities which can be removed from the subject image.
Our nonuniformity correction is a template based method. We use a non-linear spline warp to align the subject volume with a template which is assumed to be bias free. We assume the alignment is adequate to allow comparison of like tissue types between the subject and template voxels. Voxel ratios at discrete locations are obtained by comparing the voxel means in corresponding local patches of template and image. The ratios at these locations are interpolated using thin-plate splines to create a smoothly varying model of the voxel intensity ratios at every point. With no bias in the template, the ratio field is de facto a model of the bias field for the subject.
Thus, our correction method is aimed at smooth, slowly varying MRI field nonuniformities. It is not intended to correct abrupt changes in the MRI field that may result from coil placements.
Also, this algorithm is not recommended for whole head image correction. It is most successful when the skull has been stripped.
The ratio field is used to multiplicatively correct the subject voxel intensities. The following synthetic images illustrate the procedure:
![]() |
![]() |
Fig. 1 Subject with bias field |
Fig. 2 Template image |
On the left is a subject image with evident intensity nonuniformity. On the right is a template used for comparison (both of these images are derived from the MNI template; one is a slightly warped version of the other, used here for illustrative purposes).
![]() |
Fig. 3 Computed inverse bias ratio field |
This image shows the resulting model of the inverse ratio field, which when multiplied against the subject image reduces the bias.
Next we show the results of correcting a real image.
![]() |
![]() |
Fig. 4 Uncorrected MRI image showing bias |
Fig. 5 Same slice after bias correction |
Figures 4-5 show the successful removal of the bright and dark highlights in the MRI bias field on the left. Also, bias correction typically improves the quality of the image histogram. The following figures show histograms for this MRI image before and after correction.
![]() |
![]() |
Image histogram prior to correction |
Histogram after correction |
The main improvements are the appearance of more distinct tissue intensity peaks for gray and white matter.
The algorithm has these capabilities and limitations:
- Robust correction of smooth, low spatial frequency bias fields in high resolution T1 MRI images.
- Not intended for other MRI images such as PD, T2 or double spin echo.
- Not intended for abrupt field changes.
- Most successful on skull-stripped images.
- Align template image to target using linear (affine) registration followed by high-dimensional spline warp. This improves the matching of like tissue types between images of dissimilar topography.
- Sample the ratios of intensities at like tissue types between target and aligned template. These ratios estimate the MRI field non uniformities for the target image when a low-bias template is used.
- Smoothly interpolate the ratios at discrete points using thin-plate splines to create a multiplicative correction field for the target image.
- Correct the target image by multiplying times the inverse model bias field.
Our bias correction algorithm runs to completion in a little less than an hour for most images, running on a Pentium P4 chip at 3.6 GHz. This is in the range of reported times (sometimes over one hour) for N3 correction. In addition, we have found that with some images (such as the example above in Fig. 4), N3 will not perform a correction without prior smoothing of the image.
There are some practical issues involved, however. The main one is that the template and
subject image must be in the same orientation prior to the warping that allows bias removal.
To address this question, we have implemented a way to keep track of the image
parity -
the relation of the subject's right to left, nose to occiput, and foot to head coordinate directions
with the standard coordinate axes of the image space.
Once this information is known, then the images can be internally reoriented to matching parities prior to alignment. Our program does this.
To do so, we need to supply the parity information for the subject image. This is accomplished with our parity tool, illustrated next. The figure shows the parity tool interface with a sample image pictured. The "wizard" button launches a sequence of separate windows (X axis is shown) that walks you through setting the information for each of the subject's directions relative to the image space axes.
In the sample window, the X-axis direction is being set: if it is parallel to the subject's right-left direction, then click which one. Otherwise, click NO and a second window will query whether the subject's front-back direction is parallel to this axis, and so forth. Continuing in this way, you can set the complete parity information for the subject.
Once this is done, the rest of the bias correction proceeds automatically.
![]() |
Parity tool interface |
![]() |
Parity Tool wizard window for setting X-axis information |
Our bias correction package includes all software needed to automatically run the template-based
corrections, including two template images -- for old and young subjects. These templates have
parity information in their header files. The actual images are derived as follows:
- Old Template: High-resolution average of 96 normal elderly subjects
- Young Template: Synthetic image of young normal brain from the MNI Brainweb site
The following figures show sample slices from the templates.
![]() |
![]() |
Old Template |
Young Template |
The algorithm accepts analyze or interfile file formats. A typical call for a subject image "T" in analyze format (using in this example the young template) would be as follows:
IHCorr T.hdr YoungTemplate.hdrIf the parity information for the target image is missing, then the algorithm calls up the parity tool window so that this can be set. When done, be sure to click the Set Parity and Exit buttons of the parity tool. When the parity information for the target image has been set, then the rest of the bias correction follows automatically.
Outputs from this run would include two new images:
T_corr.hdr .img (or .h01 .i01 if interfile) SubjectBiasRatioCorrstoring respectively the corrected image and the bias field used to make the correction.
Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'UTC/0.0/no DST' instead in /var/www/html/software/bias_correction_counter.php on line 88
Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'UTC/0.0/no DST' instead in /var/www/html/software/bias_correction_counter.php on line 63
Warning: fopen(./counter/bias_correction_ip.txt) [function.fopen]: failed to open stream: Permission denied in /var/www/html/software/bias_correction_counter.php on line 17
Warning: fwrite() expects parameter 1 to be resource, boolean given in /var/www/html/software/bias_correction_counter.php on line 19
Warning: fclose() expects parameter 1 to be resource, boolean given in /var/www/html/software/bias_correction_counter.php on line 20
Warning: fopen(./counter/bias_correction_ip.txt) [function.fopen]: failed to open stream: Permission denied in /var/www/html/software/bias_correction_counter.php on line 24
Warning: fwrite() expects parameter 1 to be resource, boolean given in /var/www/html/software/bias_correction_counter.php on line 26
Warning: fclose() expects parameter 1 to be resource, boolean given in /var/www/html/software/bias_correction_counter.php on line 27
Warning: fopen(./counter/bias_correction_count.txt) [function.fopen]: failed to open stream: Permission denied in /var/www/html/software/bias_correction_counter.php on line 17
Warning: fwrite() expects parameter 1 to be resource, boolean given in /var/www/html/software/bias_correction_counter.php on line 19
Warning: fclose() expects parameter 1 to be resource, boolean given in /var/www/html/software/bias_correction_counter.php on line 20
Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for 'UTC/0.0/no DST' instead in /var/www/html/software/bias_correction_counter.php on line 76
Warning: fopen(./counter/bias_correction_visit_log.txt) [function.fopen]: failed to open stream: Permission denied in /var/www/html/software/bias_correction_counter.php on line 24
Warning: fwrite() expects parameter 1 to be resource, boolean given in /var/www/html/software/bias_correction_counter.php on line 26
Warning: fclose() expects parameter 1 to be resource, boolean given in /var/www/html/software/bias_correction_counter.php on line 27
14334 unique visits since June 1, 2006