• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java InterpolatorFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: copyInterpolatedGeneric

import net.imglib2.interpolation.InterpolatorFactory; //导入依赖的package包/类
public static <T extends NumericType< T > > void copyInterpolatedGeneric( RandomAccessible< T > from, IterableInterval< T > to, double[] offset, double scale, InterpolatorFactory< T, RandomAccessible< T > > interpolatorFactory )
{
	final int n = to.numDimensions();
	final double[] fromPosition = new double[ n ];
	Cursor< T > cursor = to.localizingCursor();
	RealRandomAccess< T > interpolator =  interpolatorFactory.create( from );
	while ( cursor.hasNext() )
	{
		final T t = cursor.next();
		for ( int d = 0; d < n; ++d )
		{
			fromPosition[ d ] = scale * cursor.getDoublePosition( d ) + offset[ d ];
		}
		interpolator.setPosition( fromPosition );
		t.set( interpolator.get() );
	}
}
 
开发者ID:imglib,项目名称:imglib2-tests,代码行数:18,代码来源:OpenAndDisplayInterpolated.java


示例2: serializeWarpField

import net.imglib2.interpolation.InterpolatorFactory; //导入依赖的package包/类
/**
 * Appends serialization of this transform's offsets and warp field to the specified data string.
 *
 * @param  data             target data string.
 */
private void serializeWarpField(final StringBuilder data) {
    data.append(locationOffsets[0]).append(' ').append(locationOffsets[1]).append(' ');
    data.append(affineWarpField.getWidth()).append(' ').append(affineWarpField.getHeight()).append(' ');
    data.append(affineWarpField.getRowCount()).append(' ').append(affineWarpField.getColumnCount()).append(' ');
    final InterpolatorFactory<RealComposite<DoubleType>, RandomAccessible<RealComposite<DoubleType>>> factory =
            affineWarpField.getInterpolatorFactory();
    data.append(factory.getClass().getCanonicalName()).append(' ');
    final double[] values = affineWarpField.getValues();
    if (values.length < 64) { // skip encoding for smaller fields to simplify visual inspection and testing
        data.append(NO_ENCODING);
        for (final double value : values) {
            data.append(' ').append(value);
        }
    } else {
        data.append(BASE_64_ENCODING).append(' ').append(DoubleArrayConverter.encodeBase64(values));
    }
}
 
开发者ID:saalfeldlab,项目名称:render,代码行数:23,代码来源:AffineWarpFieldTransform.java


示例3: getInterpolatedSource

import net.imglib2.interpolation.InterpolatorFactory; //导入依赖的package包/类
@Override
public RealRandomAccessible< T > getInterpolatedSource( final int t, final int level, final Interpolation method )
{
	InterpolatorFactory< T, RandomAccessible< T >> factory;
	switch ( method )
	{
	default:
	case NEARESTNEIGHBOR:
		factory = new NearestNeighborInterpolatorFactory< T >();
		break;
	case NLINEAR:
		factory = new NLinearInterpolatorFactory< T >();
		break;
	}
	final T zero = img.firstElement().createVariable();
	zero.setZero();
	return Views.interpolate( Views.extendValue( getSource( t, level ), zero ), factory );
}
 
开发者ID:fiji,项目名称:MaMuT,代码行数:19,代码来源:ImgPlusSource.java


示例4: ProcessIndependentPortion

import net.imglib2.interpolation.InterpolatorFactory; //导入依赖的package包/类
public ProcessIndependentPortion(
		final ImagePortion portion,
		final RandomAccessibleInterval< T > img,
		final InterpolatorFactory<T, RandomAccessible< T > > interpolatorFactory,
		final AffineTransform3D transform,
		final Img< T > fusedImg,
		final BoundingBoxGUI bb )
{
	this.portion = portion;
	this.img = img;
	this.interpolatorFactory = interpolatorFactory;
	this.transform = transform;
	this.fusedImg = fusedImg;
	this.bb = bb;
	this.downSampling = bb.getDownSampling();
	
	if ( downSampling == 1 )
		doDownSampling = false;
	else
		doDownSampling = true;
}
 
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:22,代码来源:ProcessIndependentPortion.java


示例5: ProcessParalellPortion

