/** * @return a {@link ConvolverFactory} producing {@link DoubleConvolverRealTypeBuffered}. */ public static < S extends RealType< S >, T extends RealType< T > > ConvolverFactory< S, T > factory() { return new ConvolverFactory< S, T >() { @Override public Runnable create( final double[] halfkernel, final RandomAccess< S > in, final RandomAccess< T > out, final int d, final long lineLength ) { return new DoubleConvolverRealTypeBuffered< S, T >( halfkernel, in, out, d, lineLength ); } }; }
/** * @return a {@link ConvolverFactory} producing * {@link ConvolverNativeTypeBuffered}. */ public static < T extends NumericType< T > & NativeType< T > > ConvolverFactoryNativeTypeBuffered< T > factory( final T type ) { return new ConvolverFactoryNativeTypeBuffered< T >( type ); }
@Override public Runnable create( final double[] halfkernel, final RandomAccess< S > in, final RandomAccess< T > out, final int d, final long lineLength ) { return new DoubleConvolverRealType< S, T >( halfkernel, in, out, d, lineLength ); } };
private static < T extends NumericType< T > & NativeType< T > > void convolveNativeType( final double[][] halfkernels, final RandomAccessible< T > source, final RandomAccessibleInterval< T > target, final ExecutorService service ) { final T type = Util.getTypeFromInterval( target ); final ConvolverFactory< T, T > convfac; if ( canUseBufferedConvolver( target, halfkernels ) ) convfac = ConvolverNativeTypeBuffered.factory( type ); else convfac = ConvolverNativeType.factory( type ); final ImgFactory< T > imgfac = getImgFactory( target, halfkernels, type ); convolve( halfkernels, source, target, convfac, convfac, convfac, convfac, imgfac, service ); }
/** * @return a {@link ConvolverFactory} producing {@link ConvolverNumericType}. */ public static < T extends NumericType< T > > ConvolverNumericTypeFactory< T > factory( final T type ) { return new ConvolverNumericTypeFactory< T >( type ); }
@Override public Runnable create( final double[] halfkernel, final RandomAccess< S > in, final RandomAccess< T > out, final int d, final long lineLength ) { return new FloatConvolverRealTypeBuffered< S, T >( halfkernel, in, out, d, lineLength ); } };
/** * @return a {@link ConvolverFactory} producing {@link ConvolverNativeType}. */ public static < T extends NumericType< T > & NativeType< T > > ConvolverFactoryNativeType< T > factory( final T type ) { return new ConvolverFactoryNativeType< T >( type ); }
@Override public Runnable create( final double[] halfkernel, final RandomAccess< S > in, final RandomAccess< T > out, final int d, final long lineLength ) { return new FloatConvolverRealType< S, T >( halfkernel, in, out, d, lineLength ); } };
@Override public Runnable create( final double[] halfkernel, final RandomAccess< T > in, final RandomAccess< T > out, final int d, final long lineLength) { return new ConvolverNumericType< T >( halfkernel, in, out, d, lineLength, type ); } }
@Override public Runnable create( final double[] halfkernel, final RandomAccess< T > in, final RandomAccess< T > out, final int d, final long lineLength ) { return new ConvolverNativeType< T >( halfkernel, in, out, d, lineLength, type ); } }
@Override public Runnable create( final double[] halfkernel, final RandomAccess< T > in, final RandomAccess< T > out, final int d, final long lineLength ) { return new ConvolverNativeTypeBuffered< T >( halfkernel, in, out, d, lineLength, type ); } }
public static < S, T > void convolve1d( final double[] halfkernel, final RandomAccessible< S > source, final RandomAccessibleInterval< T > target, final ConvolverFactory< S, T > convolverFactoryST ) { final long[] sourceOffset = new long[] { 1 - halfkernel.length }; convolveOffset( halfkernel, source, sourceOffset, target, target, 0, convolverFactoryST, 1, 1 ); }
private static < T extends NumericType< T > & NativeType< T > > void convolveNativeType( final double[][] halfkernels, final RandomAccessible< T > source, final RandomAccessibleInterval< T > target, final int numThreads ) { final T type = Util.getTypeFromInterval( target ); final ConvolverFactory< T, T > convfac; if ( canUseBufferedConvolver( target, halfkernels ) ) convfac = ConvolverNativeTypeBuffered.factory( type ); else convfac = ConvolverNativeType.factory( type ); final ImgFactory< T > imgfac = getImgFactory( target, halfkernels, type ); convolve( halfkernels, source, target, convfac, convfac, convfac, convfac, imgfac, type, numThreads ); }
@Override public Runnable create( final double[] halfkernel, final RandomAccess< S > in, final RandomAccess< T > out, final int d, final long lineLength ) { return new DoubleConvolverRealTypeBuffered< S, T >( halfkernel, in, out, d, lineLength ); } };
/** * @return a {@link ConvolverFactory} producing {@link ConvolverNativeTypeBuffered}. */ public static < T extends NumericType< T > & NativeType< T > > ConvolverFactoryNativeTypeBuffered< T > factory( final T type ) { return new ConvolverFactoryNativeTypeBuffered< T >( type ); }
@Override public Runnable create( final double[] halfkernel, final RandomAccess< S > in, final RandomAccess< T > out, final int d, final long lineLength ) { return new DoubleConvolverRealType< S, T >( halfkernel, in, out, d, lineLength ); } };
/** * @return a {@link ConvolverFactory} producing {@link ConvolverNumericType} * . */ public static < T extends NumericType< T > > ConvolverNumericTypeFactory< T > factory( final T type ) { return new ConvolverNumericTypeFactory< T >( type ); }
@Override public Runnable create( final double[] halfkernel, final RandomAccess< S > in, final RandomAccess< T > out, final int d, final long lineLength ) { return new FloatConvolverRealTypeBuffered< S, T >( halfkernel, in, out, d, lineLength ); } };
/** * @return a {@link ConvolverFactory} producing {@link ConvolverNativeType}. */ public static < T extends NumericType< T > & NativeType< T > > ConvolverFactoryNativeType< T > factory( final T type ) { return new ConvolverFactoryNativeType< T >( type ); }
@Override public Runnable create( final double[] halfkernel, final RandomAccess< S > in, final RandomAccess< T > out, final int d, final long lineLength ) { return new FloatConvolverRealType< S, T >( halfkernel, in, out, d, lineLength ); } };