Login  Register

Uneven illumination of background

Posted by rtas on Nov 11, 2013; 3:01am
URL: http://imagej.273.s1.nabble.com/Uneven-illumination-of-background-tp5005529.html

Hello,

I have serial histological sections (RGB image) and there are uneven
illumination in the background of images.
Uneven illumination is mostly shown in the only one corner of the image as
yellow color.
Essentially i want to remove the uneven illumination of the images and so
later i can do color deconvolution on the background corrected images.
I have captured the image without any sample, and i call it brightfield in
here.
I divide the histological images by the brightfield and multiply the mean
of the brightfield and made a macro for this as below.
All the images are processed in RGB format, not in three separate channels.
Mostly the mean of the brightfield is around 252.

inputDir1 = getDirectory("Choose image");
outputDir = getDirectory ("Choose output");
fileList1 = getFileList(inputDir1);
for(i=0; i<fileList1.length; i++) { // repeat this process till the
filrList ends and increment by one
if (endsWith(fileList1[i], ".tif")) {
file1 = fileList1[i];
open(inputDir1 + file1);
id1= getImageID();
run("Image Sequence...", "open=[D:\\Histology_2013\\BG correction\\bright
field image\\brightfield.tif] number=1 starting=1 increment=1 scale=100
file=[] sort");//meake sure use the bright field image
id2= getImageID();
run("Select All");//measuring mean of bright field image
run("Measure");
meanvalue=getResult("Mean");
print(meanvalue);
run("Calculator Plus", "id1 id2 operation=[Divide: i2 = (i1/i2) x k1 + k2]
k1=meanvalue k2=0 create");//If i erase i1=file1 i2=[bright field image]
works the same
OutName = "corrected3_" + File.getName(file1); //resulting image is named
as "fused_filename1". Does not matter if _1 in the name because name needs
to be changed from anterior to positero in order later.
saveAs("tiff", outputDir + "/" + OutName);
close();
close();
close();
}
}

However, I can see the background of images seems bit better but still see
the uneven illumination in the background.
Is this because the mean of the brightfield is too close to white color?
I also tried the background subtraction using simply the histological
images minus brightfield using Image Calculator the but it does not remove
the uneven illumination.
How can i completely remove the uneven illumination?
Also another note, should i process images in RGB channels not in RGB?
I have tried to do the same image processing in RGB channels and later
those are composite to RGB, but the resulting image shows still the uneven
illumination.

I appreciate any suggestion.

Rui

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html