Package com.xinapse.filter
Class GaussianBlurFilter
java.lang.Object
com.xinapse.filter.AbstractKernelFilter
com.xinapse.filter.FixedWeightsKernelFilter
com.xinapse.filter.GaussianBlurFilter
- All Implemented Interfaces:
SpatialFilter
A
FixedWeightsKernelFilter
for performing a Gaussian blurring of an image.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A FilterSpecifierPanel for a Gaussian blur filter.Nested classes/interfaces inherited from interface com.xinapse.filter.SpatialFilter
SpatialFilter.SpecifierPanel
-
Field Summary
Modifier and TypeFieldDescriptionstatic final org.apache.commons.cli.Option
A public Option to specify that the FWHM of an isotropic Gaussian blur filter.static final org.apache.commons.cli.Option
Command line option for setting the full-width-half-maximum values for a GaussianBlurFilter.static final FixedWeightsKernelFilter
A 3-D GaussianBlurFilter with an isotropic 11x11x11 kernel and a FWHM of 7.5 times the pixel size in each direction.static final FixedWeightsKernelFilter
A 3-D GaussianBlurFilter with an isotropic 13x13x13 kernel and a FWHM of 9.5 times the pixel size in each direction.static final FixedWeightsKernelFilter
A 3-D GaussianBlurFilter with an isotropic 3x3x3 kernel and a FWHM of 1.5 times the pixel size in each direction.static final FixedWeightsKernelFilter
A 3-D GaussianBlurFilter with an isotropic 5x5x5 kernel and a FWHM of 2.5 times the pixel size.static final FixedWeightsKernelFilter
A 3-D GaussianBlurFilter with an isotropic 7x7x7 kernel and a FWHM of 3.5 times the pixel size in each direction.static final FixedWeightsKernelFilter
A 3-D GaussianBlurFilter with an isotropic 9x9x9 kernel and a FWHM of 5.5 times the pixel size in each direction.static final FixedWeightsKernelFilter
A 2-D GaussianBlurFilter with an isotropic 11x11 kernel and a FWHM of 7.5 times the pixel size in each direction.static final FixedWeightsKernelFilter
A 2-D GaussianBlurFilter with an isotropic 13x13 kernel and a FWHM of 9.5 times the pixel size in each direction.static final FixedWeightsKernelFilter
A 2-D GaussianBlurFilter with an isotropic 3x3 kernel and a FWHM of 1.5 times the pixel size in each direction.static final FixedWeightsKernelFilter
A 2-D GaussianBlurFilter with an isotropic 5x5 kernel and a FWHM of 2.5 times the pixel size.static final FixedWeightsKernelFilter
A 2-D GaussianBlurFilter with an isotropic 7x7 kernel and a FWHM of 3.5 times the pixel size in each direction.static final FixedWeightsKernelFilter
A 2-D GaussianBlurFilter with an isotropic 9x9 kernel and a FWHM of 5.5 times the pixel size in each direction.Fields inherited from class com.xinapse.filter.FixedWeightsKernelFilter
weights
Fields inherited from class com.xinapse.filter.AbstractKernelFilter
bc
Fields inherited from interface com.xinapse.filter.SpatialFilter
N_DOTS
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getName()
Returns the human-readable name of this filter.static String
Returns the name of this type of filter when specifying it in program optional arguments.static org.apache.commons.cli.Options
Returns the options for this type of filter.static SpatialFilter.SpecifierPanel
getSpecifierPanel
(String preferencesNodeName) Returns a SpatialFilter.SpecifierPanel that can be used to set the parameters for a GaussianBlurFilter.static void
Runs a self-test of this class.static GaussianBlurFilter
newInstance
(float[] pixelSizes, float[] fwhm) Creates a newGaussianBlurFilter
suitable for blurring an image with the given pixel sizes.static GaussianBlurFilter
newInstance
(float[] pixelSizes, float[] fwhm, BoundaryCondition bc) Creates a newGaussianBlurFilter
suitable for blurring an image with the given pixel sizes.static GaussianBlurFilter
newInstance
(ReadableImage image, float[] fwhm) Creates a newGaussianBlurFilter
suitable for blurring the supplied image.static GaussianBlurFilter
newInstance
(ReadableImage image, float[] fwhm, BoundaryCondition bc) Creates a newGaussianBlurFilter
suitable for blurring the supplied image.static GaussianBlurFilter
newInstance
(org.apache.commons.cli.CommandLine commandLine, ReadableImage image) Creates a newGaussianBlurFilter
using the supplied command line arguments, suitable for blurring the supplied image.Methods inherited from class com.xinapse.filter.FixedWeightsKernelFilter
add, add, convolve, copyResize, filterInPlaceBinary, filterInPlaceByte, filterInPlaceDouble, filterInPlaceFloat, filterInPlaceFloat, filterInPlaceInt, filterInPlaceLong, filterInPlaceShort, filterInPlaceUByte, filterInPlaceUInt, filterInPlaceUShort, getFlatKernelWeights, getNKernelCols, getNKernelRows, getNKernelSlices, scale, sumWeights, toImage, toString
Methods inherited from class com.xinapse.filter.AbstractKernelFilter
filter, filter, filter, filterInPlace, filterInPlace, filterInPlace, filterInPlace, filterInPlace, filterInPlace, filterInPlace
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.xinapse.filter.SpatialFilter
filter, filter, filterInPlace, filterInPlace, filterInPlace, filterInPlace
-
Field Details
-
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
A 3-D GaussianBlurFilter with an isotropic 5x5x5 kernel and a FWHM of 2.5 times the pixel size. -
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
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
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
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
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
A 2-D GaussianBlurFilter with an isotropic 5x5 kernel and a FWHM of 2.5 times the pixel size. -
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
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
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
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_FWHMA public Option to specify that the FWHM of an isotropic Gaussian blur filter. -
FWHM_OPTION
public static final org.apache.commons.cli.Option FWHM_OPTIONCommand 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 newGaussianBlurFilter
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 newGaussianBlurFilter
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 newGaussianBlurFilter
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
- theBoundaryCondition
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 newGaussianBlurFilter
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 newGaussianBlurFilter
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
- theBoundaryCondition
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
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
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
Returns the human-readable name of this filter.- Returns:
- the human-readable name of this filter.
-
main
Runs a self-test of this class.- Parameters:
args
- the program aguments (ignored).
-