Set color for IJ.run("Draw")

Posted by Christopher Coulon on
URL: http://imagej.273.s1.nabble.com/Set-color-for-IJ-run-Draw-tp3702957.html

Hi everyone,

I would like to draw a maximum dark border around my signed 16-bit image in
a plugin.  I tried:

>              StackStatistics stackStats = new StackStatistics(imp);
>             double stackMax = stackStats.max;
>             double threshFactor = 32768d;
>             double maxThresh = stackMax + threshFactor;
>             IJ.run("Select All");
>             IJ.runMacro("setColor("+maxThresh+");");
>             IJ.run("Draw");
>
but the resulting border is ­1034, not the maximum value of ­2048 that I am
trying to get.  It states clearly in the Built-in Macro Functions that
setColor(value) will not change the foreground color used by run(³Draw²),
but is there a way to do this?   Or is IJ.run(³Draw²) limited to 8-bit
images?  Thanks in advance.

Chris Coulon
       

The GAIA Group
Global Automated Image Analysis
http://www.gaiag.net
[hidden email]


We welcome image analysis problems in all fields.

Christopher Coulon, Ph.D., Founder