本文整理汇总了Java中net.imglib2.view.Views.subsample方法的典型用法代码示例。如果您正苦于以下问题:Java Views.subsample方法的具体用法?Java Views.subsample怎么用?Java Views.subsample使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.imglib2.view.Views
的用法示例。
在下文中一共展示了Views.subsample方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: defaultSubsampleTest
import net.imglib2.view.Views; //导入方法依赖的package包/类
@Test
public void defaultSubsampleTest() {
Img<DoubleType> img = new ArrayImgFactory<DoubleType>().create(new int[] { 10, 10 }, new DoubleType());
Random r = new Random();
for (DoubleType d : img) {
d.set(r.nextDouble());
}
SubsampleView<DoubleType> il2 = Views.subsample((RandomAccessible<DoubleType>) img, 2);
SubsampleView<DoubleType> opr = ops.transform().subsampleView(img, 2);
Cursor<DoubleType> il2C = Views.interval(il2, new long[] { 0, 0 }, new long[] { 4, 4 }).localizingCursor();
RandomAccess<DoubleType> oprRA = opr.randomAccess();
while (il2C.hasNext()) {
il2C.next();
oprRA.setPosition(il2C);
assertEquals(il2C.get().get(), oprRA.get().get(), 1e-10);
}
}
示例2: defaultSubsampleStepsTest
import net.imglib2.view.Views; //导入方法依赖的package包/类
@Test
public void defaultSubsampleStepsTest() {
Img<DoubleType> img = new ArrayImgFactory<DoubleType>().create(new int[] { 10, 10 }, new DoubleType());
Random r = new Random();
for (DoubleType d : img) {
d.set(r.nextDouble());
}
SubsampleView<DoubleType> il2 = Views.subsample((RandomAccessible<DoubleType>) img, 2, 1);
SubsampleView<DoubleType> opr = ops.transform().subsampleView(img, 2, 1);
Cursor<DoubleType> il2C = Views.interval(il2, new long[] { 0, 0 }, new long[] { 4, 9 }).localizingCursor();
RandomAccess<DoubleType> oprRA = opr.randomAccess();
while (il2C.hasNext()) {
il2C.next();
oprRA.setPosition(il2C);
assertEquals(il2C.get().get(), oprRA.get().get(), 1e-10);
}
}
示例3: testIntervalSubsample
import net.imglib2.view.Views; //导入方法依赖的package包/类
@Test
public void testIntervalSubsample() {
Img<DoubleType> img = ArrayImgs.doubles(10, 10);
Random r = new Random();
for (DoubleType d : img) {
d.set(r.nextDouble());
}
SubsampleIntervalView<DoubleType> expected = Views.subsample((RandomAccessibleInterval<DoubleType>) img, 2);
SubsampleIntervalView<DoubleType> actual = (SubsampleIntervalView<DoubleType>) ops.transform().subsampleView((RandomAccessibleInterval<DoubleType>)img, 2);
Cursor<DoubleType> il2C = Views.interval(expected, new long[] { 0, 0 }, new long[] { 4, 4 }).localizingCursor();
RandomAccess<DoubleType> oprRA = actual.randomAccess();
while (il2C.hasNext()) {
il2C.next();
oprRA.setPosition(il2C);
assertEquals(il2C.get().get(), oprRA.get().get(), 1e-10);
}
assertTrue(Intervals.equals(expected, actual));
}
示例4: testIntervalSubsampleSteps
import net.imglib2.view.Views; //导入方法依赖的package包/类
@Test
public void testIntervalSubsampleSteps() {
Img<DoubleType> img = ArrayImgs.doubles(10,10);
Random r = new Random();
for (DoubleType d : img) {
d.set(r.nextDouble());
}
SubsampleIntervalView<DoubleType> expected = Views.subsample((RandomAccessibleInterval<DoubleType>) img, 2, 1);
SubsampleIntervalView<DoubleType> actual = (SubsampleIntervalView<DoubleType>) ops.transform().subsampleView((RandomAccessibleInterval<DoubleType>)img, 2, 1);
Cursor<DoubleType> il2C = Views.interval(expected, new long[] { 0, 0 }, new long[] { 4, 9 }).localizingCursor();
RandomAccess<DoubleType> oprRA = actual.randomAccess();
while (il2C.hasNext()) {
il2C.next();
oprRA.setPosition(il2C);
assertEquals(il2C.get().get(), oprRA.get().get(), 1e-10);
}
assertTrue(Intervals.equals(expected, actual));
}
示例5: calculate
import net.imglib2.view.Views; //导入方法依赖的package包/类
@Override
public SubsampleIntervalView<T> calculate(final RandomAccessibleInterval<T> input) {
return Views.subsample(input, steps);
}
示例6: calculate
import net.imglib2.view.Views; //导入方法依赖的package包/类
@Override
public SubsampleIntervalView<T> calculate(final RandomAccessibleInterval<T> input) {
return Views.subsample(input, step);
}
示例7: calculate
import net.imglib2.view.Views; //导入方法依赖的package包/类
@Override
public SubsampleView<T> calculate(RandomAccessible<T> input) {
return Views.subsample(input, steps);
}
示例8: calculate
import net.imglib2.view.Views; //导入方法依赖的package包/类
@Override
public SubsampleView<T> calculate(RandomAccessible<T> input) {
return Views.subsample(input, step);
}