View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Intensity inhomogeneity correction

4.5 | 4 ratings Rate this file 34 Downloads (last 30 days) File Size: 6.87 MB File ID: #13411 Version: 1.0
image thumbnail

Intensity inhomogeneity correction



15 Dec 2006 (Updated )

LEMS method to correct for intensity inhomogeneity of MR images

| Watch this File

File Information

Unzip all the files in a folder.
set the Matlab current dir to this folder or add it to the path.
At the matlab prompt, type LEMS1im_GUI
Follow the buttons order to perform the steps:
1) load image. Can be dicom or regular image format
2) crop. If not needed make a box emcompassing the whole image
3) Threshold. This step is necessary to identify the pixels subject to the bias field
4) Initialize bias field. The initial bias field is initialized using a 2D polynomial
5) Filter the image. Improve the performance of the correction method. Uses robust anisotropic diffusion filtering (Black et al. method). Noise scale is computed from the background identified from step 3.
6) call to the LEMS function to perform the actual correction.
7) Save results

This GUI is just a wrapper to call the LEMS function:
% BiasCorrLEMSS2D: Correct for Inhomo by local entropy minimization with splines support
% [B,x,B0] = BiasCorrLEMSS2D(I,Imask,V_mean,V_std,options,B0);
% B: Final bias filed
% x: corrected iamge (x=I/B)
% B0: Initial bias field in case it has been modified by the funciton
% I: input image (should be in [0 255])
% mask: identify the pixels subject to bias field
% V_mean: mean of the background
% V_std: std of the background
% options: structure with options. to initialize the stucture call the
% function without input argument
% option = BiasCorrLEMSS2D
% option =
% Nknots: [30 30] knot spacings in y and x direction
% NiterMax: 3 number of iteration max
% flag_display: 1 if 1, display intermediate results in a new figure
% overs: -1, if 1 pad the image to get an even number of knots
% normalize: 1, if 1 notrmalize the image
% flag_allknots: 1, if 1 optimze the knots at the image border
% GainSmooth: 0, gain to force the spline to be smooth by constraining the second derivatives
% Bgain: 0.5000, average of the bias field over the pixels with signal
% B0: Initial Bias field
% Olivier Salvado, 20-jan-04, Case Western Resrve University
% Salvado et al. IEEE TMI 25(5):539-552

For more information see the attached paper. Please cite this paper if you use this tool.

Required Products Image Processing Toolbox
Spline Toolbox
MATLAB release MATLAB 7.3 (R2006b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (8)
21 Dec 2016 jason jiao

17 Jan 2013 XiaoFang Gan

I hope the tool is useful

Comment only
17 Sep 2012 Bogdan Dzyubak

Seems to work well once tweaked. It won't run out-of-the-box, though.

1) Go to PolyMaskFilter.m and change if ~exist('basis') for if exist('basis') ~= 1. It's a matlab version issue.

2) After selecting the area to be cropped, you need to right click on the image and click crop. It's a little unintuitive.

3) You may need to hardcode or otherwise adapt parameter estimation, such as background std.

4) The 'manual threshold' option can only be use to give the low threshold.

After fixing these, it seems to give me a pretty good result, though I've yet to evaluate whether it will work on images universally.
Thanks for posting. Good luck to users.

10 Aug 2008 Mohammad Ali Balafar

deliberately, some lines in files are deleted. It is strange provide files for use but do something to confuse people

Comment only
04 Aug 2008 Mohammad Ali Balafar

I got your file. I did all and run LEMS1im_GUI but option 1,2 arenot apeared

Comment only
30 Oct 2007 Hank Lee

I really appreciate to you for your help
I got the file and did all steps you told in readme.txt
but it did not work !!

Can you tell me what should I do to run it ??

26 Feb 2007 brian coe

good stuff. works well, but i needed to touch up some of the memory consumption issues.
now for a 3D version.....

22 Dec 2006 Bentlemsan Maouia

The application does not work and I do not know why. Perhaps it is a problem of matlab version. I have (R14) version

Comment only

Contact us