This algorithm smooths an image using the same box kernel as a lowpass filter. The filter's X, Y, and Z sizes
are user-defined.
The algorithm calculates the local mean in a given size window. For a window of size 2p+1 in X,
2q+1 in Y and 2r+1 in Z:
O(n,m,o)=1Kp∑i=−pq∑j=−qr∑k=−rI(n−i,m−j,o−k)
The K coefficient is the normalization factor:
K=1 if the result is not normalized;
K=(2p+1)(2q+1)(2r+1) otherwise.
Note: If the result is normalized, the output image has same type as the input. Else, it is upgraded
according to the Image type promotion rule.
// Command constructor.BoxFilter3d();/// Gets the inputImage parameter./// The input image.
std::shared_ptr< iolink::ImageView> inputImage()const;/// Sets the inputImage parameter./// The input image.void setInputImage( std::shared_ptr< iolink::ImageView> inputImage );/// Gets the kernelSizeX parameter./// The horizontal kernel size.int32_t kernelSizeX()const;/// Sets the kernelSizeX parameter./// The horizontal kernel size.void setKernelSizeX(constint32_t& kernelSizeX );/// Gets the kernelSizeY parameter./// The vertical kernel size.int32_t kernelSizeY()const;/// Sets the kernelSizeY parameter./// The vertical kernel size.void setKernelSizeY(constint32_t& kernelSizeY );/// Gets the kernelSizeZ parameter./// The depth kernel size.int32_t kernelSizeZ()const;/// Sets the kernelSizeZ parameter./// The depth kernel size.void setKernelSizeZ(constint32_t& kernelSizeZ );/// Gets the autoScale parameter./// The automatic intensity scaling mode.BoxFilter3d::AutoScale autoScale()const;/// Sets the autoScale parameter./// The automatic intensity scaling mode.void setAutoScale(constBoxFilter3d::AutoScale& autoScale );/// Gets the outputImage parameter./// The output image. Its dimensions are forced to the same values as the input. Its type is the same as the input if the normalization is set to yes, else the type is upgraded.
std::shared_ptr< iolink::ImageView> outputImage()const;/// Sets the outputImage parameter./// The output image. Its dimensions are forced to the same values as the input. Its type is the same as the input if the normalization is set to yes, else the type is upgraded.void setOutputImage( std::shared_ptr< iolink::ImageView> outputImage );// Method to launch the command.void execute();
# Property of the inputImage parameter.BoxFilter3d.input_image
# Property of the kernelSizeX parameter.BoxFilter3d.kernel_size_x
# Property of the kernelSizeY parameter.BoxFilter3d.kernel_size_y
# Property of the kernelSizeZ parameter.BoxFilter3d.kernel_size_z
# Property of the autoScale parameter.BoxFilter3d.auto_scale
# Property of the outputImage parameter.BoxFilter3d.output_image
// Method to launch the command.
execute()
// Command constructor.BoxFilter3d()// Property of the inputImage parameter.BoxFilter3d.inputImage
// Property of the kernelSizeX parameter.BoxFilter3d.kernelSizeX
// Property of the kernelSizeY parameter.BoxFilter3d.kernelSizeY
// Property of the kernelSizeZ parameter.BoxFilter3d.kernelSizeZ
// Property of the autoScale parameter.BoxFilter3d.autoScale
// Property of the outputImage parameter.BoxFilter3d.outputImage
// Method to launch the command.Execute()
Parameters
Parameter Name
Description
Type
Supported Values
Default Value
kernelSizeX
The horizontal kernel size.
Int32
>=1
3
kernelSizeY
The vertical kernel size.
Int32
>=1
3
kernelSizeZ
The depth kernel size.
Int32
>=1
3
inputImage
The input image.
Image
Binary, Grayscale or Multispectral
nullptr
autoScale
The automatic intensity scaling mode.
NO
The result is not normalized; it corresponds to the sum of the window elements.
YES
The result is automatically normalized by the number of elements of the kernel; it corresponds to the mean of the window elements.
Enumeration
YES
outputImage
The output image. Its dimensions are forced to the same values as the input. Its type is the same as the input if the normalization is set to yes, else the type is upgraded.
Image
nullptr
Parameter Name
Description
Type
Supported Values
Default Value
kernel_size_x
The horizontal kernel size.
int32
>=1
3
kernel_size_y
The vertical kernel size.
int32
>=1
3
kernel_size_z
The depth kernel size.
int32
>=1
3
input_image
The input image.
image
Binary, Grayscale or Multispectral
None
auto_scale
The automatic intensity scaling mode.
NO
The result is not normalized; it corresponds to the sum of the window elements.
YES
The result is automatically normalized by the number of elements of the kernel; it corresponds to the mean of the window elements.
enumeration
YES
output_image
The output image. Its dimensions are forced to the same values as the input. Its type is the same as the input if the normalization is set to yes, else the type is upgraded.
image
None
Parameter Name
Description
Type
Supported Values
Default Value
kernelSizeX
The horizontal kernel size.
Int32
>=1
3
kernelSizeY
The vertical kernel size.
Int32
>=1
3
kernelSizeZ
The depth kernel size.
Int32
>=1
3
inputImage
The input image.
Image
Binary, Grayscale or Multispectral
null
autoScale
The automatic intensity scaling mode.
NO
The result is not normalized; it corresponds to the sum of the window elements.
YES
The result is automatically normalized by the number of elements of the kernel; it corresponds to the mean of the window elements.
Enumeration
YES
outputImage
The output image. Its dimensions are forced to the same values as the input. Its type is the same as the input if the normalization is set to yes, else the type is upgraded.