mpicbg.ij.util
Class Filter

java.lang.Object
  extended by mpicbg.ij.util.Filter

public class Filter
extends Object

Version:
0.2b
Author:
Stephan Saalfeld

Constructor Summary
Filter()
           
 
Method Summary
static void convolveSeparable(FloatProcessor input, float[] h, float[] v)
          Convolve an image with a horizontal and a vertical kernel simple straightforward, not optimized---replace this with a trusted better version soon
static FloatProcessor createConvolveSeparable(FloatProcessor input, float[] h, float[] v)
          Create a convolved image with a horizontal and a vertical kernel simple straightforward, not optimized---replace this with a trusted better version soon
static FloatProcessor createDownsampled(FloatProcessor source, double scale, float sourceSigma, float targetSigma)
          Create a downsampled FloatProcessor.
static ImageProcessor createDownsampled(ImageProcessor source, double scale, float sourceSigma, float targetSigma)
          Create a downsampled ImageProcessor.
static float[] createGaussianKernel(float sigma)
          Create a non-normalized 1d-Gaussian kernel of appropriate size.
static FloatProcessor[] createGradients(FloatProcessor array)
           
static float[] createNormalizedGaussianKernel(float sigma)
          Create a normalized 1d-Gaussian kernel of appropriate size.
static FloatProcessor createNormalizedShiftedGaussianKernel(float sigma, float offsetX, float offsetY)
          Create a non-normalized 2d-Gaussian impulse with appropriate size whose center is slightly shifted away from the middle.
static FloatProcessor createShiftedGaussianKernel(float sigma, float offsetX, float offsetY)
          Create a non-normalized 2d-Gaussian impulse with appropriate size whose center is slightly shifted away from the middle.
static void normalize(float[] data)
          Normalize data numerically such that the sum of all fields is 1.0
static ImageProcessor scale(ImageProcessor source, float scale)
          Scale an image with good quality in both up and down direction
static void smoothForScale(FloatProcessor source, double scale, float sourceSigma, float targetSigma)
          Smooth with a Gaussian kernel that represents downsampling at a given scale factor and sourceSigma.
static void smoothForScale(ImageProcessor source, double scale, float sourceSigma, float targetSigma)
          Smooth with a Gaussian kernel that represents downsampling at a given scale factor and sourceSigma.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Filter

public Filter()
Method Detail

normalize

public static final void normalize(float[] data)
Normalize data numerically such that the sum of all fields is 1.0

Parameters:
data -

createGaussianKernel

public static final float[] createGaussianKernel(float sigma)
Create a non-normalized 1d-Gaussian kernel of appropriate size.

Parameters:
sigma - Standard deviation (σ) of the Gaussian kernel
Returns:
Gaussian kernel of appropriate size

createNormalizedGaussianKernel

public static final float[] createNormalizedGaussianKernel(float sigma)
Create a normalized 1d-Gaussian kernel of appropriate size. Normalization is performed numerically such that the sum of all fields is 1.0. It turned out to be better to normalize with respect to the sum instead of the integral which would be per-field division by σ/√2π

Parameters:
sigma - Standard deviation (σ) of the Gaussian kernel
Returns:
Gaussian kernel of appropriate size

createShiftedGaussianKernel

public static final FloatProcessor createShiftedGaussianKernel(float sigma,
                                                               float offsetX,
                                                               float offsetY)
Create a non-normalized 2d-Gaussian impulse with appropriate size whose center is slightly shifted away from the middle.

Parameters:
sigma - Standard deviation (σ) of the Gaussian kernel
offsetX - horizontal center shift [0.0,0.5]
offsetY - vertical center shift [0.0,0.5]
Returns:

createNormalizedShiftedGaussianKernel

public static final FloatProcessor createNormalizedShiftedGaussianKernel(float sigma,
                                                                         float offsetX,
                                                                         float offsetY)
Create a non-normalized 2d-Gaussian impulse with appropriate size whose center is slightly shifted away from the middle. It turned out to be better to normalize with respect to the sum instead of the integral which would be per-field division by σ2/2π)

Parameters:
sigma - Standard deviation (σ) of the Gaussian kernel
Returns:
Gaussian kernel of appropriate size

createGradients

public static final FloatProcessor[] createGradients(FloatProcessor array)

createConvolveSeparable

public static final FloatProcessor createConvolveSeparable(FloatProcessor input,
                                                           float[] h,
                                                           float[] v)
Create a convolved image with a horizontal and a vertical kernel simple straightforward, not optimized---replace this with a trusted better version soon

Parameters:
input - the input image
h - horizontal kernel
v - vertical kernel
Returns:
convolved image

convolveSeparable

public static final void convolveSeparable(FloatProcessor input,
                                           float[] h,
                                           float[] v)
Convolve an image with a horizontal and a vertical kernel simple straightforward, not optimized---replace this with a trusted better version soon

Parameters:
input - the input image
h - horizontal kernel
v - vertical kernel

smoothForScale

public static final void smoothForScale(FloatProcessor source,
                                        double scale,
                                        float sourceSigma,
                                        float targetSigma)
Smooth with a Gaussian kernel that represents downsampling at a given scale factor and sourceSigma.


createDownsampled

public static final FloatProcessor createDownsampled(FloatProcessor source,
                                                     double scale,
                                                     float sourceSigma,
                                                     float targetSigma)
Create a downsampled FloatProcessor.

Parameters:
source - the source image
scale - scaling factor
sourceSigma - the Gaussian at which the source was sampled (guess 0.5 if you do not know)
targetSigma - the Gaussian at which the target will be sampled
Returns:
a new FloatProcessor

smoothForScale

public static final void smoothForScale(ImageProcessor source,
                                        double scale,
                                        float sourceSigma,
                                        float targetSigma)
Smooth with a Gaussian kernel that represents downsampling at a given scale factor and sourceSigma.


createDownsampled

public static final ImageProcessor createDownsampled(ImageProcessor source,
                                                     double scale,
                                                     float sourceSigma,
                                                     float targetSigma)
Create a downsampled ImageProcessor.

Parameters:
source - the source image
scale - scaling factor
sourceSigma - the Gaussian at which the source was sampled (guess 0.5 if you do not know)
targetSigma - the Gaussian at which the target will be sampled
Returns:
a new FloatProcessor

scale

public static final ImageProcessor scale(ImageProcessor source,
                                         float scale)
Scale an image with good quality in both up and down direction



Copyright © 2007-2016 Fiji. All Rights Reserved.