@Override public ImgFactory< LongType > factory() { return counts.factory(); }
/** * Contructor of ExplicitDiffusionScheme, calls contructor * {@code ExplicitDiffusionScheme(RandomAccessibleInterval<T>, * RandomAccessibleInterval<FloatType>, ImgFactory<FloatType>)} and uses the * {@link ImgFactory} of the second Img as third parameter. * * @param input the input Img * @param D the diffusion tensor */ public ExplicitDiffusionScheme(final Img<T> input, final Img<FloatType> D) { this( input, D, D.factory() ); }
/** * Computes a convolution in Fourier space. * * @param image - the input {@link Img} to be convolved * @param kernel - the kernel {@link Img} for the convolution operation * @param fftImgFactory - the {@link ImgFactory} that is used to create the FFT's */ public FourierConvolution( final Img<T> image, final Img<S> kernel, final ImgFactory<ComplexFloatType> fftImgFactory ) { this( image, kernel, image.factory(), kernel.factory(), fftImgFactory ); }
/** * 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 FourierTransform( final Img<T> input, final S complexType ) throws IncompatibleTypeException { this ( input, input.factory().imgFactory( complexType ), complexType, PreProcessing.EXTEND_MIRROR_FADING, Rearrangement.REARRANGE_QUADRANTS, FFTOptimization.SPEED, 0.25f, 0.25f, 12 ); }
/** * This inverse FFT can be only done in place, if desired. All parameters need to be set using the set() methods of this class. * * @param fftImage - the input as {@link Img} * @param type - a Type instance for the output */ public InverseFourierTransform( final Img<S> fftImage, final T type ) throws IncompatibleTypeException { this( fftImage, fftImage.factory().imgFactory( type ), type, Rearrangement.REARRANGE_QUADRANTS, true, false, null, null ); }
/** * This inverse FFT can be only done in place, if desired. All parameters need to be set using the set() methods of this class. * * @param fftImage - the input as {@link Img} * @param type - a Type instance for the output */ public InverseFourierTransform( final Img<S> fftImage, final T type ) throws IncompatibleTypeException { this( fftImage, fftImage.factory().imgFactory( type ), type, Rearrangement.REARRANGE_QUADRANTS, true, false, null, null ); }
/** * @deprecated This is for compatability with old API only. */ @Deprecated public RandomAccessibleInterval< O > compute( Img< I > img, Img< O > r ) { m_outFactory = r.factory(); return compute(img, r); }
public FourierTransform( final Img<T> input, final S complexType, final Rearrangement rearrangement ) throws IncompatibleTypeException { this ( input, input.factory().imgFactory( complexType ), complexType ); setRearrangement( rearrangement ); }
public FourierTransform( final Img<T> input, final S complexType, final OutOfBoundsFactory<T, RandomAccessibleInterval<T>> outOfBounds ) throws IncompatibleTypeException { this ( input, input.factory().imgFactory( complexType ), complexType ); this.outOfBounds = outOfBounds; setPreProcessing( PreProcessing.USE_GIVEN_OUTOFBOUNDSSTRATEGY ); }
public FourierTransform( final Img<T> input, final S complexType, final Rearrangement rearrangement ) throws IncompatibleTypeException { this ( input, input.factory().imgFactory( complexType ), complexType ); setRearrangement( rearrangement ); }
public FourierTransform( final Img<T> input, final S complexType, final FFTOptimization fftOptimization ) throws IncompatibleTypeException { this ( input, input.factory().imgFactory( complexType ), complexType ); setFFTOptimization( fftOptimization ); }
static private final <T extends RealType<T>> RandomAccessibleInterval<T> process(final Img<T> img, final int beginRadius, final int endRadius) throws Exception { net.imglib2.algorithm.fft.Bandpass<T> bp = new net.imglib2.algorithm.fft.Bandpass<T>(img, beginRadius, endRadius, img.factory()); if (!bp.checkInput() || !bp.process()) { throw new Exception(bp.getClass().getSimpleName() + " failed: " + bp.getErrorMessage()); } return bp.getResult(); } }
/** * 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() ); }
@Override public Img< O > createEmptyOutput( Img< I > in ) { try { return in.factory().imgFactory( m_outType ).create( in, m_outType ); } catch ( IncompatibleTypeException e ) { return new ArrayImgFactory< O >().create( in, m_outType ); } }
/** * This inverse FFT can be only done in place, if desired. * * @param fftImage - the input as {@link Img} * @param forwardTransform - the ForwardTransform ({@link FourierTransform}) which still has all parameters * @param type - a Type instance for the output */ public InverseFourierTransform( final Img<S> fftImage, final FourierTransform<?,?> forwardTransform, final T type ) throws IncompatibleTypeException { this ( fftImage, fftImage.factory().imgFactory( type ), type, forwardTransform.getRearrangement(), true, true, forwardTransform.getFFTInputSize(), forwardTransform.getFFTInputOffset() ); }
@Override public Labeling< LL > create( final long[] dim ) { return new NativeImgLabeling< LL, I >( img.factory().create( dim, img.firstElement().createVariable() ) ); } };
/** * This inverse FFT can be only done in place, if desired. * * @param fftImage - the input as {@link Img} * @param forwardTransform - the ForwardTransform ({@link FourierTransform}) which still has all parameters */ public InverseFourierTransform( final Img<S> fftImage, final FourierTransform<T,?> forwardTransform ) throws IncompatibleTypeException { this ( fftImage, fftImage.factory().imgFactory( forwardTransform.getImageType() ), forwardTransform.getImageType(), forwardTransform.getRearrangement(), true, true, forwardTransform.getFFTInputSize(), forwardTransform.getFFTInputOffset() ); }
protected < T extends BooleanType< T > > Img< T > calculate( final Img< T > source ) { final Img< T > target = source.factory().create( source ); final T extendedVal = source.firstElement().createVariable(); extendedVal.set( getExtendedValue() ); final ExtendedRandomAccessibleInterval< T, Img< T > > extended = Views.extendValue( source, extendedVal ); calculate( extended, target ); return target; }