public void setNearestNeighborInterpolation() { this.interpolatorFactory = new NearestNeighborInterpolatorFactory< FloatType >(); }
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 > >(); } }
@SuppressWarnings( "unchecked" ) public DefaultInterpolators() { factories = new InterpolatorFactory[ Interpolation.values().length ]; factories[ Interpolation.NEARESTNEIGHBOR.ordinal() ] = new NearestNeighborInterpolatorFactory<>(); factories[ Interpolation.NLINEAR.ordinal() ] = new ClampingNLinearInterpolatorFactory<>(); }
public static Img< FloatType > extractNN( final Img< FloatType > img, final long[] dim, final double[] center ) { final Img< FloatType > psf = new ArrayImgFactory< FloatType >().create( dim, new FloatType() ); final ArrayList< RealLocalizable > locations = new ArrayList<>(); locations.add( new RealPoint( center ) ); //locations.add( new RealPoint( new double[] { i.dimension( 0 ) / 2, i.dimension( 1 ) / 2, i.dimension( 2 ) / 2 } ) ); final RealRandomAccessible< FloatType > rra = Views.interpolate( Views.extendMirrorSingle( img ), new NearestNeighborInterpolatorFactory<>()); PSFExtraction.extractPSFLocal( rra, locations, psf ); return psf; }
@SuppressWarnings( { "unchecked", "rawtypes" } ) public InterpolatingSource( final RandomAccessible< T > source, final A sourceTransform, final Converter< ? super T, ARGBType > converter ) { final InterpolatorFactory< T, RandomAccessible< T > > nLinearInterpolatorFactory; if ( ARGBType.class.isInstance( source.randomAccess().get() ) ) nLinearInterpolatorFactory = ( InterpolatorFactory ) new NLinearInterpolatorARGBFactory(); else nLinearInterpolatorFactory = new NLinearInterpolatorFactory< >(); this.sourceTransform = sourceTransform; this.converter = converter; sourceInterpolants = new RealRandomAccessible[] { Views.interpolate( source, new NearestNeighborInterpolatorFactory< T >() ), Views.interpolate( source, nLinearInterpolatorFactory ) }; interpolation = 0; }
break; case NEAREST_NEIGHBOR: inter = new NearestNeighborInterpolatorFactory<R>(); break; default:
final RealRandomAccessible< T > interpolated = Views.interpolate( Views.extendMirrorSingle( gaussConvolved ), new NearestNeighborInterpolatorFactory<T>() ); final RealRandomAccess< T > interpolator = interpolated.realRandomAccess(); final Cursor<T> cursor = downSampled.localizingCursor();
break; case NEAREST_NEIGHBOR: ifac = new NearestNeighborInterpolatorFactory<T>(); break; default:
factory = new NLinearInterpolatorFactory<FloatType>(); else factory = new NearestNeighborInterpolatorFactory< FloatType >();
interpolatorFactories[ iNearestNeighborMethod ] = new NearestNeighborInterpolatorFactory<>(); interpolatorFactories[ iNLinearMethod ] = new ClampingNLinearInterpolatorFactory<>();
final InterpolatorFactory< FloatType, RandomAccessible< FloatType > > interpolatorFactoryFloat = new NearestNeighborInterpolatorFactory< FloatType >();// new OutOfBoundsStrategyValueFactory<FloatType>() ); final InterpolatorFactory< UnsignedShortType, RandomAccessible< UnsignedShortType > > interpolatorFactoryShort = new NearestNeighborInterpolatorFactory< UnsignedShortType >();// new OutOfBoundsStrategyValueFactory<UnsignedShortType>() ); final InterpolatorFactory< UnsignedByteType, RandomAccessible< UnsignedByteType > > interpolatorFactoryByte = new NearestNeighborInterpolatorFactory< UnsignedByteType >();// new OutOfBoundsStrategyValueFactory<UnsignedByteType>() );
break; case NEAREST_NEIGHBOR: ifac = new NearestNeighborInterpolatorFactory< T >(); break; case LANCZOS:
break; case NEAREST_NEIGHBOR: ifac = new NearestNeighborInterpolatorFactory< T >(); break; default: