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 c3733503dfe179d1852432e6c3c085bc8ad6485a..c951595b057e6ae4049c3aa7827f0a2cffd4e1e7 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 @@ -44,6 +44,7 @@ import net.imglib2.type.numeric.RealType; import net.imglib2.type.numeric.integer.UnsignedByteType; import net.imglib2.type.numeric.real.FloatType; import net.imglib2.util.ImgUtil; +import net.imglib2.util.Util; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -134,7 +135,8 @@ public class Pretreatment< T extends RealType< T > & NativeType< T > > */ private static < T extends RealType< T > & NativeType< T > > Img< FloatType > gaussianBlurFilterDenoising( RandomAccessibleInterval< T > input, ImgFactory< T > factory, double radius ) { - ImgFactory< FloatType > newImgFactory = factory.imgFactory( new FloatType() ); + Dimensions dimensions = new FinalDimensions( input.dimension( 0 ), input.dimension( 1 ), input.dimension( 2 ) ); + ImgFactory< FloatType > newImgFactory = Util.getArrayOrCellImgFactory(dimensions, new FloatType()); Img< FloatType > output = newImgFactory.create( input.dimensionsAsLongArray() ); Utils.gaussianConvolution_( input, output, new double[]{ radius, radius, 1 } ); return output; @@ -168,7 +170,7 @@ public class Pretreatment< T extends RealType< T > & NativeType< T > > } } - Img< UnsignedByteType > output_unbinned = Unbinning.run( i, i.factory(), bin ); + Img< UnsignedByteType > output_unbinned = Unbinning.run( i, bin ); ImageJFunctions.show( output_unbinned, "unbinned 1" ); } }