SnnFilter3d
Performs an edge-preserving smoothing of a three-dimensional image with the Symmetric Nearest Neighbor filter.
Access to parameter description
For an introduction to image filters: Images Filtering.
This algorithm implements the Symmetric Nearest Neighbor filter (SNN), which is an average filter weighted by the structural symmetry of a rectangular neighborhood window. It computes a local mean around a central voxel x, considering for each neighbor voxel y, having a gray level I(y), the value given by:
I′(y)={I(y) if |I(x)−I(y)|<|I(x)−I(ys)|I(ys) if |I(x)−I(y)|>|I(x)−I(ys)|I(x) otherwise Where ys is the neighbor voxel symmetric to y with respect to x.
The output value of the voxel x is then given by: O(x)=μ[I′(y)] Where μ is the mean value of the local window.
See also
Access to parameter description
For an introduction to image filters: Images Filtering.
This algorithm implements the Symmetric Nearest Neighbor filter (SNN), which is an average filter weighted by the structural symmetry of a rectangular neighborhood window. It computes a local mean around a central voxel x, considering for each neighbor voxel y, having a gray level I(y), the value given by:
I′(y)={I(y) if |I(x)−I(y)|<|I(x)−I(ys)|I(ys) if |I(x)−I(y)|>|I(x)−I(ys)|I(x) otherwise Where ys is the neighbor voxel symmetric to y with respect to x.
The output value of the voxel x is then given by: O(x)=μ[I′(y)] Where μ is the mean value of the local window.
See also
Function Syntax
This function returns the outputImage output parameter.
// Function prototype. std::shared_ptr< iolink::ImageView > snnFilter3d( std::shared_ptr< iolink::ImageView > inputImage, int32_t kernelSizeX, int32_t kernelSizeY, int32_t kernelSizeZ, std::shared_ptr< iolink::ImageView > outputImage = NULL );
Class Syntax
Parameters
Class Name | SnnFilter3d |
---|
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 |
![]() |
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" ); SnnFilter3d snnFilter3dAlgo; snnFilter3dAlgo.setInputImage( foam ); snnFilter3dAlgo.setKernelSizeX( 3 ); snnFilter3dAlgo.setKernelSizeY( 3 ); snnFilter3dAlgo.setKernelSizeZ( 3 ); snnFilter3dAlgo.execute(); std::cout << "outputImage:" << snnFilter3dAlgo.outputImage()->toString();
Function Examples
auto foam = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam.vip" ); auto result = snnFilter3d( foam, 3, 3, 3 ); std::cout << "outputImage:" << result->toString();