package imagej.data.autoscale;

import static org.junit.Assert.assertTrue;
import net.imglib2.img.Img;
import net.imglib2.img.array.ArrayImgs;
import net.imglib2.ops.util.Tuple2;
import net.imglib2.type.numeric.RealType;
import net.imglib2.type.numeric.integer.ByteType;

import org.junit.Test;
import org.scijava.Context;


public class ConfidenceIntervalAutoscaleMethodTest {

	Context context = new Context(AutoscaleService.class);

	@Test
	public void test() {
		AutoscaleService service = context.getService(AutoscaleService.class);
		AutoscaleMethod method = service.getAutoscaleMethod("95% CI");
		Img<RealType> img = getImg();
		Tuple2<Double, Double> range = method.getRange(img);
		System.out.println(range.get1());
		System.out.println(range.get2());
		assertTrue(true);
	}

	private Img<RealType> getImg() {
		Img<ByteType> img = ArrayImgs.bytes(100);
		byte i = 0;
		for (ByteType b : img)
			b.set(i++);
		return (Img<RealType>) (Img) img;
	}
}

@@ -62,20 +62,22 @@
 t.assert
-True
+Equals
 ;%0Aimport
@@ -683,24 +683,27 @@
 nge(img);%0A%09%09
+// 
 System.out.p
@@ -726,16 +726,19 @@
 1());%0A%09%09
+// 
 System.o
@@ -775,17 +775,70 @@
 sert
-True(true
+Equals(2, range.get1(), 0);%0A%09%09assertEquals(97, range.get2(), 0
 );%0A%09

Improve confidence interval test code