Re: Automatically define and set particular regions of "grey" to 255
Posted by
Nathaniel Ryckman on
May 17, 2011; 8:53pm
URL: http://imagej.273.s1.nabble.com/Automatically-define-and-set-particular-regions-of-grey-to-255-tp3684565p3684566.html
Emmanuel Levy wrote
Dear All,
I'm quite new to image processing. I feel the problem I face is quite
simple but I'm not sure about which direction to take, so any
suggestion would be highly appreciated.
Basically, in the image attached, I would like to set the background
regions (i.e., regions with no cell) to 255. One could easily do this
by hand using a "Magic Wand" for example, but I'm not sure which way
would be best in batch mode.
I guess the criteria that have to be met by those regions are:
- be larger than X pixels
- be a concav polygon
Any idea on how best to implement this in ImageJ?
Thanks,
Emmanuel
Oops! I thought you wanted to measure the background. You can then write a small macro to fill in the ROI's instead.
run("Colors...", "foreground=black background=red selection=red");
nROI = roiManager("Count");
for(i = 0; i < nROI; i++)
{
roiManager("Select", i);
run("Fill", "slice");
}
Again, unfortunately, I don't think there is a good method for what you are trying to do since the background matches the inside of the cells.....