Login  Register

Re: Automatically define and set particular regions of "grey" to 255

Posted by Crowell Elizabeth on May 17, 2011; 9:41am
URL: http://imagej.273.s1.nabble.com/Automatically-define-and-set-particular-regions-of-grey-to-255-tp3684565p3684568.html

Hello Emmanuel,

I tried to send this message a minute ago, and apparently there was a
bug and it doesn't seem to have gone through!

If I understand what you are trying to do, I think the Image Math
function might be a good way to accomplish this.
Go to Process/Math/Macro... and enter the following expression:
if((v<10)) v=255;
This will have the effect of setting every pixel whose value is less
than 10 to the value of 255.

Of course, this method will also change the pixel values inside your
circular objects (looks like budding yeast!), since they are
indistinguishable from the background by their pixel values.
However, by thresholding and converting to binary, you can use
Process/Binary/Fill Holes to remove the dark spaces inside your objects
and segment them separately.

In any case, you probably need to do some mild background subtraction or
smoothing to improve your image before doing any segmentation.  There
are a few background pixels with higher values (probably noise) - this
problem can be eliminated by applying a Gaussian blur of 0.5 pixel
radius, for example (Process/Filters/Gaussian blur...).

In order to incorporate this kind of processing in a macro to run on a
series of images in batch mode, you can simply record the actions to
retrieve the code (Plugins/Macros/Record...).

Does this answer your question?

Kind Regards,
Elizabeth Crowell



Emmanuel Levy a écrit :

> 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
>  
>
> ------------------------------------------------------------------------
>
>


--

Elizabeth CROWELL

----------------------------------------------------------------------
Membrane Traffic and Cell Division Research Group
Institut Pasteur
28 rue du Dr Roux
75015 PARIS, France

Tel :  01.44.38.94.07
Fax : 01.45.68.89.54
----------------------------------------------------------------------