Search in sources :

Example 16 with Ops

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);
}
Also used : Ops(net.imagej.ops.Ops) OpInfo(net.imagej.ops.OpInfo) DoubleType(net.imglib2.type.numeric.real.DoubleType) ArrayList(java.util.ArrayList) Before(org.junit.Before)

Example 17 with Ops

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);
}
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

Ops (net.imagej.ops.Ops)17 UnaryComputerOp (net.imagej.ops.special.computer.UnaryComputerOp)8 BitType (net.imglib2.type.logic.BitType)8 DoubleType (net.imglib2.type.numeric.real.DoubleType)8 LocalThresholdMethod (net.imagej.ops.threshold.LocalThresholdMethod)5 Img (net.imglib2.img.Img)4 Test (org.junit.Test)4 AbstractOpTest (net.imagej.ops.AbstractOpTest)3 RandomAccessibleInterval (net.imglib2.RandomAccessibleInterval)3 ArrayList (java.util.ArrayList)2 MapNeighborhood (net.imagej.ops.map.neighborhood.MapNeighborhood)2 AbstractUnaryComputerOp (net.imagej.ops.special.computer.AbstractUnaryComputerOp)2 Interval (net.imglib2.Interval)2 ByteType (net.imglib2.type.numeric.integer.ByteType)2 Collections (java.util.Collections)1 Comparator (java.util.Comparator)1 List (java.util.List)1 Map (java.util.Map)1 PriorityQueue (java.util.PriorityQueue)1 Set (java.util.Set)1