Processing math: 100%
ImageDev

Despeckle3d

Smooths a three-dimensional image by replacing any aberrant voxel values by their neighbors mean value.

Access to parameter description

For an introduction to image filters: see Images Filtering.

For each voxel of the input image, mean μ and standard deviation σ values of a rectangular neighbor window are computed.
The output image value is then given by: O(i,j,k)={μ(i,j,k) if λ×|I(i,j,k)μ(i,j,k)|>σ(i,j,k)I(i,j,k) otherwise
Where λ is a user-defined threshold factor on the distance of the current voxel gray level to the mean of its neighbors, relative to their standard deviation.
The greater λ is, the stronger the blur.

This filter gives good results in the case of impulse noise.

See also

Function Syntax

This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > despeckle3d( std::shared_ptr< iolink::ImageView > inputImage, int32_t kernelSizeX, int32_t kernelSizeY, int32_t kernelSizeZ, double thresholdFactor, std::shared_ptr< iolink::ImageView > outputImage = NULL );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. Image Binary, Label, Grayscale or Multispectral nullptr
input
kernelSizeX
The horizontal kernel size in voxels (odd value). Int32 [3, 100] 3
input
kernelSizeY
The vertical kernel size in voxels (odd value). Int32 [3, 100] 3
input
kernelSizeZ
The depth kernel size in voxels (odd value). Int32 [3, 100] 3
input
thresholdFactor
The standard deviation threshold factor (must be a positive value). Float64 >0 1
output
outputImage
The output image. Its dimensions, type, and calibration are forced to the same values as the input. Image nullptr

Object Examples

auto foam = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam.vip" );

Despeckle3d despeckle3dAlgo;
despeckle3dAlgo.setInputImage( foam );
despeckle3dAlgo.setKernelSizeX( 3 );
despeckle3dAlgo.setKernelSizeY( 3 );
despeckle3dAlgo.setKernelSizeZ( 3 );
despeckle3dAlgo.setThresholdFactor( 1.0 );
despeckle3dAlgo.execute();

std::cout << "outputImage:" << despeckle3dAlgo.outputImage()->toString();

Function Examples

auto foam = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam.vip" );

auto result = despeckle3d( foam, 3, 3, 3, 1.0 );

std::cout << "outputImage:" << result->toString();