Login  Register

Re: Call maximum threshold?

Posted by Michael Schmid on Jun 03, 2015; 3:45pm
URL: http://imagej.273.s1.nabble.com/Call-maximum-threshold-tp5013025p5013027.html

Hi Sam,

Do you refer to the maximum pixel value in the image? This is what determines the maximum in the histogram of the Threshold panel.
You can get it with getStatistics:

  run("Select None");
  getStatistics(nPixels, mean, min, max);
  setThreshold(0.1*max, max);

Michael
________________________________________________________________
On Jun 3, 2015, at 17:23, moxed wrote:

> Hello, I'm writing a macro in the ijm language.
>
> I'd like to set the threshold of my image as 10% of the maximum and the
> maximum.
> Something like:
> setThreshold(0.1*max, max);
>
> However, I'd like imageJ to automatically detect the highest threshold of my
> image. I can't figure out how to get this information without setting it
> manually.  Any ideas?
>
> Thanks in advance!
> -Sam
>
>
>
>
> --
> View this message in context: http://imagej.1557.x6.nabble.com/Call-maximum-threshold-tp5013025.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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