Search in sources :

Example 1 with PValueResult

use of net.imagej.ops.coloc.pValue.PValueResult in project imagej-ops by imagej.

the class LiICQTest method testPValue.

/**
 * Checks calculated pValue for Li's ICQ.
 */
@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, LiICQ.class, Double.class, ch1, ch2);
    PValueResult value = (PValueResult) ops.run(DefaultPValue.class, new PValueResult(), ch1, ch2, op);
    assertEquals(0.786, value.getPValue(), 0.0);
}
Also used : PValueResult(net.imagej.ops.coloc.pValue.PValueResult) RandomAccessibleInterval(net.imglib2.RandomAccessibleInterval) DefaultPValue(net.imagej.ops.coloc.pValue.DefaultPValue) FloatType(net.imglib2.type.numeric.real.FloatType) ColocalisationTest(net.imagej.ops.coloc.ColocalisationTest) Test(org.junit.Test)

Example 2 with PValueResult

use of net.imagej.ops.coloc.pValue.PValueResult in project imagej-ops by imagej.

the class KendallTauBRankTest 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, KendallTauBRank.class, Double.class, ch1, ch2);
    PValueResult value = (PValueResult) ops.run(DefaultPValue.class, new PValueResult(), ch1, ch2, op);
    assertEquals(0.813, value.getPValue(), 0.0);
}
Also used : PValueResult(net.imagej.ops.coloc.pValue.PValueResult) RandomAccessibleInterval(net.imglib2.RandomAccessibleInterval) DefaultPValue(net.imagej.ops.coloc.pValue.DefaultPValue) FloatType(net.imglib2.type.numeric.real.FloatType) AbstractOpTest(net.imagej.ops.AbstractOpTest) Test(org.junit.Test) ColocalisationTest(net.imagej.ops.coloc.ColocalisationTest)

Example 3 with PValueResult

use of net.imagej.ops.coloc.pValue.PValueResult 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);
}
Also used : PValueResult(net.imagej.ops.coloc.pValue.PValueResult) Ops(net.imagej.ops.Ops) RandomAccessibleInterval(net.imglib2.RandomAccessibleInterval) FloatType(net.imglib2.type.numeric.real.FloatType) ColocalisationTest(net.imagej.ops.coloc.ColocalisationTest) Test(org.junit.Test)

Aggregations

ColocalisationTest (net.imagej.ops.coloc.ColocalisationTest)3 PValueResult (net.imagej.ops.coloc.pValue.PValueResult)3 RandomAccessibleInterval (net.imglib2.RandomAccessibleInterval)3 FloatType (net.imglib2.type.numeric.real.FloatType)3 Test (org.junit.Test)3 DefaultPValue (net.imagej.ops.coloc.pValue.DefaultPValue)2 AbstractOpTest (net.imagej.ops.AbstractOpTest)1 Ops (net.imagej.ops.Ops)1