use of net.imglib2.Localizable in project imagej-ops by imagej.
the class ColocalisationTest method gaussianSmooth.
/**
* Gaussian Smooth of the input image using intermediate float format.
*
* @param <T>
* @param img
* @param sigma
* @return
*/
public static <T extends RealType<T> & NativeType<T>> Img<T> gaussianSmooth(RandomAccessibleInterval<T> img, double[] sigma) {
Interval interval = Views.iterable(img);
ImgFactory<T> outputFactory = new ArrayImgFactory<T>();
final long[] dim = new long[img.numDimensions()];
img.dimensions(dim);
Img<T> output = outputFactory.create(dim, img.randomAccess().get().createVariable());
final long[] pos = new long[img.numDimensions()];
Arrays.fill(pos, 0);
Localizable origin = new Point(pos);
ImgFactory<FloatType> tempFactory = new ArrayImgFactory<FloatType>();
RandomAccessible<T> input = Views.extendMirrorSingle(img);
Gauss.inFloat(sigma, input, interval, output, origin, tempFactory);
return output;
}
Aggregations