This algorithm is an edge-preserving smoothing filter. The intensity value at each voxel in an image is
replaced by a weighted average of intensity values from nearby voxels. Crucially, the weights depend on the
distance in color space from the considered voxel.
It preserves sharp edges by systematically excluding voxels across discontinuities from consideration:
O(i,j,k)=1K(i,j,k)nx2∑l=−nx2ny2∑m=−ny2nz2∑n=−nz2e(I(i,j,k)−I(l,m,n))2h2I(l,m,n) Where h is a weighting similarity factor and K is a local normalisation factor given by:
K(i,j,k)=nx2∑l=−nx2ny2∑m=−ny2nz2∑n=−nz2e(I(i,j,k)−I(l,m,n))2h2 The greater h is, the stronger the blur.
A filter mode parameter that allows this algorithm to switch to the SUSAN filter (Smallest Univalue Segment
Assimilating Nucleus).
The SUSAN filter reproduces bilateral filter behavior simply by excluding the central voxel from computation.
This filter gives better results in the case of impulse noise.
Reference: C.Tomasi, R.Manduchi. "Bilateral Filtering for Gray and Color Images". Sixth International Conference on
Computer Vision (IEEE Cat. No.98CH36271), Bombay, India, pp. 839-846, 1998.
// Command constructor.BilateralFilter3d();/// 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 in voxels (odd value).int32_t kernelSizeX()const;/// Sets the kernelSizeX parameter./// The horizontal kernel size in voxels (odd value).void setKernelSizeX(constint32_t& kernelSizeX );/// Gets the kernelSizeY parameter./// The vertical kernel size in voxels (odd value).int32_t kernelSizeY()const;/// Sets the kernelSizeY parameter./// The vertical kernel size in voxels (odd value).void setKernelSizeY(constint32_t& kernelSizeY );/// Gets the kernelSizeZ parameter./// The depth kernel size in voxels (odd value).int32_t kernelSizeZ()const;/// Sets the kernelSizeZ parameter./// The depth kernel size in voxels (odd value).void setKernelSizeZ(constint32_t& kernelSizeZ );/// Gets the similarity parameter./// The weighting similarity factor (must be a positive value).double similarity()const;/// Sets the similarity parameter./// The weighting similarity factor (must be a positive value).void setSimilarity(constdouble& similarity );/// Gets the filterMode parameter./// The way to consider the central pixel.BilateralFilter3d::FilterMode filterMode()const;/// Sets the filterMode parameter./// The way to consider the central pixel.void setFilterMode(constBilateralFilter3d::FilterMode& filterMode );/// Gets the outputImage parameter./// The output image. Its dimensions, type, and calibration are forced to the same values as the input.
std::shared_ptr< iolink::ImageView> outputImage()const;/// Sets the outputImage parameter./// The output image. Its dimensions, type, and calibration are forced to the same values as the input.void setOutputImage( std::shared_ptr< iolink::ImageView> outputImage );// Method to launch the command.void execute();
# Property of the inputImage parameter.BilateralFilter3d.input_image
# Property of the kernelSizeX parameter.BilateralFilter3d.kernel_size_x
# Property of the kernelSizeY parameter.BilateralFilter3d.kernel_size_y
# Property of the kernelSizeZ parameter.BilateralFilter3d.kernel_size_z
# Property of the similarity parameter.BilateralFilter3d.similarity
# Property of the filterMode parameter.BilateralFilter3d.filter_mode
# Property of the outputImage parameter.BilateralFilter3d.output_image
// Method to launch the command.
execute()
// Command constructor.BilateralFilter3d()// Property of the inputImage parameter.BilateralFilter3d.inputImage
// Property of the kernelSizeX parameter.BilateralFilter3d.kernelSizeX
// Property of the kernelSizeY parameter.BilateralFilter3d.kernelSizeY
// Property of the kernelSizeZ parameter.BilateralFilter3d.kernelSizeZ
// Property of the similarity parameter.BilateralFilter3d.similarity
// Property of the filterMode parameter.BilateralFilter3d.filterMode
// Property of the outputImage parameter.BilateralFilter3d.outputImage
// Method to launch the command.Execute()
Parameters
Parameter Name
Description
Type
Supported Values
Default Value
inputImage
The input image.
Image
Binary, Label, Grayscale or Multispectral
nullptr
kernelSizeX
The horizontal kernel size in voxels (odd value).
Int32
[3, 100]
3
kernelSizeY
The vertical kernel size in voxels (odd value).
Int32
[3, 100]
3
kernelSizeZ
The depth kernel size in voxels (odd value).
Int32
[3, 100]
3
similarity
The weighting similarity factor (must be a positive value).
Float64
>0
20
filterMode
The way to consider the central pixel.
BILATERAL
This mode corresponds to the standard bilateral filter (uses the central point).
SUSAN
This mode corresponds to the SUSAN filter (does not use the central point).
Enumeration
BILATERAL
outputImage
The output image. Its dimensions, type, and calibration are forced to the same values as the input.
Image
nullptr
Parameter Name
Description
Type
Supported Values
Default Value
input_image
The input image.
image
Binary, Label, Grayscale or Multispectral
None
kernel_size_x
The horizontal kernel size in voxels (odd value).
int32
[3, 100]
3
kernel_size_y
The vertical kernel size in voxels (odd value).
int32
[3, 100]
3
kernel_size_z
The depth kernel size in voxels (odd value).
int32
[3, 100]
3
similarity
The weighting similarity factor (must be a positive value).
float64
>0
20
filter_mode
The way to consider the central pixel.
BILATERAL
This mode corresponds to the standard bilateral filter (uses the central point).
SUSAN
This mode corresponds to the SUSAN filter (does not use the central point).
enumeration
BILATERAL
output_image
The output image. Its dimensions, type, and calibration are forced to the same values as the input.
image
None
Parameter Name
Description
Type
Supported Values
Default Value
inputImage
The input image.
Image
Binary, Label, Grayscale or Multispectral
null
kernelSizeX
The horizontal kernel size in voxels (odd value).
Int32
[3, 100]
3
kernelSizeY
The vertical kernel size in voxels (odd value).
Int32
[3, 100]
3
kernelSizeZ
The depth kernel size in voxels (odd value).
Int32
[3, 100]
3
similarity
The weighting similarity factor (must be a positive value).
Float64
>0
20
filterMode
The way to consider the central pixel.
BILATERAL
This mode corresponds to the standard bilateral filter (uses the central point).
SUSAN
This mode corresponds to the SUSAN filter (does not use the central point).
Enumeration
BILATERAL
outputImage
The output image. Its dimensions, type, and calibration are forced to the same values as the input.