help please

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

help please

Lee Berndt
Hi....I've written a macro to do basically what I want....it involves using the color threshold plugin....basically I open an image and run the color threshold plugin and then manually set the min and max hue, saturation, and brightness using the sliders....this involves a lot of clicking with the mouse....my question is as follows: is there a piece of code I can use to set these values using the macro I created?....for example code involving minHue and maxHue....minBrite, etc?....if I run the macro button once I set the proper values it spits out a lengthy macro that is useless to me....all I want to do is have a simple piece of code that will set the values for me....any help would be appreciated....thank you....  
 

William L. Berndt, Ph.D.
239.246.0396
 
 

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

Re: help please

Gabriel Landini
On Monday 02 Mar 2015 21:58:03 Lee Berndt wrote:

> Hi....I've written a macro to do basically what I want....it involves using
> the color threshold plugin....basically I open an image and run the color
> threshold plugin and then manually set the min and max hue, saturation, and
> brightness using the sliders....this involves a lot of clicking with the
> mouse....my question is as follows: is there a piece of code I can use to
> set these values using the macro I created?....for example code involving
> minHue and maxHue....minBrite, etc?....if I run the macro button once I set
> the proper values it spits out a lengthy macro that is useless to me....all
> I want to do is have a simple piece of code that will set the values for
> me....any help would be appreciated....thank you....

I would not like to think it is useless (but I might be biased, since I wrote
that macro generating routine).
That lengthy macro is what you need to do by hand to end up with a binary
image selection outside the plugin. Currently there are no global values
stored anywhere for the selected colour space and its parameters (what you set
with the plugin). Those are local to the plugin instance while it is running
and applied to only to the current image. I am afraid that you will need to
use that macro and modify it if you want to create a macro that just sets the
values.

So while setting the sliders and not thresholding was not the purpose of that
plugin, once the macro creates a binary image (which is what a thresholding
process should do), you could transfer the corresponding selections of the
ROIs to the original colour image, do a Create Selection on the binary image
and then Restore Selection in the original (so you will need to keep a
duplicate of the original open before the macro is run).

If instead you want to create an image where the binary white is the original
in colour, then you can use the AND operation between the original and the RGB
version of the binarised result.

Cheers

Gabriel

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