Class GaussianBlurFilter

All Implemented Interfaces:
SpatialFilter

public class GaussianBlurFilter extends FixedWeightsKernelFilter implements SpatialFilter
A FixedWeightsKernelFilter for performing a Gaussian blurring of an image.
  • Field Details

    • THREE_D_GAUSS_3

      public static final FixedWeightsKernelFilter THREE_D_GAUSS_3
      A 3-D GaussianBlurFilter with an isotropic 3x3x3 kernel and a FWHM of 1.5 times the pixel size in each direction.
    • THREE_D_GAUSS_5

      public static final FixedWeightsKernelFilter THREE_D_GAUSS_5
      A 3-D GaussianBlurFilter with an isotropic 5x5x5 kernel and a FWHM of 2.5 times the pixel size.
    • THREE_D_GAUSS_7

      public static final FixedWeightsKernelFilter THREE_D_GAUSS_7
      A 3-D GaussianBlurFilter with an isotropic 7x7x7 kernel and a FWHM of 3.5 times the pixel size in each direction.
    • THREE_D_GAUSS_9

      public static final FixedWeightsKernelFilter THREE_D_GAUSS_9
      A 3-D GaussianBlurFilter with an isotropic 9x9x9 kernel and a FWHM of 5.5 times the pixel size in each direction.
    • THREE_D_GAUSS_11

      public static final FixedWeightsKernelFilter THREE_D_GAUSS_11
      A 3-D GaussianBlurFilter with an isotropic 11x11x11 kernel and a FWHM of 7.5 times the pixel size in each direction.
    • THREE_D_GAUSS_13

      public static final FixedWeightsKernelFilter THREE_D_GAUSS_13
      A 3-D GaussianBlurFilter with an isotropic 13x13x13 kernel and a FWHM of 9.5 times the pixel size in each direction.
    • TWO_D_GAUSS_3

      public static final FixedWeightsKernelFilter TWO_D_GAUSS_3
      A 2-D GaussianBlurFilter with an isotropic 3x3 kernel and a FWHM of 1.5 times the pixel size in each direction.
    • TWO_D_GAUSS_5

      public static final FixedWeightsKernelFilter TWO_D_GAUSS_5
      A 2-D GaussianBlurFilter with an isotropic 5x5 kernel and a FWHM of 2.5 times the pixel size.
    • TWO_D_GAUSS_7

      public static final FixedWeightsKernelFilter TWO_D_GAUSS_7
      A 2-D GaussianBlurFilter with an isotropic 7x7 kernel and a FWHM of 3.5 times the pixel size in each direction.
    • TWO_D_GAUSS_9

      public static final FixedWeightsKernelFilter TWO_D_GAUSS_9
      A 2-D GaussianBlurFilter with an isotropic 9x9 kernel and a FWHM of 5.5 times the pixel size in each direction.
    • TWO_D_GAUSS_11

      public static final FixedWeightsKernelFilter TWO_D_GAUSS_11
      A 2-D GaussianBlurFilter with an isotropic 11x11 kernel and a FWHM of 7.5 times the pixel size in each direction.
    • TWO_D_GAUSS_13

      public static final FixedWeightsKernelFilter TWO_D_GAUSS_13
      A 2-D GaussianBlurFilter with an isotropic 13x13 kernel and a FWHM of 9.5 times the pixel size in each direction.
    • BLUR_FWHM

      public static final org.apache.commons.cli.Option BLUR_FWHM
      A public Option to specify that the FWHM of an isotropic Gaussian blur filter.
    • FWHM_OPTION

      public static final org.apache.commons.cli.Option FWHM_OPTION
      Command line option for setting the full-width-half-maximum values for a GaussianBlurFilter.
  • Method Details

    • newInstance

      public static GaussianBlurFilter newInstance(org.apache.commons.cli.CommandLine commandLine, ReadableImage image) throws InvalidArgumentException
      Creates a new GaussianBlurFilter using the supplied command line arguments, suitable for blurring the supplied image.
      Parameters:
      commandLine - the command line from which a program is invoked.
      image - the image to which this filter is designed to apply. The image pixel sizes are used to determine the kernel weights.
      Returns:
      a new GaussianBlurFilter.
      Throws:
      InvalidArgumentException - if the arguments are malformed.
    • newInstance

      public static GaussianBlurFilter newInstance(ReadableImage image, float[] fwhm) throws InvalidArgumentException
      Creates a new GaussianBlurFilter suitable for blurring the supplied image. A BoundaryCondition.FIXED is used with a fixed value of zero.
      Parameters:
      image - the image to which this filter is designed to apply. The image pixel sizes are used to determine the kernel weights.
      fwhm - the full-width-half-maximum values for the Gaussian blurring function in each spatial dimension of the image. fwhm may be of length 2 (for a 2-D in-plane blur) or length 3 (for a 3-D blur). The first value in this array applies to the along-row (x) direction; the second value applies to the along-column (y) direction; and the third value (if present) applies to the through-slice (z) direction.
      Returns:
      a new GaussianBlurFilter.
      Throws:
      InvalidArgumentException - if any of the fwhm values area negative or if the array length is incorrect.
    • newInstance

      public static GaussianBlurFilter newInstance(ReadableImage image, float[] fwhm, BoundaryCondition bc) throws InvalidArgumentException
      Creates a new GaussianBlurFilter suitable for blurring the supplied image.
      Parameters:
      image - the image to which this filter is designed to apply. The image pixel sizes are used to determine the kernel weights.
      fwhm - the full-width-half-maximum values for the Gaussian blurring function in each spatial dimension of the image. fwhm may be of length 2 (for a 2-D in-plane blur) or length 3 (for a 3-D blur). The first value in this array applies to the along-row (x) direction; the second value applies to the along-column (y) direction; and the third value (if present) applies to the through-slice (z) direction.
      bc - the BoundaryCondition contition to apply at the edges of the image.
      Returns:
      a new GaussianBlurFilter.
      Throws:
      InvalidArgumentException - if any of the fwhm values area negative or if the array length is incorrect.
    • newInstance

      public static GaussianBlurFilter newInstance(float[] pixelSizes, float[] fwhm) throws InvalidArgumentException
      Creates a new GaussianBlurFilter suitable for blurring an image with the given pixel sizes. A BoundaryCondition.FIXED is used with a fixed value of zero.
      Parameters:
      pixelSizes - the pixels sizes of an image to which this filter can be applied. The image pixel sizes are used to determine the kernel weights. The first element of this array is the pixel width; the second is the pixel height; and the third is the slice thickness. For 2-D blurs, where fwhm has length 2, this array may have length 2 also.
      fwhm - the full-width-half-maximum values for the Gaussian blurring function in each spatial dimension of the image. fwhm may be of length 2 (for a 2-D in-plane blur) or length 3 (for a 3-D blur). The first value in this array applies to the along-row (x) direction; the second value applies to the along-column (y) direction; and the third value (if present) applies to the through-slice (z) direction.
      Returns:
      a new GaussianBlurFilter.
      Throws:
      InvalidArgumentException - if any of the fwhm values area negative or if the array lengths are mismatched.
    • newInstance

      public static GaussianBlurFilter newInstance(float[] pixelSizes, float[] fwhm, BoundaryCondition bc) throws InvalidArgumentException
      Creates a new GaussianBlurFilter suitable for blurring an image with the given pixel sizes.
      Parameters:
      pixelSizes - the pixels sizes of an image to which this filter can be applied. The image pixel sizes are used to determine the kernel weights. The first element of this array is the pixel width; the second is the pixel height; and the third is the slice thickness. For 2-D blurs, where fwhm has length 2, this array may have length 2 also.
      fwhm - the full-width-half-maximum values for the Gaussian blurring function in each spatial dimension of the image. fwhm may be of length 2 (for a 2-D in-plane blur) or length 3 (for a 3-D blur). The first value in this array applies to the along-row (x) direction; the second value applies to the along-column (y) direction; and the third value (if present) applies to the through-slice (z) direction.
      bc - the BoundaryCondition contition to apply at the edges of the image.
      Returns:
      a new GaussianBlurFilter.
      Throws:
      InvalidArgumentException - if any of the fwhm values area negative or if the array lengths are mismatched.
    • getOptionName

      public static String getOptionName()
      Returns the name of this type of filter when specifying it in program optional arguments.
      Returns:
      the name of the filter for selection in program arguments.
    • getOptions

      public static org.apache.commons.cli.Options getOptions()
      Returns the options for this type of filter.
      Returns:
      the options for this type of filter.
    • getSpecifierPanel

      public static SpatialFilter.SpecifierPanel getSpecifierPanel(String preferencesNodeName)
      Returns a SpatialFilter.SpecifierPanel that can be used to set the parameters for a GaussianBlurFilter.
      Parameters:
      preferencesNodeName - the preferences node name from which the initial settings will be taken.
      Returns:
      a SpatialFilter.SpecifierPanel to set the parameters for this type of filter.
    • getName

      public static String getName()
      Returns the human-readable name of this filter.
      Returns:
      the human-readable name of this filter.
    • main

      public static void main(String[] args)
      Runs a self-test of this class.
      Parameters:
      args - the program aguments (ignored).