Call maximum threshold?

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

Call maximum threshold?

moxed
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
Reply | Threaded
Open this post in threaded view
|

Re: Call maximum threshold?

Michael Schmid
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