Skip to content
Snippets Groups Projects
Commit 187ddbee authored by Céline  TREBEAU's avatar Céline TREBEAU
Browse files

Bug fix

- Avoid NPE when the ImfFactory is a CellIMgFactory with null reader (https://github.com/scifio/scifio/issues/476)
parent e3e3fff9
No related branches found
No related tags found
1 merge request!41Resolve "Consider rescaling (binning) large images"
......@@ -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" );
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment