From 1a8fedbc78c6e7bf1a8f2f4f8eb20937e261fa82 Mon Sep 17 00:00:00 2001 From: ctrebeau <ctrebeau@pasteur.fr> Date: Thu, 17 Oct 2024 14:35:36 +0200 Subject: [PATCH] Code cleanup --- .../steps/selection/pretreatment/Pretreatment.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/fr/pasteur/ida/zellige/steps/selection/pretreatment/Pretreatment.java b/src/main/java/fr/pasteur/ida/zellige/steps/selection/pretreatment/Pretreatment.java index 5b33412..c257cb2 100644 --- a/src/main/java/fr/pasteur/ida/zellige/steps/selection/pretreatment/Pretreatment.java +++ b/src/main/java/fr/pasteur/ida/zellige/steps/selection/pretreatment/Pretreatment.java @@ -28,19 +28,27 @@ */ package fr.pasteur.ida.zellige.steps.selection.pretreatment; +import io.scif.img.ImgOpener; import net.imglib2.RandomAccessible; import net.imglib2.RandomAccessibleInterval; +import net.imglib2.algorithm.convolution.fast_gauss.FastGauss; +import net.imglib2.algorithm.fft2.FFTConvolution; import net.imglib2.algorithm.gauss3.Gauss3; import net.imglib2.algorithm.stats.Normalize; import net.imglib2.converter.Converters; +import net.imglib2.converter.RealTypeConverters; import net.imglib2.converter.readwrite.RealFloatSamplerConverter; import net.imglib2.img.Img; import net.imglib2.img.ImgFactory; import net.imglib2.img.array.ArrayImgFactory; import net.imglib2.type.NativeType; +import net.imglib2.type.Type; import net.imglib2.type.numeric.RealType; +import net.imglib2.type.numeric.complex.ComplexFloatType; import net.imglib2.type.numeric.real.FloatType; import net.imglib2.util.ImgUtil; +import net.imglib2.util.RealSum; +import net.imglib2.view.IntervalView; import net.imglib2.view.Views; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -92,8 +100,9 @@ public class Pretreatment< T extends RealType< T > & NativeType< T > > * @return a new Img with normalize pixel intensity values. */ private static < T extends RealType< T > & NativeType< T > > Img< T > normalizeImage( - Img< T > image, ImgFactory< T > factory ) + RandomAccessibleInterval< T > image, ImgFactory< T > factory ) { + LOGGER.debug( "Staring normalization." ); Img< T > normalizedImage = factory.create( image ); ImgUtil.copy( image, normalizedImage ); T min = normalizedImage.firstElement().createVariable(); @@ -101,6 +110,7 @@ public class Pretreatment< T extends RealType< T > & NativeType< T > > T max = normalizedImage.firstElement().copy().createVariable(); max.setReal( 255 ); Normalize.normalize( normalizedImage, min, max ); + LOGGER.debug( "End of normalization." ); return normalizedImage; } -- GitLab