import net.imglib2.interpolation.InterpolatorFactory; //导入依赖的package包/类
public ProcessParalellPortion(
		final ImagePortion portion,
		final ArrayList< RandomAccessibleInterval< T > > imgs,
		final InterpolatorFactory<T, RandomAccessible< T > > interpolatorFactory,
		final AffineTransform3D[] transforms,
		final Img< T > fusedImg,
		final BoundingBoxGUI bb )
{
	this.portion = portion;
	this.imgs = imgs;
	this.interpolatorFactory = interpolatorFactory;
	this.transforms = transforms;
	this.fusedImg = fusedImg;
	this.bb = bb;
	this.downSampling = bb.getDownSampling();
	
	if ( downSampling == 1 )
		doDownSampling = false;
	else
		doDownSampling = true;
}
 
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:22,代码来源:ProcessParalellPortion.java


示例6: ImageInterpolation

import net.imglib2.interpolation.InterpolatorFactory; //导入依赖的package包/类
public ImageInterpolation( final Img< T > image, final InterpolatorFactory< T, RandomAccessible< T > > interpolatorFactory, final boolean mirror )
{
	this.image = image;
	this.interpolatorFactory = interpolatorFactory;
	if ( mirror )
		this.interpolated = Views.interpolate( Views.extendMirrorSingle( image ), interpolatorFactory );
	else
		this.interpolated = Views.interpolate( Views.extendZero( image ), interpolatorFactory );
}
 
开发者ID:fiji,项目名称:Stitching,代码行数:10,代码来源:ImageInterpolation.java


示例7: processReal

import net.imglib2.interpolation.InterpolatorFactory; //导入依赖的package包/类
static private final <T extends RealType<T>> Img<T> processReal(final Img<T> img, final long[] dim, final Mode mode) throws Exception {

		final Img<T> res = img.factory().create(dim, img.firstElement().createVariable());

		InterpolatorFactory<T,RandomAccessible<T>> ifac;
		switch (mode) {
		case LINEAR:
			ifac = new NLinearInterpolatorFactory<T>();
			break;
		case NEAREST_NEIGHBOR:
			ifac = new NearestNeighborInterpolatorFactory<T>();
			break;
		default:
			throw new Exception("Resample: unknown mode!");
		}

		final RealRandomAccess<T> inter = ifac.create(Views.extend(img, new OutOfBoundsMirrorFactory<T,Img<T>>(OutOfBoundsMirrorFactory.Boundary.SINGLE)));
		final Cursor<T> c2 = res.localizingCursor();
		final float[] s = new float[dim.length];
		for (int i=0; i<s.length; i++) s[i] = (float)img.dimension(i) / dim[i];
		final long[] d = new long[dim.length];
		final float[] p = new float[dim.length];
		while (c2.hasNext()) {
			c2.fwd();
			c2.localize(d); // TODO "localize" seems to indicate the opposite of what it does
			for (int i=0; i<d.length; i++) p[i] = d[i] * s[i];
			inter.move(p);
			c2.get().set(inter.get());			
		}
		return res;
	}
 
开发者ID:imglib,项目名称:imglib2-script,代码行数:32,代码来源:Resample.java


示例8: AffineWarpField

import net.imglib2.interpolation.InterpolatorFactory; //导入依赖的package包/类
/**
 * Constructs a field with the specified dimensions.
 * Each affine is initialized with identity values.
 *
 * @param  width                pixel width of the warp field.
 * @param  height               pixel height of the warp field.
 * @param  rowCount             number of affine rows in the warp field.
 * @param  columnCount          number of affine columns in the warp field.
 * @param  interpolatorFactory  factory for desired interpolator instance.
 */
public AffineWarpField(final double width,
                       final double height,
                       final int rowCount,
                       final int columnCount,
                       final InterpolatorFactory<RealComposite<DoubleType>, RandomAccessible<RealComposite<DoubleType>>> interpolatorFactory)
        throws IllegalArgumentException {
    this(width, height, rowCount, columnCount,
         getDefaultValues(rowCount, columnCount),
         interpolatorFactory);
}
 
开发者ID:saalfeldlab,项目名称:render,代码行数:21,代码来源:AffineWarpField.java


示例9: interpolateView

import net.imglib2.interpolation.InterpolatorFactory; //导入依赖的package包/类
/**
 * Returns a {@link RealRandomAccessible} using interpolation
 *
 * @param input the {@link EuclideanSpace} to be interpolated
 * @param factory the {@link InterpolatorFactory} to provide interpolators for
 *          source
 * @return
 */
@OpMethod(
	op = net.imagej.ops.transform.interpolateView.DefaultInterpolateView.class)
