diff --git a/src/main/java/fr/pasteur/ida/zellige/steps/Utils.java b/src/main/java/fr/pasteur/ida/zellige/steps/Utils.java index e0f751eb975f02c609c622709bf790e20983a8d9..29c0929fe3dcffaa201c86dbe317d1dd8d6e9b98 100644 --- a/src/main/java/fr/pasteur/ida/zellige/steps/Utils.java +++ b/src/main/java/fr/pasteur/ida/zellige/steps/Utils.java @@ -28,12 +28,14 @@ */ package fr.pasteur.ida.zellige.steps; -import net.imglib2.RandomAccess; -import net.imglib2.RandomAccessible; -import net.imglib2.RandomAccessibleInterval; +import net.imglib2.*; import net.imglib2.algorithm.gauss3.Gauss3; +import net.imglib2.img.Img; import net.imglib2.type.NativeType; import net.imglib2.type.numeric.RealType; +import net.imglib2.type.numeric.real.FloatType; +import net.imglib2.view.IterableRandomAccessibleInterval; +import net.imglib2.view.RandomAccessibleIntervalCursor; import net.imglib2.view.Views; @@ -62,6 +64,14 @@ public class Utils Gauss3.gauss( sigma, infiniteInput, output ); } + public static < T extends RealType< T > & NativeType< T > > void + gaussianConvolution_( RandomAccessibleInterval< T > input, Img< FloatType > output, + double[] sigma ) + { + RandomAccessible< T > infiniteInput = Views.extendValue( input, input.randomAccess().get().getRealFloat() ); + Gauss3.gauss( sigma, infiniteInput, output ); + } + public static < T extends RealType< T > & NativeType< T > > void setPosition( RandomAccess< T > randomAccess, int u, int v ) {