imagej / ImageJ

Public domain software for processing and analyzing scientific images
http://imagej.org
Other
513 stars 218 forks source link

Strange value of constant ImageProcessor#NO_THRESHOLD #193

Closed imagingbook closed 1 year ago

imagingbook commented 1 year ago

It appears that this constant in ImageProcessor is initialized with a rather strange value:

public static final double NO_THRESHOLD = -808080.0;

By default, this value is returned by both ImageProcessor.getMinThreshold() and getMaxThreshold(), which does not seem intuitive. How about using Double.NaN instead?

rasband commented 1 year ago

I agree this is not intuitive but I can't switch to using Double.NaN without breaking existing plugins.

rasband commented 1 year ago

The ImageJ 1.54a25 daily build adds an ImageProcessor.isThreshold() method. There was already an ImagePlus.isThreshold() method.