本文整理汇总了Java中net.imglib2.interpolation.InterpolatorFactory类的典型用法代码示例。如果您正苦于以下问题:Java InterpolatorFactory类的具体用法?Java InterpolatorFactory怎么用?Java InterpolatorFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
InterpolatorFactory类属于net.imglib2.interpolation包,在下文中一共展示了InterpolatorFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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() );
}
}
示例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));
}
}
示例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 );
}
示例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;
}
示例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;
}
示例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 );
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
示例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 );
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}