use of net.imglib2.img.array.ArrayImgFactory in project imagej-ops by imagej.
the class AddDimensionViewTest method addDimensionMinMaxTest.
@Test
public void addDimensionMinMaxTest() {
Img<DoubleType> img = new ArrayImgFactory<DoubleType>().create(new int[] { 10, 10 }, new DoubleType());
int max = 20;
int min = 0;
IntervalView<DoubleType> il2 = Views.addDimension(img, min, max);
IntervalView<DoubleType> opr = ops.transform().addDimensionView(img, min, max);
assertEquals(il2.numDimensions(), opr.numDimensions(), 0.0);
for (int i = 0; i < il2.numDimensions(); i++) {
assertEquals(il2.dimension(i), opr.dimension(i), 0.0);
}
}
use of net.imglib2.img.array.ArrayImgFactory in project imagej-ops by imagej.
the class CollapseNumericViewTest method defaultCollapseNumericTest.
@Test
public void defaultCollapseNumericTest() {
Img<NativeARGBDoubleType> img = new ArrayImgFactory<NativeARGBDoubleType>().create(new int[] { 10, 10 }, new NativeARGBDoubleType());
CompositeIntervalView<NativeARGBDoubleType, NumericComposite<NativeARGBDoubleType>> il2 = Views.collapseNumeric((RandomAccessibleInterval<NativeARGBDoubleType>) img);
CompositeIntervalView<NativeARGBDoubleType, NumericComposite<NativeARGBDoubleType>> opr = ops.transform().collapseNumericView((RandomAccessibleInterval<NativeARGBDoubleType>) img);
assertEquals(il2.numDimensions(), opr.numDimensions());
CompositeView<NativeARGBDoubleType, NumericComposite<NativeARGBDoubleType>> il2_2 = Views.collapseNumeric((RandomAccessible<NativeARGBDoubleType>) img, 1);
CompositeView<NativeARGBDoubleType, NumericComposite<NativeARGBDoubleType>> opr_2 = ops.transform().collapseNumericView((RandomAccessible<NativeARGBDoubleType>) img, 1);
assertEquals(il2_2.numDimensions(), opr_2.numDimensions());
}
use of net.imglib2.img.array.ArrayImgFactory in project imagej-ops by imagej.
the class CollapseRealViewTest method defaultCollapseRealTest.
@Test
public void defaultCollapseRealTest() {
Img<DoubleType> img = new ArrayImgFactory<DoubleType>().create(new int[] { 10, 10 }, new DoubleType());
CompositeIntervalView<DoubleType, RealComposite<DoubleType>> il2 = Views.collapseReal((RandomAccessibleInterval<DoubleType>) img);
CompositeIntervalView<DoubleType, RealComposite<DoubleType>> opr = ops.transform().collapseRealView((RandomAccessibleInterval<DoubleType>) img);
assertEquals(il2.numDimensions(), opr.numDimensions());
CompositeView<DoubleType, RealComposite<DoubleType>> il2_2 = Views.collapseReal((RandomAccessible<DoubleType>) img, 1);
CompositeView<DoubleType, RealComposite<DoubleType>> opr_2 = ops.transform().collapseRealView((RandomAccessible<DoubleType>) img, 1);
assertEquals(il2_2.numDimensions(), opr_2.numDimensions());
}
use of net.imglib2.img.array.ArrayImgFactory 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());
}
use of net.imglib2.img.array.ArrayImgFactory 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());
}
Aggregations