Re: setAutoThreshold()
Posted by
Wayne Rasband on
Jul 08, 2009; 9:35pm
URL: http://imagej.273.s1.nabble.com/setAutoThreshold-tp3691833p3691834.html
On Jul 7, 2009, at 2:42 PM, Pang, Zhengyu (GE, Research) wrote:
> Dear all,
>
> How do I use setAutoThreshold() to select a region from a thresholded
> value to the maximum, or sometimes I need to use setAutoThreshold() to
> select a region from minimum value to the thresholded value (i.e. The
> ability to choose Lower half or upper half)?
>
> There is an option to check Dark background for threshold window. Is
> there anyway that I could take advantage of this and put it into the
> macro?
Use the version of setAutoThreshold() that takes a string argument. As
an example, this macro
setAutoThreshold("MaxEntropy dark");
uses the MaxEntropy method, with Dark Background enabled, to set the
threshold. There is a example macro at
http://rsb.info.nih.gov/ij/macros/examples/AutoThresholdingDemo.txtthat uses all 16 available methods to threshold the M51 Galaxy sample
image.
-wayne