Class BoxBlurFilter
java.lang.Object
com.xinapse.filter.AbstractKernelFilter
com.xinapse.filter.FixedWeightsKernelFilter
com.xinapse.filter.BoxBlurFilter
- All Implemented Interfaces:
SpatialFilter
A
FixedWeightsKernelFilter for performing a blurring of an image with a
box filter.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA FilterSpecifierPanel for a Box blur filter.Nested classes/interfaces inherited from interface SpatialFilter
SpatialFilter.SpecifierPanel -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.commons.cli.OptionCommand line option for setting the size for a BoxBlurFilter.static final intThe maximum size in any dimension of a BoxBlurFilter.static final FixedWeightsKernelFilterA 3-D BoxBlurFilter with 11x11x11.static final FixedWeightsKernelFilterA 3-D BoxBlurFilter with 3x3x3 kernel.static final FixedWeightsKernelFilterA 3-D BoxBlurFilter with 5x5x5 kernel.static final FixedWeightsKernelFilterA 3-D BoxBlurFilter with 7x7x7 kernel.static final FixedWeightsKernelFilterA 3-D BoxBlurFilter with 9x9x9 kernel.static final FixedWeightsKernelFilterA 2-D BoxBlurFilter with 11x11 kernel.static final FixedWeightsKernelFilterA 2-D BoxBlurFilter with 3x3 kernel.static final FixedWeightsKernelFilterA 2-D BoxBlurFilter with 5x5 kernel.static final FixedWeightsKernelFilterA 2-D BoxBlurFilter with 7x7 kernel.static final FixedWeightsKernelFilterA 2-D BoxBlurFilter with 9x9 kernel.Fields inherited from interface SpatialFilter
FILTERING_STRING -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetName()Returns the human-readable name of this filter.static StringReturns the name of this type of filter when specifying it in program optional arguments.static org.apache.commons.cli.OptionsReturns the options for this type of filter.static SpatialFilter.SpecifierPanelgetSpecifierPanel(String preferencesNodeName) Returns a SpatialFilter.SpecifierPanel that can be used to set the parameters for a BoxBlurFilter.static voidRuns a self-test of this class.static BoxBlurFilternewInstance(int[] size) Creates a newBoxBlurFiltersuitable for blurring an image with the given pixel sizes.static BoxBlurFilternewInstance(int[] size, BoundaryCondition bc) Creates a newBoxBlurFiltersuitable for blurring an image with the given pixel sizes.static BoxBlurFilternewInstance(ReadableImage image, int[] size) Creates a newBoxBlurFiltersuitable for blurring the supplied image.static BoxBlurFilternewInstance(ReadableImage image, int[] size, BoundaryCondition bc) Creates a newBoxBlurFiltersuitable for blurring the supplied image.static BoxBlurFilternewInstance(org.apache.commons.cli.CommandLine commandLine, ReadableImage image) Creates a newBoxBlurFilterusing the supplied command line arguments, suitable for blurring the supplied image.Methods inherited from class FixedWeightsKernelFilter
add, add, convolve, copyResize, filterInPlaceBinary, filterInPlaceByte, filterInPlaceDouble, filterInPlaceFloat, filterInPlaceFloat, filterInPlaceInt, filterInPlaceLong, filterInPlaceShort, filterInPlaceUByte, filterInPlaceUInt, filterInPlaceUShort, getFlatKernelWeights, getNKernelCols, getNKernelRows, getNKernelSlices, getWeights, scale, sumWeights, toImage, toStringMethods inherited from class AbstractKernelFilter
filter, filter, filter, filterInPlace, filterInPlace, filterInPlace, filterInPlace, filterInPlace, filterInPlace, filterInPlaceMethods inherited from interface SpatialFilter
filter, filter, filterInPlace, filterInPlace, filterInPlace, filterInPlace
-
Field Details
-
MAX_SIZE
public static final int MAX_SIZEThe maximum size in any dimension of a BoxBlurFilter.- See Also:
-
THREE_D_BOX_3
A 3-D BoxBlurFilter with 3x3x3 kernel. -
THREE_D_BOX_5
A 3-D BoxBlurFilter with 5x5x5 kernel. -
THREE_D_BOX_7
A 3-D BoxBlurFilter with 7x7x7 kernel. -
THREE_D_BOX_9
A 3-D BoxBlurFilter with 9x9x9 kernel. -
THREE_D_BOX_11
A 3-D BoxBlurFilter with 11x11x11. -
TWO_D_BOX_3
A 2-D BoxBlurFilter with 3x3 kernel. -
TWO_D_BOX_5
A 2-D BoxBlurFilter with 5x5 kernel. -
TWO_D_BOX_7
A 2-D BoxBlurFilter with 7x7 kernel. -
TWO_D_BOX_9
A 2-D BoxBlurFilter with 9x9 kernel. -
TWO_D_BOX_11
A 2-D BoxBlurFilter with 11x11 kernel. -
BOX_BLUR_SIZE_OPTION
public static final org.apache.commons.cli.Option BOX_BLUR_SIZE_OPTIONCommand line option for setting the size for a BoxBlurFilter.
-
-
Method Details
-
newInstance
public static BoxBlurFilter newInstance(org.apache.commons.cli.CommandLine commandLine, ReadableImage image) throws InvalidArgumentException Creates a newBoxBlurFilterusing 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 (unused).- Returns:
- a new
BoxBlurFilter. - Throws:
InvalidArgumentException- if the arguments are malformed.
-
newInstance
public static BoxBlurFilter newInstance(ReadableImage image, int[] size) throws InvalidArgumentException Creates a newBoxBlurFiltersuitable 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. Not used.size- the size of the Box blurring filter in each spatial dimension of the image.sizemay 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
BoxBlurFilter. - Throws:
InvalidArgumentException- if any of the size values are non-positive, or greater than MAX_SIZE, or if the array length is incorrect.
-
newInstance
public static BoxBlurFilter newInstance(ReadableImage image, int[] size, BoundaryCondition bc) throws InvalidArgumentException Creates a newBoxBlurFiltersuitable for blurring the supplied image.- Parameters:
image- the image to which this filter is designed to apply. Not used.size- the size of the Box blurring filter in each spatial dimension of the image.sizemay 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- theBoundaryConditioncontition to apply at the edges of the image.- Returns:
- a new
BoxBlurFilter. - Throws:
InvalidArgumentException- if any of the size values are non-positive, or greater than MAX_SIZE, or if the array length is incorrect.
-
newInstance
Creates a newBoxBlurFiltersuitable for blurring an image with the given pixel sizes. A BoundaryCondition.FIXED is used with a fixed value of zero.- Parameters:
size- the size of the Box blurring filter in each spatial dimension of the image.sizemay 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
BoxBlurFilter. - Throws:
InvalidArgumentException- if any of the size values are non-positive, or greater than MAX_SIZE, or if the array length is incorrect.
-
newInstance
public static BoxBlurFilter newInstance(int[] size, BoundaryCondition bc) throws InvalidArgumentException Creates a newBoxBlurFiltersuitable for blurring an image with the given pixel sizes.- Parameters:
size- the size of the Box blurring filter in each spatial dimension of the image.sizemay 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- theBoundaryConditioncontition to apply at the edges of the image.- Returns:
- a new
BoxBlurFilter. - Throws:
InvalidArgumentException- if any of the size values are non-positive, or greater than MAX_SIZE, or if the array length is incorrect.
-
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 BoxBlurFilter.- 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).
-