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.