本文整理汇总了Java中net.imglib2.view.Views.addDimension方法的典型用法代码示例。如果您正苦于以下问题:Java Views.addDimension方法的具体用法?Java Views.addDimension怎么用?Java Views.addDimension使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.imglib2.view.Views
的用法示例。
在下文中一共展示了Views.addDimension方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import net.imglib2.view.Views; //导入方法依赖的package包/类
@Override
public void run() {
// parse the spacing, and scales strings.
spacing = checkDimensions(spacingString, input.numDimensions(), "Spacings");
scales = Arrays.stream(scaleString.split(regex)).mapToInt(Integer::parseInt)
.toArray();
Dimensions resultDims = Views.addDimension(input, 0, scales.length - 1);
// create output image, potentially-filtered input
result = opService.create().img(resultDims, new FloatType());
for (int s = 0; s < scales.length; s++) {
// Determine whether or not the user would like to apply the gaussian
// beforehand and do it.
RandomAccessibleInterval<T> vesselnessInput = doGauss ? opService.filter()
.gauss(input, scales[s]) : input;
IntervalView<FloatType> scaleResult = Views.hyperSlice(result, result
.numDimensions() - 1, s);
opService.filter().frangiVesselness(scaleResult, vesselnessInput, spacing,
scales[s]);
}
}
示例2: addDimensionTest
import net.imglib2.view.Views; //导入方法依赖的package包/类
@Test
public void addDimensionTest() {
Img<DoubleType> img = new ArrayImgFactory<DoubleType>().create(new int[] { 10, 10 }, new DoubleType());
MixedTransformView<DoubleType> il2 = Views.addDimension((RandomAccessible<DoubleType>)img);
MixedTransformView<DoubleType> opr = ops.transform().addDimensionView((RandomAccessible<DoubleType>)img);
assertEquals(il2.numDimensions(), opr.numDimensions());
boolean[] il2Transform = new boolean[3];
boolean[] oprTransform = new boolean[3];
il2.getTransformToSource().getComponentZero(il2Transform);
opr.getTransformToSource().getComponentZero(oprTransform);
for (int i = 0; i < il2Transform.length; i++) {
assertEquals(il2Transform[i], oprTransform[i]);
}
}
示例3: addDimensionMinMaxTest
import net.imglib2.view.Views; //导入方法依赖的package包/类
@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);
}
}
示例4: calculate
import net.imglib2.view.Views; //导入方法依赖的package包/类
@Override
public IntervalView<T> calculate(RandomAccessibleInterval<T> input) {
return Views.addDimension(input, minOfNewDim, maxOfNewDim);
}
示例5: calculate
import net.imglib2.view.Views; //导入方法依赖的package包/类
@Override
public MixedTransformView<T> calculate(RandomAccessible<T> input) {
return Views.addDimension(input);
}