From a051e183cec73f6dd903d0eb6354a34de804e71c Mon Sep 17 00:00:00 2001 From: ctrebeau <ctrebeau@pasteur.fr> Date: Tue, 19 Nov 2024 14:22:06 +0100 Subject: [PATCH] Refactor --- .../java/fr/pasteur/ida/zellige/steps/Utils.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) 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 e0f751e..29c0929 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 ) { -- GitLab