I have a 8bit b/w 512x512 image of tissue slide specimen.
The tissue spans all the way across the middle of the section, and is gray.
I am working on a macro to fill the image with a series of black lines so that below the tissue (largely noise) there is black. The tissue spans across the middle of the section, and is gray. Magic Wand and Versatile Magic Wand do not help.
So I want to choose a threshold value of gray, let's call it 80.
Then for each vertical line selection of the image my search program starts at the bottom evaluating each pixel and once it finds this gray value, it fills the rest of the x,y values of line i with black, 0
The idea is each x line on the slide, is evaluated from the bottom for when it turns >=threshold gray, and when it is found, it is filled black to the bottom on the same x line.
So it might something like :
Threshold = 80; //fill a line with 0s, when a point above
for (i=0; i<512; i++) {
for(j=0; j<512; j++); { // start at the bottom edge
if (image(i,j ) >= Threshold){
run("Specify...", "width=1 height=j x=i y=0");// specify line part to fill black below this value
run("Fill", "slice");}
}
}
Will this work?
How do I evaluate the gray value of a pixel?
Ethan Cohen, Ph.D.
Div of Biomedical Physics,
Office of Science and Engineering Labs,
FDA Center for Devices and Radiological Health
White Oak Federal Res Ctr.
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html