当前位置: 首页>>代码示例>>Java>>正文


Java Views.subsample方法代码示例

本文整理汇总了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);
	}
}
 
开发者ID:imagej,项目名称:imagej-ops,代码行数:21,代码来源:SubsampleViewTest.java

示例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);
	}
}
 
开发者ID:imagej,项目名称:imagej-ops,代码行数:21,代码来源:SubsampleViewTest.java

示例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));
}
 
开发者ID:imagej,项目名称:imagej-ops,代码行数:23,代码来源:SubsampleViewTest.java

示例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));
}
 
开发者ID:imagej,项目名称:imagej-ops,代码行数:23,代码来源:SubsampleViewTest.java

示例5: calculate

import net.imglib2.view.Views; //导入方法依赖的package包/类
@Override
public SubsampleIntervalView<T> calculate(final RandomAccessibleInterval<T> input) {
	return Views.subsample(input, steps);
}
 
开发者ID:imagej,项目名称:imagej-ops,代码行数:5,代码来源:SubsampleIntervalViewStepsForDims.java

示例6: calculate

import net.imglib2.view.Views; //导入方法依赖的package包/类
@Override
public SubsampleIntervalView<T> calculate(final RandomAccessibleInterval<T> input) {
	return Views.subsample(input, step);
}
 
开发者ID:imagej,项目名称:imagej-ops,代码行数:5,代码来源:IntervalSubsampleView.java

示例7: calculate

import net.imglib2.view.Views; //导入方法依赖的package包/类
@Override
public SubsampleView<T> calculate(RandomAccessible<T> input) {
	return Views.subsample(input, steps);
}
 
开发者ID:imagej,项目名称:imagej-ops,代码行数:5,代码来源:SubsampleViewStepsForDims.java

示例8: calculate

import net.imglib2.view.Views; //导入方法依赖的package包/类
@Override
public SubsampleView<T> calculate(RandomAccessible<T> input) {
	return Views.subsample(input, step);
}
 
开发者ID:imagej,项目名称:imagej-ops,代码行数:5,代码来源:DefaultSubsampleView.java


注:本文中的net.imglib2.view.Views.subsample方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。