use of net.imagej.ops.Ops in project imagej-ops by imagej.
the class CachedOpEnvironmentTest method initCustomOps.
@Before
public void initCustomOps() {
final ArrayList<OpInfo> customOps = new ArrayList<>();
customOps.add(new OpInfo(MyMin.class));
customOps.add(new OpInfo(MyOptionalParameterOp.class));
env = new CachedOpEnvironment(ops, customOps);
imgA = generateByteArrayTestImg(true, new long[] { 10, 10 });
imgB = generateByteArrayTestImg(true, new long[] { 10, 10 });
func = Functions.unary(env, Ops.Stats.Min.class, DoubleType.class, imgA);
hybrid = Hybrids.unaryCF(env, Ops.Stats.Min.class, DoubleType.class, imgA);
}
use of net.imagej.ops.Ops in project imagej-ops by imagej.
the class DefaultPearsonsTest method testPValue.
@Test
public void testPValue() {
final double mean = 0.2;
final double spread = 0.1;
final double[] sigma = new double[] { 3.0, 3.0 };
Img<FloatType> ch1 = ColocalisationTest.produceMeanBasedNoiseImage(new FloatType(), 24, 24, mean, spread, sigma, 0x01234567);
Img<FloatType> ch2 = ColocalisationTest.produceMeanBasedNoiseImage(new FloatType(), 24, 24, mean, spread, sigma, 0x98765432);
BinaryFunctionOp<RandomAccessibleInterval<FloatType>, RandomAccessibleInterval<FloatType>, Double> op = Functions.binary(ops, Ops.Coloc.Pearsons.class, Double.class, ch1, ch2);
PValueResult value = (PValueResult) ops.run(Ops.Coloc.PValue.class, new PValueResult(), ch1, ch2, op);
assertEquals(0.724, value.getPValue(), 0.0);
}
Aggregations