public <T, I extends EuclideanSpace> RealRandomAccessible<T> interpolateView(
	final I input, final InterpolatorFactory<T, I> factory)
{
	return (RealRandomAccessible<T>) ops().run(
		Ops.Transform.InterpolateView.class, input, factory);
}
 
开发者ID:imagej,项目名称:imagej-ops,代码行数:17,代码来源:TransformNamespace.java


示例10: scaleView

import net.imglib2.interpolation.InterpolatorFactory; //导入依赖的package包/类
/**
 * Executes the "scale" operation on the given arguments.
 *
 * @param in
 * @param scaleFactors
 * @param interpolator
 * @return
 */
@OpMethod(op = net.imagej.ops.transform.scaleView.DefaultScaleView.class)
public <T extends RealType<T>> RandomAccessibleInterval<T> scaleView(
	final RandomAccessibleInterval<T> in, final double[] scaleFactors,
	final InterpolatorFactory<T, RandomAccessible<T>> interpolator)
{
	@SuppressWarnings("unchecked")
	final RandomAccessibleInterval<T> result =
		(RandomAccessibleInterval<T>) ops().run(Ops.Transform.ScaleView.class, in,
			scaleFactors, interpolator);
	return result;
}
 
开发者ID:imagej,项目名称:imagej-ops,代码行数:20,代码来源:TransformNamespace.java


示例11: mapInterpolated

import net.imglib2.interpolation.InterpolatorFactory; //导入依赖的package包/类
final public <F extends NumericType<F>> void mapInterpolated(
		final RandomAccessibleInterval<F> source,
		final IterableInterval<F> target,
		final InterpolatorFactory<F,RandomAccessible<F>> interp)
{
	final Set< AffineModel2D > s = transform.getAV().keySet();
	mapTriangleInterpolated( transform, s, source, target, interp );
}
 
开发者ID:bogovicj,项目名称:hhmi-exp,代码行数:9,代码来源:CrackTransformMeshMapping.java


示例12: xfmToView

import net.imglib2.interpolation.InterpolatorFactory; //导入依赖的package包/类
public static <T extends RealType<T>> RealTransformRandomAccessible<T, InverseRealTransform> xfmToView(
		InvertibleRealTransform xfm, 
		RandomAccessible<T> src, 
		InterpolatorFactory<T, RandomAccessible<T>> interpFactory) 
{
	RealRandomAccessible<T> interpolant = Views.interpolate(
			src, interpFactory);

	RealTransformRandomAccessible<T, InverseRealTransform> rv = 
		RealViews.transform( interpolant, xfm.inverse() );

	return rv;
}
 
开发者ID:bogovicj,项目名称:hhmi-exp,代码行数:14,代码来源:TransformTools.java


示例13: ProcessSequentialPortionWeights

import net.imglib2.interpolation.InterpolatorFactory; //导入依赖的package包/类
public ProcessSequentialPortionWeights(
		final ImagePortion portion,
		final ArrayList< RandomAccessibleInterval< T > > imgs,
		final ArrayList< ArrayList< RealRandomAccessible< FloatType > > > weights,
		final InterpolatorFactory< T, RandomAccessible< T > > interpolatorFactory,
		final AffineTransform3D[] transforms,
		final Img< T > fusedImg,
		final Img< FloatType > weightImg,
		final BoundingBoxGUI bb )
{
	super( portion, imgs, interpolatorFactory, transforms, fusedImg, weightImg, bb );
	
	this.weights = weights;
}
 
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:15,代码来源:ProcessSequentialPortionWeights.java


示例14: ProcessSequentialPortion

import net.imglib2.interpolation.InterpolatorFactory; //导入依赖的package包/类
public ProcessSequentialPortion(
		final ImagePortion portion,
		final ArrayList< RandomAccessibleInterval< T > > imgs,
		final InterpolatorFactory<T, RandomAccessible< T > > interpolatorFactory,
		final AffineTransform3D[] transforms,
		final Img< T > fusedImg,
		final Img< FloatType > weightImg,
		final BoundingBoxGUI bb )
{
	super( portion, imgs, interpolatorFactory, transforms, fusedImg, bb );
	
	this.weightImg = weightImg;
}
 
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:14,代码来源:ProcessSequentialPortion.java


示例15: ProcessParalellPortionWeight

