Search in sources :

Example 91 with DoubleType

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

the class CollapseViewTest method collapseRATest.

@Test
public void collapseRATest() {
    Img<DoubleType> img = new ArrayImgFactory<DoubleType>().create(new int[] { 10, 10, 10 }, new DoubleType());
    CompositeView<DoubleType, ? extends GenericComposite<DoubleType>> il2 = Views.collapse((RandomAccessible<DoubleType>) img);
    CompositeView<DoubleType, ? extends GenericComposite<DoubleType>> opr = ops.transform().collapseView((RandomAccessible<DoubleType>) img);
    assertEquals(il2.numDimensions(), opr.numDimensions());
}
Also used : DoubleType(net.imglib2.type.numeric.real.DoubleType) AbstractOpTest(net.imagej.ops.AbstractOpTest) Test(org.junit.Test)

Example 92 with DoubleType

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

the class CollapseViewTest method collapseRAITest.

@Test
public void collapseRAITest() {
    Img<DoubleType> img = new ArrayImgFactory<DoubleType>().create(new int[] { 10, 10, 10 }, new DoubleType());
    CompositeIntervalView<DoubleType, ? extends GenericComposite<DoubleType>> il2 = Views.collapse((RandomAccessibleInterval<DoubleType>) img);
    CompositeIntervalView<DoubleType, ? extends GenericComposite<DoubleType>> opr = ops.transform().collapseView((RandomAccessibleInterval<DoubleType>) img);
    assertEquals(il2.numDimensions(), opr.numDimensions());
}
Also used : DoubleType(net.imglib2.type.numeric.real.DoubleType) AbstractOpTest(net.imagej.ops.AbstractOpTest) Test(org.junit.Test)

Example 93 with DoubleType

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

the class DropSingletonDimensionsViewTest method dropSingletonDimensionsTest.

@Test
public void dropSingletonDimensionsTest() {
    Img<DoubleType> img = new ArrayImgFactory<DoubleType>().create(new int[] { 10, 1, 10 }, new DoubleType());
    RandomAccessibleInterval<DoubleType> il2 = Views.dropSingletonDimensions(img);
    RandomAccessibleInterval<DoubleType> opr = ops.transform().dropSingletonDimensionsView(img);
    assertEquals(il2.numDimensions(), opr.numDimensions());
}
Also used : DoubleType(net.imglib2.type.numeric.real.DoubleType) AbstractOpTest(net.imagej.ops.AbstractOpTest) Test(org.junit.Test)

Example 94 with DoubleType

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

the class ExtendBorderViewTest method extendBorderTest.

@Test
public void extendBorderTest() {
    Img<DoubleType> img = new ArrayImgFactory<DoubleType>().create(new int[] { 10, 10 }, new DoubleType());
    OutOfBounds<DoubleType> il2 = Views.extendBorder(img).randomAccess();
    OutOfBounds<DoubleType> opr = ops.transform().extendBorderView(img).randomAccess();
    il2.setPosition(new int[] { -1, -1 });
    opr.setPosition(new int[] { -1, -1 });
    assertEquals(il2.get().get(), opr.get().get(), 1e-10);
    il2.setPosition(new int[] { 11, 11 });
    opr.setPosition(new int[] { 11, 11 });
    assertEquals(il2.get().get(), opr.get().get(), 1e-10);
}
Also used : DoubleType(net.imglib2.type.numeric.real.DoubleType) AbstractOpTest(net.imagej.ops.AbstractOpTest) Test(org.junit.Test)

Example 95 with DoubleType

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

the class ExtendMirrorDoubleViewTest method extendMirrorDoubleTest.

@Test
public void extendMirrorDoubleTest() {
    Img<DoubleType> img = new ArrayImgFactory<DoubleType>().create(new int[] { 10, 10 }, new DoubleType());
    OutOfBounds<DoubleType> il2 = Views.extendMirrorDouble(img).randomAccess();
    OutOfBounds<DoubleType> opr = ops.transform().extendMirrorDoubleView(img).randomAccess();
    il2.setPosition(new int[] { -1, -1 });
    opr.setPosition(new int[] { -1, -1 });
    assertEquals(il2.get().get(), opr.get().get(), 1e-10);
    il2.setPosition(new int[] { 11, 11 });
    opr.setPosition(new int[] { 11, 11 });
    assertEquals(il2.get().get(), opr.get().get(), 1e-10);
}
Also used : DoubleType(net.imglib2.type.numeric.real.DoubleType) AbstractOpTest(net.imagej.ops.AbstractOpTest) Test(org.junit.Test)

Aggregations

DoubleType (net.imglib2.type.numeric.real.DoubleType)142 Test (org.junit.Test)114 AbstractOpTest (net.imagej.ops.AbstractOpTest)104 LongType (net.imglib2.type.numeric.integer.LongType)37 Random (java.util.Random)19 Img (net.imglib2.img.Img)9 FinalInterval (net.imglib2.FinalInterval)8 ArrayList (java.util.ArrayList)7 Ops (net.imagej.ops.Ops)7 BitType (net.imglib2.type.logic.BitType)7 UnaryComputerOp (net.imagej.ops.special.computer.UnaryComputerOp)6 RandomAccessibleInterval (net.imglib2.RandomAccessibleInterval)6 RealLocalizable (net.imglib2.RealLocalizable)6 LocalThresholdMethod (net.imagej.ops.threshold.LocalThresholdMethod)5 FinalDimensions (net.imglib2.FinalDimensions)5 CreateImgFromImg (net.imagej.ops.create.img.CreateImgFromImg)4 Dimensions (net.imglib2.Dimensions)4 UnsignedByteType (net.imglib2.type.numeric.integer.UnsignedByteType)4 Module (org.scijava.module.Module)4 CreateImgFromDimsAndType (net.imagej.ops.create.img.CreateImgFromDimsAndType)3