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


Java OutOfBoundsConstantValueFactory类代码示例

本文整理汇总了Java中net.imglib2.outofbounds.OutOfBoundsConstantValueFactory的典型用法代码示例。如果您正苦于以下问题:Java OutOfBoundsConstantValueFactory类的具体用法?Java OutOfBoundsConstantValueFactory怎么用?Java OutOfBoundsConstantValueFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OutOfBoundsConstantValueFactory类属于net.imglib2.outofbounds包,在下文中一共展示了OutOfBoundsConstantValueFactory类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initialize

import net.imglib2.outofbounds.OutOfBoundsConstantValueFactory; //导入依赖的package包/类
@Override
public void initialize() {

	// the out of bounds factory will be different depending on wether we are
	// using circulant or non-circulant
	if (this.getOBFInput() == null) {

		if (!nonCirculant) {
			setOBFInput(new OutOfBoundsMirrorFactory<>(Boundary.SINGLE));
		}
		else if (nonCirculant) {
			setOBFInput(new OutOfBoundsConstantValueFactory<>(Util
				.getTypeFromInterval(in()).createVariable()));
		}
	}

	computeEstimateOp = getComputeEstimateOp();

	super.initialize();

}
 
开发者ID:imagej,项目名称:imagej-ops,代码行数:22,代码来源:RichardsonLucyF.java

示例2: initialize

import net.imglib2.outofbounds.OutOfBoundsConstantValueFactory; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void initialize() {
	maxVal = Util.getTypeFromInterval(in()).createVariable();
	maxVal.setReal(maxVal.getMaxValue());

	if (f == null) {
		f = new OutOfBoundsConstantValueFactory<>(
			maxVal);
	}

	final UnaryComputerOp neighborComputer = maxVal instanceof BitType
		? new ErodeBitType() : Computers.unary(ops(), Ops.Stats.Min.class, maxVal
			.createVariable(), Iterable.class);

	imgCreator = (UnaryFunctionOp) Functions.unary(ops(), Ops.Create.Img.class,
		Img.class, in(), maxVal.createVariable());

	if (out() == null) setOutput(createOutput(in()));

	mapper = ops().op(MapNeighborhood.class, out(), in1(), in2(),
		neighborComputer);
}
 
开发者ID:imagej,项目名称:imagej-ops,代码行数:24,代码来源:DefaultErode.java

示例3: initialize

import net.imglib2.outofbounds.OutOfBoundsConstantValueFactory; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void initialize() {
	minVal = Util.getTypeFromInterval(in()).createVariable();
	minVal.setReal(minVal.getMinValue());

	if (f == null) {
		f = new OutOfBoundsConstantValueFactory<>(
			minVal);
	}

	final UnaryComputerOp neighborComputer = minVal instanceof BitType
		? new DilateBitType() : Computers.unary(ops(), Ops.Stats.Max.class, minVal
			.createVariable(), Iterable.class);

	imgCreator = (UnaryFunctionOp) Functions.unary(ops(), Ops.Create.Img.class,
		Img.class, in(), minVal.createVariable());

	if (out() == null) setOutput(createOutput(in()));

	mapper = ops().op(MapNeighborhood.class, out(), in1(), in2(),
		neighborComputer);
}
 
开发者ID:imagej,项目名称:imagej-ops,代码行数:24,代码来源:DefaultDilate.java

示例4: createValueExtended

import net.imglib2.outofbounds.OutOfBoundsConstantValueFactory; //导入依赖的package包/类
/**
 * @param source
 *            Source to be wrapped.
 * @param stepSize
 *            Strides for each dimension.
 * @param value
 *            Value for extending source.
 * @return BlockedInterval wrapped around value extended source.
 */
public static < U extends Type< U > > BlockedInterval< U > createValueExtended(
		RandomAccessibleInterval< U > source,
		long[] stepSize,
		U value )
{
	OutOfBoundsConstantValueFactory< U, RandomAccessibleInterval< U >> factory =
			new OutOfBoundsConstantValueFactory< U, RandomAccessibleInterval< U > >( value );
	return new BlockedInterval< U >( source, stepSize, factory );
}
 
开发者ID:saalfeldlab,项目名称:bigcat,代码行数:19,代码来源:BlockedInterval.java

