Login  Register

Re: Using API to create mask with multiple rectangles

Posted by Gabriel Landini on Nov 19, 2007; 9:55pm
URL: http://imagej.273.s1.nabble.com/Using-API-to-create-mask-with-multiple-rectangles-tp3697968p3697974.html

On Monday 19 November 2007 21:23:32 Leonard Sitongia wrote:
> I don't follow this.  I don't understand what the mask is in ImageJ.  I
> see that irregular ROIs produce a mask, but I'm not sure what it is.  I
> think it is what I want, the mask representing my multiple rectangles,
> but I'm not sure.

If you do not mind running a macro rather than a plugin, there is a simple way
to do this:
Take your image and find the width and height,
Create a new empty (background) image
Draw or define the rectangular ROIs and fill them with the foreground colour.
Now run the Particles8_Plus plugin on the binary image and redirect to the
original greyscale or RGB. (you can do this I think with the
Particle_Analyzer pluigin too).

The Results Table will contain now the statistics of the ROIs of the binary
image but using the greyscale values of the original.

I hope it helps.

G.