本文整理汇总了Java中net.imglib2.view.Views.rotate方法的典型用法代码示例。如果您正苦于以下问题:Java Views.rotate方法的具体用法?Java Views.rotate怎么用?Java Views.rotate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.imglib2.view.Views
的用法示例。
在下文中一共展示了Views.rotate方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testIntervalRotate
import net.imglib2.view.Views; //导入方法依赖的package包/类
@Test
public void testIntervalRotate() {
final Img<DoubleType> img = ArrayImgs.doubles(20,10);
final IntervalView<DoubleType> il2 = Views.rotate((RandomAccessibleInterval<DoubleType>) img, 1, 0);
final IntervalView<DoubleType> opr = (IntervalView<DoubleType>) ops.transform().rotateView((RandomAccessibleInterval<DoubleType>) img, 1, 0);
for (int i = 0; i < ((MixedTransformView<DoubleType>) il2.getSource()).getTransformToSource()
.getMatrix().length; i++) {
for (int j = 0; j < ((MixedTransformView<DoubleType>) il2.getSource()).getTransformToSource()
.getMatrix()[i].length; j++) {
assertEquals(
((MixedTransformView<DoubleType>) il2.getSource()).getTransformToSource().getMatrix()[i][j],
((MixedTransformView<DoubleType>) opr.getSource()).getTransformToSource().getMatrix()[i][j],
1e-10);
}
}
}
示例2: testIntervalRotateInterval
import net.imglib2.view.Views; //导入方法依赖的package包/类
@Test
public void testIntervalRotateInterval() {
final Img<DoubleType> img = new ArrayImgFactory<DoubleType>().create(new int[] { 20, 10 }, new DoubleType());
final IntervalView<DoubleType> il2 = Views.rotate((RandomAccessibleInterval<DoubleType>) img, 1, 0);
final IntervalView<DoubleType> opr = ops.transform().rotateView((RandomAccessibleInterval<DoubleType>) img, 1, 0);
assertEquals(img.min(1), il2.min(0));
assertEquals(img.max(1), il2.max(0));
assertEquals(img.min(0), -il2.max(1));
assertEquals(img.max(0), -il2.min(1));
for (int i = 0; i < il2.numDimensions(); i++) {
assertEquals(il2.max(i), opr.max(i));
assertEquals(il2.min(i), opr.min(i));
}
}
示例3: process
import net.imglib2.view.Views; //导入方法依赖的package包/类
static private final <R extends RealType<R>> IntervalView<R> process(final Img<R> img, final Mode mode) {
IntervalView<R> iv;
if (Mode.R90 == mode) {
iv = Views.rotate(img, 0, 1);
} else if (Mode.R270 == mode) {
iv = Views.rotate(img, 1, 0);
} else if (Mode.R180 == mode) {
iv = Views.rotate(Views.rotate(img, 0, 1), 0, 1);
} else {
throw new IllegalArgumentException("Invalid Mode: " + mode);
}
return Views.zeroMin(iv);
}
示例4: testDefaultRotate
import net.imglib2.view.Views; //导入方法依赖的package包/类
@Test
public void testDefaultRotate() {
final Img<DoubleType> img = new ArrayImgFactory<DoubleType>().create(new int[] { 20, 10 }, new DoubleType());
final MixedTransformView<DoubleType> il2 = Views.rotate((RandomAccessible<DoubleType>) img, 1, 0);
final MixedTransformView<DoubleType> opr = ops.transform().rotateView(deinterval(img), 1, 0);
for (int i = 0; i < il2.getTransformToSource().getMatrix().length; i++) {
for (int j = 0; j < il2.getTransformToSource().getMatrix()[i].length; j++) {
assertEquals(il2.getTransformToSource().getMatrix()[i][j], opr.getTransformToSource().getMatrix()[i][j],
1e-10);
}
}
}
示例5: calculate
import net.imglib2.view.Views; //导入方法依赖的package包/类
@Override
public IntervalView<T> calculate(RandomAccessibleInterval<T> input) {
return Views.rotate(input, fromAxis, toAxis);
}
示例6: calculate
import net.imglib2.view.Views; //导入方法依赖的package包/类
@Override
public MixedTransformView<T> calculate(RandomAccessible<T> input) {
return Views.rotate(input, fromAxis, toAxis);
}