import net.imglib2.interpolation.InterpolatorFactory; //导入依赖的package包/类
public ProcessParalellPortionWeight(
		final ImagePortion portion,
		final ArrayList< RandomAccessibleInterval< T > > imgs,
		final ArrayList< RealRandomAccessible< FloatType > > weights,
		final InterpolatorFactory< T, RandomAccessible< T > > interpolatorFactory,
		final AffineTransform3D[] transforms,
		final Img< T > fusedImg,
		final BoundingBoxGUI bb )
{
	super( portion, imgs, interpolatorFactory, transforms, fusedImg, bb );
	
	this.weights = weights;
}
 
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:14,代码来源:ProcessParalellPortionWeight.java


示例16: getInterpolatorFactory

import net.imglib2.interpolation.InterpolatorFactory; //导入依赖的package包/类
public < T extends RealType< T > > InterpolatorFactory< T, RandomAccessible< T > > getInterpolatorFactory( final T type )
{
	if ( getInterpolation() == 0 )
		return new NearestNeighborInterpolatorFactory<T>();
	else
		return new NLinearInterpolatorFactory< T >();
}
 
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:8,代码来源:WeightedAverageFusion.java


示例17: ProcessSequentialPortionWeight

import net.imglib2.interpolation.InterpolatorFactory; //导入依赖的package包/类
public ProcessSequentialPortionWeight(
		final ImagePortion portion,
		final ArrayList< RandomAccessibleInterval< T > > imgs,
		final ArrayList< RealRandomAccessible< FloatType > > weights,
		final InterpolatorFactory< T, RandomAccessible< T > > interpolatorFactory,
		final AffineTransform3D[] transforms,
		final Img< T > fusedImg,
		final Img< FloatType > weightImg,
		final BoundingBoxGUI bb )
{
	super( portion, imgs, interpolatorFactory, transforms, fusedImg, weightImg, bb );
	
	this.weights = weights;
}
 
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:15,代码来源:ProcessSequentialPortionWeight.java


示例18: ProcessParalellPortionWeights

import net.imglib2.interpolation.InterpolatorFactory; //导入依赖的package包/类
public ProcessParalellPortionWeights(
		final ImagePortion portion,
		final ArrayList< RandomAccessibleInterval< T > > imgs,
		final ArrayList< ArrayList< RealRandomAccessible< FloatType > > > weights,
		final InterpolatorFactory< T, RandomAccessible< T > > interpolatorFactory,
		final AffineTransform3D[] transforms,
		final Img< T > fusedImg,
		final BoundingBoxGUI bb )
{
	super( portion, imgs, interpolatorFactory, transforms, fusedImg, bb );
	
	this.weights = weights;
}
 
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:14,代码来源:ProcessParalellPortionWeights.java


示例19: interpolatorFactory

import net.imglib2.interpolation.InterpolatorFactory; //导入依赖的package包/类
final static private < T extends RealType< T > >InterpolatorFactory< RealComposite< T >, RandomAccessible< RealComposite< T > > > interpolatorFactory( final Interpolation interpolation )
{
	switch ( interpolation )
	{
	case NN:
		return new NearestNeighborInterpolatorFactory< RealComposite< T > >();
	default:
		return new NLinearInterpolatorFactory< RealComposite< T > >();
	}
}
 
开发者ID:trakem2,项目名称:TrakEM2,代码行数:11,代码来源:LinearIntensityMap.java


示例20: LinearIntensityMap

import net.imglib2.interpolation.InterpolatorFactory; //导入依赖的package包/类
public LinearIntensityMap( final RandomAccessibleInterval< T > source, final InterpolatorFactory< RealComposite< T >, RandomAccessible< RealComposite< T > > > interpolatorFactory )
{
	this.interpolatorFactory = interpolatorFactory;
	final CompositeIntervalView< T, RealComposite< T > > collapsedSource = Views.collapseReal( source );
	dimensions = new FinalInterval( collapsedSource );
	final double[] shift = new double[ dimensions.numDimensions() ];
	for ( int d = 0; d < shift.length; ++d )
		shift[ d ] = 0.5;
	translation = new Translation( shift );

	final RandomAccessible< RealComposite< T > > extendedCollapsedSource = Views.extendBorder( collapsedSource );
	coefficients = Views.interpolate( extendedCollapsedSource, interpolatorFactory );
}
 
开发者ID:trakem2,项目名称:TrakEM2,代码行数:14,代码来源:LinearIntensityMap.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TaskAttemptStartedEvent类代码示例发布时间:2022-05-22
下一篇:
Java Template类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap