@Override public double runThresholder(ImageHandler input, InputImages images) { double thld1 = threshold1.getThreshold(input, images, nbCPUs, debug); double thld2 = threshold2.getThreshold(input, images, nbCPUs, debug); if (debug) ij.IJ.log("thld1:" + thld1 + " thld2:" + thld2); if (operation.getSelectedItem().equals(methods[0])) { return Math.max(thld2, thld1); } else if (operation.getSelectedItem().equals(methods[1])) { return Math.min(thld2, thld1); } else if (operation.getSelectedItem().equals(methods[1])) { double coeffd = coeff.getDoubleValue(0.5d); return thld1 * (1 - coeffd) + thld2 * coeffd; } else return thld1; }