Search in sources :

Example 36 with DoubleType

use of net.imglib2.type.numeric.real.DoubleType in project imagej-ops by imagej.

the class UnaryRealTypeMathTest method testArccosh.

@Test
public void testArccosh() {
    final LongType in = new LongType(1234567890);
    final DoubleType out = new DoubleType();
    ops.run(Arccosh.class, out, in);
    final double delta = Math.sqrt(1234567890.0 * 1234567890.0 - 1);
    assertEquals(out.get(), Math.log(1234567890 + delta), 0.0);
}
Also used : LongType(net.imglib2.type.numeric.integer.LongType) DoubleType(net.imglib2.type.numeric.real.DoubleType) AbstractOpTest(net.imagej.ops.AbstractOpTest) Test(org.junit.Test)

Example 37 with DoubleType

use of net.imglib2.type.numeric.real.DoubleType in project imagej-ops by imagej.

the class UnaryRealTypeMathTest method testStep.

@Test
public void testStep() {
    final LongType in = new LongType(1234567890);
    final DoubleType out = new DoubleType();
    ops.run(Step.class, out, in);
    assertEquals(out.get(), 1.0, 0.0);
}
Also used : LongType(net.imglib2.type.numeric.integer.LongType) DoubleType(net.imglib2.type.numeric.real.DoubleType) AbstractOpTest(net.imagej.ops.AbstractOpTest) Test(org.junit.Test)

Example 38 with DoubleType

use of net.imglib2.type.numeric.real.DoubleType in project imagej-ops by imagej.

the class UnaryRealTypeMathTest method testSin.

@Test
public void testSin() {
    final LongType in = new LongType(1234567890);
    final DoubleType out = new DoubleType();
    ops.run(Sin.class, out, in);
    assertEquals(out.get(), Math.sin(1234567890), 0.0);
}
Also used : LongType(net.imglib2.type.numeric.integer.LongType) DoubleType(net.imglib2.type.numeric.real.DoubleType) AbstractOpTest(net.imagej.ops.AbstractOpTest) Test(org.junit.Test)

Example 39 with DoubleType

use of net.imglib2.type.numeric.real.DoubleType in project imagej-ops by imagej.

the class UnaryRealTypeMathTest method testLog10.

@Test
public void testLog10() {
    final LongType in = new LongType(1234567890);
    final DoubleType out = new DoubleType();
    ops.run(Log10.class, out, in);
    assertEquals(out.get(), Math.log10(1234567890), 0.0);
}
Also used : LongType(net.imglib2.type.numeric.integer.LongType) DoubleType(net.imglib2.type.numeric.real.DoubleType) AbstractOpTest(net.imagej.ops.AbstractOpTest) Test(org.junit.Test)

Example 40 with DoubleType

use of net.imglib2.type.numeric.real.DoubleType in project imagej-ops by imagej.

the class UnaryRealTypeMathTest method testSincPi.

@Test
public void testSincPi() {
    final LongType in = new LongType(1234567890);
    final DoubleType out = new DoubleType();
    ops.run(SincPi.class, out, in);
    final double PI = Math.PI;
    assertEquals(out.get(), Math.sin(PI * 1234567890) / (PI * 1234567890), 0.0);
}
Also used : LongType(net.imglib2.type.numeric.integer.LongType) DoubleType(net.imglib2.type.numeric.real.DoubleType) AbstractOpTest(net.imagej.ops.AbstractOpTest) Test(org.junit.Test)

Aggregations

DoubleType (net.imglib2.type.numeric.real.DoubleType)185 Test (org.junit.Test)123 AbstractOpTest (net.imagej.ops.AbstractOpTest)111 LongType (net.imglib2.type.numeric.integer.LongType)37 MersenneTwisterFast (org.scijava.util.MersenneTwisterFast)19 ArrayList (java.util.ArrayList)14 Dataset (net.imagej.Dataset)14 RandomAccessibleInterval (net.imglib2.RandomAccessibleInterval)13 Img (net.imglib2.img.Img)10 PointSet (net.imglib2.ops.pointset.PointSet)10 Ops (net.imagej.ops.Ops)9 HyperVolumePointSet (net.imglib2.ops.pointset.HyperVolumePointSet)9 Overlay (net.imagej.overlay.Overlay)8 FinalDimensions (net.imglib2.FinalDimensions)8 FinalInterval (net.imglib2.FinalInterval)8 BitType (net.imglib2.type.logic.BitType)8 DatasetView (net.imagej.display.DatasetView)7 Dimensions (net.imglib2.Dimensions)7 UnsignedByteType (net.imglib2.type.numeric.integer.UnsignedByteType)7 RealLocalizable (net.imglib2.RealLocalizable)6