Login  Register

Re: IJ Color Thresholding in Macro

Posted by Gabriel Landini on Dec 03, 2014; 6:50pm
URL: http://imagej.273.s1.nabble.com/IJ-Color-Thresholding-in-Macro-tp5010727p5010749.html

On Wednesday 03 Dec 2014 09:48:14 you wrote:
> Ok, when you say choose the 2 images, you mean the original image & the
> result image after macro has run? Thanks Gabriel, I really appreciate you
> taking the time to help me out. Steve

Yes that is right.
Actually I forgot that the macro version creates an 8 bit image (and the
interactive mode does not), so you should choose the original (open it again)
as image 1 and the binary result as image 2.

Let's suppose you open the clown,jpg image.
If you run the macro generated by the colour thresholder, then the binary
image (8bit) is still named  clown.jpg.
Now you open again the colour image (or duplicated before applying the macro)
so now the colour image is named clown-1.jpg.

The image calculator operation should be:
imageCalculator("AND create", "clown-1.jpg","clown.jpg");

That is the colour image (clown-1.jpg) has to be the first one as this set the
image type (RGB) of the result.

Alternative if the binary result is converted to RGB (still looks as B/W) then
the order of the images in the Image Calculator does not matter as they are
both RGB.

Cheers

Gabriel

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