#include "Ltimgcor.h"

L_LTIMGCOR_API L_INT L_TADAnisotropicDiffusion(pBitmap, nIterations, nLambda, nKappa, nFlags)


pointer to the bitmap handle

L_INT nIterations;

number of iterations the filter will perform

L_INT nLambda;

integration constant

L_INT nKappa;

gradient modulus threshold that controls conduction

L_UINT nFlags;

type of conduction to use

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




Pointer to the bitmap handle.


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


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


Gradient modulus threshold that controls 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.


The type of the conduction to use. The following values are  possible:

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.



The function was successful.

< 1

An error occurred. Refer to Return Codes.


Use the L_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 L_MedianFilterBitmap or L_GaussianFilterBitmap 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


For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.


Win32, x64.

See Also


L_SRADAnisotropicDiffusion, L_AnisotropicDiffusionBitmap, L_MedianFilterBitmap, L_GaussianFilterBitmap


Raster Image Functions: Filtering Images 


Removing Noise 

Detecting and Enhancing Edges and Lines


This example loads a bitmap and applies TADAnisotropicDiffusion.

L_INT TADAnisotropicDiffusionExample(L_VOID) 
    L_INT nRet; 
    BITMAPHANDLE LeadBitmap;   /* Bitmap handle to hold the loaded image. */ 
    /* Load the bitmap, keeping the bits per pixel of the file */ 
    nRet = L_LoadBitmap (MAKE_IMAGE_PATH(TEXT("IMAGE3.dcm")), &LeadBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL); 
    if(nRet != SUCCESS) 
        return nRet ; 
    /* Apply TADAnisotropicDiffusion filter */ 
    nRet = L_TADAnisotropicDiffusion(&LeadBitmap, 10, 14, 30, TAD_QUAD_FLUX); 
    if(nRet == SUCCESS) 
        nRet = L_SaveBitmap(MAKE_IMAGE_PATH(TEXT("Result.BMP")), &LeadBitmap, FILE_BMP, 24, 0, NULL); 
    //free bitmap 
        L_FreeBitmap(&LeadBitmap) ; 
    return nRet ; 

Help Version 20.0.2019.3.12
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2019 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help