/** * Updates the source. */ public void updateSource(RandomAccessibleInterval<T> source) { this.source = source; this.extendedSource = Views.extend(source, outOfBounds); }
/** * Updates the source. */ public void updateSource(IN source) { this.source = source; this.extendedSource = Views.extend(source, outOfBounds); }
@Override public ExtendedRandomAccessibleInterval<T, F> calculate(F input) { return Views.extend(input, factory); }
/** * Computes a Gaussian convolution with double precision on an entire {@link Img} * * @param sigma - the sigma for the convolution * @param input - the input {@link Img} * @param outOfBounds - the {@link OutOfBoundsFactory} to use */ public GaussDouble( final double[] sigma, final Img<DoubleType> input, final OutOfBoundsFactory< DoubleType, Img<DoubleType> > outOfBounds ) { this( sigma, Views.extend( input, outOfBounds ), input, input.factory() ); }
/** * Computes a Gaussian convolution with float precision on an entire {@link Img} * * @param sigma - the sigma for the convolution * @param input - the input {@link Img} * @param outOfBounds - the {@link OutOfBoundsFactory} to use */ public GaussFloat( final double[] sigma, final Img<FloatType> input, final OutOfBoundsFactory< FloatType, Img<FloatType> > outOfBounds ) { this( sigma, Views.extend( input, outOfBounds ), input, input.factory() ); }
public SquareNeighborhood3x3(RandomAccessibleInterval<T> source, OutOfBoundsFactory<T, RandomAccessibleInterval<T>> outOfBounds) { this.source = source; this.center = new long[source.numDimensions()]; this.extendedSource = Views.extend(source, outOfBounds); }
public SquareNeighborhood3x3(RandomAccessibleInterval<T> source, OutOfBoundsFactory<T, RandomAccessibleInterval<T>> outOfBounds) { this.source = source; this.center = new long[source.numDimensions()]; this.extendedSource = Views.extend(source, outOfBounds); }
final public static < R extends RealType< R > > Img< ComplexFloatType > realToComplex( final RandomAccessibleInterval< R > input, final OutOfBoundsFactory< R, RandomAccessibleInterval< R > > oobs, final ImgFactory< ComplexFloatType > factory ) { return realToComplex( Views.extend( input, oobs ), input, factory, new ComplexFloatType(), Runtime.getRuntime().availableProcessors() ); }
final public static < R extends RealType< R > > Img< ComplexFloatType > realToComplex( final RandomAccessibleInterval< R > input, final OutOfBoundsFactory< R, RandomAccessibleInterval< R > > oobs, final ImgFactory< ComplexFloatType > factory, final ExecutorService service ) { return realToComplex( Views.extend( input, oobs ), input, factory, new ComplexFloatType(), service ); }
@Override public void compute(RandomAccessibleInterval<I> input, IterableInterval<O> output) { map.compute(Views.interval(Views.extend(input, outOfBoundsFactory), input), output); }
/** * Computes a Gaussian convolution with double precision on an entire {@link Img} using the {@link OutOfBoundsMirrorFactory} with single boundary * * @param sigma - the sigma for the convolution * @param input - the input {@link Img} */ public GaussDouble( final double[] sigma, final Img<DoubleType> input ) { this( sigma, Views.extend( input, new OutOfBoundsMirrorFactory< DoubleType, Img<DoubleType> >( Boundary.SINGLE ) ), input, input.factory() ); }
/** * Computes a Gaussian convolution with float precision on an entire {@link Img} using the {@link OutOfBoundsMirrorFactory} with single boundary * * @param sigma - the sigma for the convolution * @param input - the input {@link Img} */ public GaussFloat( final double[] sigma, final Img<FloatType> input ) { this( sigma, Views.extend( input, new OutOfBoundsMirrorFactory< FloatType, Img<FloatType> >( Boundary.SINGLE ) ), input, input.factory() ); }
final public static < R extends RealType< R > > Img< ComplexFloatType > realToComplex( final RandomAccessibleInterval< R > input, final OutOfBoundsFactory< R, RandomAccessibleInterval< R > > oobs, final ImgFactory< ComplexFloatType > factory ) { return realToComplex( Views.extend( input, oobs ), input, factory, new ComplexFloatType() ); }
final public static < R extends RealType< R > > Img< ComplexFloatType > realToComplex( final RandomAccessibleInterval< R > input, final OutOfBoundsFactory< R, RandomAccessibleInterval< R > > oobs, final ImgFactory< ComplexFloatType > factory, final int numThreads ) { return realToComplex( Views.extend( input, oobs ), input, factory, new ComplexFloatType(), numThreads ); }
/** * Computes a Gaussian convolution with any precision on an entire {@link Img} using the {@link OutOfBoundsMirrorFactory} with single boundary * * @param sigma - the sigma for the convolution * @param input - the input {@link Img} */ public GaussNativeType( final double[] sigma, final Img<T> input, final OutOfBoundsFactory< T, Img<T> > outOfBounds ) { this( sigma, Views.extend( input, outOfBounds ), input, input.factory(), input.firstElement().createVariable() ); }
/** * Computes a Gaussian convolution in-place (temporary imgs are necessary) with the precision of the type provided on an entire {@link Img} * * @param sigma - the sigma for the convolution * @param img - the img {@link Img} that will be convolved in place */ public static <T extends NumericType<T>> void inNumericTypeInPlace( final double[] sigma, final Img< T > img, final OutOfBoundsFactory< T, RandomAccessibleInterval< T > > outofbounds ) { inNumericType( sigma, Views.extend( img, outofbounds ), img, img, new Point( sigma.length ), img.factory() ); }
/** * Computes a Gaussian convolution in-place (temporary imgs are necessary) * with the precision of the type provided on an entire {@link Img} * * @param sigma * - the sigma for the convolution * @param img * - the img {@link Img} that will be convolved in place */ public static < T extends NumericType< T >> void inNumericTypeInPlace( final double[] sigma, final Img< T > img, final OutOfBoundsFactory< T, RandomAccessibleInterval< T > > outofbounds ) { inNumericType( sigma, Views.extend( img, outofbounds ), img, img, new Point( sigma.length ), img.factory() ); }
/** * Computes a Gaussian convolution with any precision on an entire {@link Img} using the {@link OutOfBoundsMirrorFactory} with single boundary * * WARNING: This is a very slow implementation as it is not written for {@link NativeType}. If your type is {@link NativeType}, * use {@link GaussNativeType} instead! * * @param sigma - the sigma for the convolution * @param input - the input {@link Img} */ public GaussGeneral( final double[] sigma, final Img<T> input ) { this( sigma, Views.extend( input, new OutOfBoundsMirrorFactory< T, Img<T> >( Boundary.SINGLE ) ), input, input.factory(), input.firstElement().createVariable() ); }
/** * Computes a Gaussian convolution with any precision on an entire {@link Img} using the {@link OutOfBoundsMirrorFactory} with single boundary * * @param sigma - the sigma for the convolution * @param input - the input {@link Img} */ public GaussNativeType( final double[] sigma, final Img<T> input ) { this( sigma, Views.extend( input, new OutOfBoundsMirrorFactory< T, Img<T> >( Boundary.SINGLE ) ), input, input.factory(), input.firstElement().createVariable() ); }
@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); } }