automatically filling 8bit objects

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

automatically filling 8bit objects

Meesters, Erik
Hello, I'm quite new to imageJ, but like a lot of what I'm seeing. I've been trying to automatically determine the area of a number of objects that have been outlined in photoshop with different gray values (8bit). Each gray value denotes a certain species. When I import the tiff into ImageJ I can outline all objects and determine their surface area, perimeter, etc.

However, the objects are non-filled, but only surrounded by a line and I'd like to also fill them automatically with the gray value of the surrounding line.

Later on, I'd like to also swap the gray values with fixed colours.

I'm not sure this is possible in ImageJ, but I see so many different macros/plugins/etc that I can't imagine it's not.

Is anybody able to give me some guidance here? Thanks for any help.

Cheers,
Erik


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: automatically filling 8bit objects

Michael Schmid
Hi Erik,

the wand tool of ImageJ (8th tool in the toolbar) automatically selects the interior, even if only the outline is given. Use '8-connected' mode for lines where pixels touch each other only at corner points (double-click the wand tool).

With the wand, you can click directly on the line and it should select all contiguous pixels with the same gray value, plus the interior.

You can also threshold the image so that only the line is red (upper limit=lower limit). Then you can also click somewhere left of the object or into the interior; the wand will automatically find the thresholded object.

If you have the selection, select the foreground color (eyedropper tool) and use Edit>Fill

Converting grayscale to colors: probably the easiest is editing the lookup table, so certain shades of gray become colors of your choice.

This makes sense only if there are no other object of the same gray level.  Otherwise, use the ROI manager, use More>>OR (combine) and Edit>Selection>Create Mask.  Then run 'Analyze particles' with 'count mask' as output, and edit the color lookup table as you like.  Threshold the count mask from 1 to 255, Edit>Selection>create selection, convert to RGB and copy.  Then take the original image, convert to RGB, Edit>Selction>Restore Selection and paste.

Michael
________________________________________________________________
On Oct 31, 2013, at 14:51, Meesters, Erik wrote:

> Hello, I'm quite new to imageJ, but like a lot of what I'm seeing. I've been trying to automatically determine the area of a number of objects that have been outlined in photoshop with different gray values (8bit). Each gray value denotes a certain species. When I import the tiff into ImageJ I can outline all objects and determine their surface area, perimeter, etc.
>
> However, the objects are non-filled, but only surrounded by a line and I'd like to also fill them automatically with the gray value of the surrounding line.
>
> Later on, I'd like to also swap the gray values with fixed colours.
>
> I'm not sure this is possible in ImageJ, but I see so many different macros/plugins/etc that I can't imagine it's not.
>
> Is anybody able to give me some guidance here? Thanks for any help.
>
> Cheers,
> Erik

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: automatically filling 8bit objects

Gabriel Landini
If you have a set of "rings" drawn with different greyscale values in an 8 bit
image and on a black background, you can fill them in the border colour using
the "Fill_Greyscale_Holes" macro in the Morphology collection here
http://www.dentistry.bham.ac.uk/landinig/software/software.html

RGB images with "flat" colours will also work.

The file you need is this one:
http://www.dentistry.bham.ac.uk/landinig/software/morphology.zip

and that will contains the Morphology folder with quite a few plugins. Copy
that to the Plugins and restart IJ.
Cheers
Gabriel

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