示例5: AbstractAffine3D

import net.imglib2.outofbounds.OutOfBoundsConstantValueFactory; //导入依赖的package包/类
/** With a default {@link OutOfBoundsStrategyValueFactory} with @param outside. */
@SuppressWarnings("unchecked")
public AbstractAffine3D(final Img<T> img,
		final float scaleX, final float shearX,
		final float shearY, final float scaleY,
		final float translateX, final float translateY,
		final Mode mode, final Number outside) throws Exception {
	this(img, new float[]{scaleX, shearX, 0, translateX,
			  			   shearY, scaleY, 0, translateY,
			  			   0, 0, 1, 0}, mode, new OutOfBoundsConstantValueFactory<T,Img<T>>((T)withValue(img, img.firstElement().createVariable(), outside)));
}
 
开发者ID:imglib,项目名称:imglib2-script,代码行数:12,代码来源:AbstractAffine3D.java

示例6: processRGBA

import net.imglib2.outofbounds.OutOfBoundsConstantValueFactory; //导入依赖的package包/类
@SuppressWarnings("unchecked")
static private final Img<ARGBType> processRGBA(final Img<ARGBType> img, final float[] m,
		final Mode mode, final OutOfBoundsFactory<ARGBType,Img<ARGBType>> oobf) throws Exception {
	// Process each channel independently and then compose them back
	OutOfBoundsFactory<FloatType,Img<FloatType>> ored, ogreen, oblue, oalpha;
	if (OutOfBoundsConstantValueFactory.class.isAssignableFrom(oobf.getClass())) { // can't use instanceof
		final int val = ((OutOfBoundsConstantValueFactory<ARGBType,Img<ARGBType>>)oobf).getValue().get();
		ored = new OutOfBoundsConstantValueFactory<FloatType,Img<FloatType>>(new FloatType((val >> 16) & 0xff));
		ogreen = new OutOfBoundsConstantValueFactory<FloatType,Img<FloatType>>(new FloatType((val >> 8) & 0xff));
		oblue = new OutOfBoundsConstantValueFactory<FloatType,Img<FloatType>>(new FloatType(val & 0xff));
		oalpha = new OutOfBoundsConstantValueFactory<FloatType,Img<FloatType>>(new FloatType((val >> 24) & 0xff));
	} else {
		// Jump into the pool!
		try {
			ored = oobf.getClass().newInstance();
		} catch (Exception e) {
			System.out.println("Affine3D for RGBA: oops -- using a black OutOfBoundsStrategyValueFactory");
			ored = new OutOfBoundsConstantValueFactory<FloatType,Img<FloatType>>(new FloatType());
		}
		ogreen = ored;
		oblue = ored;
		oalpha = ored;
	}
	return new RGBA(processReal(Compute.inFloats(new Red(img)), m, mode, ored),
					processReal(Compute.inFloats(new Green(img)), m, mode, ogreen),
					processReal(Compute.inFloats(new Blue(img)), m, mode, oblue),
					processReal(Compute.inFloats(new Alpha(img)), m, mode, oalpha)).asImage();
}
 
开发者ID:imglib,项目名称:imglib2-script,代码行数:29,代码来源:AbstractAffine3D.java

示例7: calculate

import net.imglib2.outofbounds.OutOfBoundsConstantValueFactory; //导入依赖的package包/类
@Override
public RandomAccessibleInterval<O> calculate(
	final RandomAccessibleInterval<I> img,
	final RandomAccessibleInterval<K> kernel)
{

	RandomAccessibleInterval<O> out = createOutput(img, kernel);

	if (obf == null) {
		obf = new OutOfBoundsConstantValueFactory<>(Util.getTypeFromInterval(in())
			.createVariable());
	}

	// extend the input
	RandomAccessibleInterval<I> extendedIn = Views.interval(Views.extend(img,
		obf), img);

	OutOfBoundsFactory<O, RandomAccessibleInterval<O>> obfOutput =
		new OutOfBoundsConstantValueFactory<>(Util.getTypeFromInterval(out)
			.createVariable());

	// extend the output
	RandomAccessibleInterval<O> extendedOut = Views.interval(Views.extend(out,
		obfOutput), out);

	// ops().filter().convolve(extendedOut, extendedIn, kernel);
	convolver.compute(extendedIn, extendedOut);

	return out;
}
 
