An iterative filter that performs Tensor-guided Anisotropic Diffusion (TAD) in order to reduce noise while preserving the edges in the image.


#include "ltwrappr.h"

virtual L_INT LBitmap::TADAnisotropicDiffusion(nIterations, nLambda, nKappa, nFlags)


L_INT nIterations

Number of iterations the filter will perform. The default value is 10.

L_INT nLambda

An integer that represents the integration constant. The maximum value is 25. Lambda controls the speed of diffusion. Typically set it to the maximum (25). The default value is 14.

L_INT nKappa

Gradient modulus threshold that controls the conduction. The default value is 30. If Kappa is low, small intensity gradients are able to block conduction and hence diffusion across the step edges. A large value reduces the influence of intensity gradients on conduction.

L_UINT nFlags

The type of the conduction function to use in the filtering process. Possible values are:

Value Meaning
TAD_EXPON_FLUX [0x00000001] Use exponential flux, which favors high contrast edges over low contrast ones.
TAD_QUAD_FLUX [0x00000002] Use quadratic flux, which favors wide regions over smaller ones. This is the default value.


Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.


Use the LBitmap::TADAnisotropicDiffusion to reduce noise in images (more specifically, medical images).

LEADTOOLS offers three functions that implement anisotropic diffusion:

All three reduce noise and preserve edges and perform better than the LBitmap::MedianFilter or LBitmap::GaussianFilter functions. With the anisotropic functions, areas within regions are smoothed, but the edges are not affected.

The number of iterations controls the number of times the filter will be applied to an image. The lower the number of iterations, the faster the filter will perform. Higher iterations typically mean clearer results.

This function can only process the entire image. It does not support regions.

This function supports 8- and 16-bit grayscale images and 24- and 32-bit colored images.

This function supports signed/unsigned images.

Required DLLs and Libraries


Win32, x64.

See Also


#if defined (LEADTOOLS_V19_OR_LATER) 
L_INT LBitmap__TADAnisotropicDiffusionExample(L_VOID) 
    L_INT nRet; 
    LBitmap LeadBitmap; 
    nRet =LeadBitmap.Load(MAKE_IMAGE_PATH(TEXT("IMAGE3.dcm")), 0,ORDER_BGR); 
    if(nRet !=SUCCESS) 
        return nRet ; 
    /* Apply TADAnisotropicDiffusion filter */ 
    nRet = LeadBitmap.TADAnisotropicDiffusion(10, 14, 30, TAD_QUAD_FLUX); 
    return nRet ; 
Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help