package org.bonej.ops.thresholdFraction;

import net.imglib2.IterableInterval;
import net.imglib2.RandomAccessible;
import net.imglib2.RandomAccessibleInterval;
import net.imglib2.Sampler;
import net.imglib2.type.NativeType;
import net.imglib2.type.numeric.RealType;

/**
 * A helper class to pass threshold values as a single input. The thresholds fit a certain type of image.
 *
 * @author Richard Domander 
 */
public final class Thresholds<T extends RealType<T> & NativeType<T>> {
    public final T min;
    public final T max;

    /**
     * Constructor for Thresholds
     *
     * @param interval  Needed to determine the runtime type of the thresholds
     * @param min       Minimum value for elements within threshold
     * @param max       Maximum value for elements within threshold
     */
    public Thresholds(final RandomAccessible<T> interval, final double min, final double max) {

        final T element = interval.randomAccess().get();
        this.min = element.createVariable();
        this.min.setReal(min);
        this.max = element.createVariable();
        this.max.setReal(max);
    }

    /**
     * Constructor for Thresholds
     *
     * @param min       Minimum value for elements within threshold
     * @param max       Maximum value for elements within threshold
     */
    public Thresholds(final T min, final T max) {
        this.min = min;
        this.max = max;
    }
}

@@ -58,134 +58,24 @@
 ib2.
-IterableInterval;%0Aimport net.imglib2.RandomAccessible;%0Aimport net.imglib2.RandomAccessibleInterval;%0Aimport net.imglib2.Sampler
+RandomAccessible
 ;%0Aim
@@ -1004,305 +1004,7 @@
    %7D
-%0A%0A    /**%0A     * Constructor for Thresholds%0A     *%0A     * @param min       Minimum value for elements within threshold%0A     * @param max       Maximum value for elements within threshold%0A     */%0A    public Thresholds(final T min, final T max) %7B%0A        this.min = min;%0A        this.max = max;%0A    %7D
 %0A%7D%0A

Clean up code