开发者ID:imagej,项目名称:imagej-ops,代码行数:31,代码来源:ConvolveNaiveF.java

示例8: initialize

import net.imglib2.outofbounds.OutOfBoundsConstantValueFactory; //导入依赖的package包/类
@Override
public void initialize() {

	// if no OBF was passed in set default OBF for convolve to be constant value
	// of zero (zero-pad)
	if (this.getOBFInput() == null) {
		setOBFInput(new OutOfBoundsConstantValueFactory<>(Util
			.getTypeFromInterval(in()).createVariable()));
	}

	super.initialize();

}
 
开发者ID:imagej,项目名称:imagej-ops,代码行数:14,代码来源:ConvolveFFTF.java

示例9: calculate

import net.imglib2.outofbounds.OutOfBoundsConstantValueFactory; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public O calculate(final I input) {

	if (obf == null) {
		obf = new OutOfBoundsConstantValueFactory<>(
			Util.getTypeFromInterval(input).createVariable());
	}

	Interval inputInterval = paddingIntervalCentered.calculate(input,
		paddedDimensions);

	return (O) Views.interval(Views.extend(input, obf), inputInterval);
}
 
开发者ID:imagej,项目名称:imagej-ops,代码行数:15,代码来源:PadInput.java

示例10: testDeconvolve

import net.imglib2.outofbounds.OutOfBoundsConstantValueFactory; //导入依赖的package包/类
@Test
public void testDeconvolve() {
	int[] size = new int[] { 225, 167 };
	int[] kernelSize = new int[] { 27, 39 };

	// create an input with a small sphere at the center
	Img<FloatType> in = new ArrayImgFactory<FloatType>().create(size,
		new FloatType());
	placeSphereInCenter(in);

	// create a kernel with a small sphere in the center
	Img<FloatType> kernel = new ArrayImgFactory<FloatType>().create(kernelSize,
		new FloatType());
	placeSphereInCenter(kernel);

	// convolve and calculate the sum of output
	@SuppressWarnings("unchecked")
	final Img<FloatType> convolved = (Img<FloatType>) ops.run(
		ConvolveFFTF.class, in, kernel);

	@SuppressWarnings("unchecked")
	final RandomAccessibleInterval<FloatType> deconvolved2 =
		(RandomAccessibleInterval<FloatType>) ops.run(RichardsonLucyF.class,
			convolved, kernel, null, new OutOfBoundsConstantValueFactory<>(Util
				.getTypeFromInterval(in).createVariable()), 10);

	assertEquals(size[0], deconvolved2.dimension(0));
	assertEquals(size[1], deconvolved2.dimension(1));
	final Cursor<FloatType> deconvolved2Cursor = Views.iterable(deconvolved2)
		.cursor();
	float[] deconvolved2Values = { 1.0936068E-14f, 2.9685445E-14f,
		4.280788E-15f, 3.032084E-18f, 1.1261E-39f, 0.0f, -8.7E-44f, -8.11881E-31f,
		-2.821192E-18f, 1.8687104E-20f, -2.927517E-23f, 1.2815774E-29f,
		-1.0611375E-19f, -5.2774515E-21f, -6.154334E-20f };
	for (int i = 0; i < deconvolved2Values.length; i++) {
		assertEquals(deconvolved2Values[i], deconvolved2Cursor.next().get(),
			0.0f);
	}
}
 
开发者ID:imagej,项目名称:imagej-ops,代码行数:40,代码来源:DeconvolveTest.java

示例11: Affine3D

import net.imglib2.outofbounds.OutOfBoundsConstantValueFactory; //导入依赖的package包/类
/**
 * TODO
 * 
 * @param img The {@link Img} to transform.
 * @param matrix The values of the transformation matrix, ordered as explained above.
 * @param mode Either LINEAR or NEAREST_NEIGHBOR.
 */
public Affine3D(final Img<T> img, final float[] matrix, final Mode mode) throws Exception {
	this(img, matrix, mode, new OutOfBoundsConstantValueFactory<T,Img<T>>(img.firstElement().createVariable())); // default value is zero
}
 
开发者ID:imglib,项目名称:imglib2-script,代码行数:11,代码来源:Affine3D.java


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