Re: Check for post-threshold binary image
Posted by Gabriel Landini on Apr 14, 2009; 2:58pm
URL: http://imagej.273.s1.nabble.com/Check-for-post-threshold-binary-image-tp3692956p3692959.html
On Tuesday 14 April 2009, Michael Doube wrote:
> Thanks everyone for your very quick responses.
> Looks like I just have to use Gabriel's 'histogram method' and remember
> to account for the signed<->unsigned byte issue.
I am sure I must have pinched it from somewhere else (most likely from the IJ
code).
It is quite handy, though, because it can be easily implemented in a macro
too:
getHistogram(values, counts, 256);
for (i=1;i<255;i++) total+=counts[i];
if (total>0) exit("8-bit binary image (0 and 255) required.");
Cheers,
G.