LBitmap::MultiScaleEnhancement

#include "ltwrappr.h"

virtual L_INT LBitmap::MultiScaleEnhancement (uContrast, uEdgeLevels, uEdgeCoeff, uLatitudeLevels, uLatitudeCoeff, uFlags)

L_UINT uContrast;

/* amount of contrast enhancement */

L_UINT uEdgeLevels;

/* number of levels used in edge enhancement */

L_UINT uEdgeCoeff;

/* degree of edge enhancement */

L_UINT uLatitudeLevels;

/* number of levels used in latitude reduction */

L_UINT uLatitudeCoeff;

/* degree of latitude reduction */

L_UINT uFlags;

/* flags that determine function behavior */

Enhances an images contrast, edges, and density range for use in Computed Radiography (CR), in a way that all relevant image features are rendered with an appropriate level of visibility.

Parameter

Description

uContrast

Fraction of contrast enhancement applied to the image. Valid values range from 0 10000, which are interpreted as 0% - 100%. This value is internally divided by 10000. Greater values will produce stronger contrast.

uEdgeLevels

The number of levels that will be used for edge enhancement. Valid values are from 1 to the maximum number of levels of the image. MSE_DEFAULT will use the default number of levels (which is 3). This option will take effect only if the MSE_EDGEENH is set in the uFlags. Passing zero will return an error code.

uEdgeCoeff

The edge enhancement coefficient. This value will be internally divided by 100. Pass MSE_DEFAULT to use the default values (which is 170 interpreted as 1.7). This option will be used only if the MSE_EDGEENH is set in the uFlags. Any value (>= 0) is valid. A value of 100 will be interpreted as 1.0 and will keep the bitmaps edges un-enhanced. Larger values will produce more visible edges. Smaller values will produce less visible edges. Practically, the enhancement levels out at 200000 (interpreted as 2000.0) values bigger than that will not enhance the bitmaps edges any more.

uLatitudeLevels

The number of levels that will be used for Latitude reduction. Valid values are from 1 to maximum number of levels of the image. You can also pass MSE_DEFAULT to use the default level value (which is 5). This option will be used only if the MSE_LATRED is set in uFlags. Passing zero will return an error code.

uLatitudeCoeff

The latitude reduction coefficient. This value will be internally divided by 100. Pass MSE_DEFAULT to use the default values (which is 140 interpreted as 1.4). This option will be used only if the MSE_LATRED is set in uFlags. Any value (>= 0) is valid. A value of 100 will be interpreted as 1.0 and will keep the bitmaps latitude un-enhanced. Decreasing latitude makes the bitmap brighter, increasing latitude makes the bitmap dimmer. Practically, the enhancement levels out at 200000 (interpreted as 2000,0) values bigger than that will not decrease the bitmaps latitude any more.

uFlags

Flags that determine function behavior.

 

You can specify none, one or both of the following values:

 

Value

Meaning

 

MSE_EDGEENH

[0x0010] Add edge enhancement option to the function. When this flag is set, the uEdgeLevels and uEdgeCoeff parameters will be used.

 

MSE_LATRED

[0x0020] Add latitude reduction option to the function. When this flag is set, uLatitudeLevel and uLatitudeCoeff will be used.

 

You must also specify one of the following values:

 

Value

Meaning

 

MSE_GAUSSIAN

[0x0000] Use Gaussian filter.

 

MSE_RESAMPLE

[0x0001] Use resample filter.

 

MSE_BICUBIC

[0x0002] Use bicubic filter.

 

MSE_NORMAL

[0x0003] Use normal filter.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

The function wraps techniques of image enhancements, such as contrast enhancement, edge enhancement and latitude reduction, for Computed Radiography (CR).

In multi scale enhancement, the image is decomposed into components or levels. Those components or levels that contain details will be enhanced separately from other components or levels.

This will improve the visualization for the subtle image features without the risk of losing information of other features.

To find the number of levels in any image follow this equation:

uMaxLevels = ceil( log( max(pBitmap->Width, pBitmap->Height)) / log(2));

The function will consider values larger than 10000 for uContrast as if they were 10000. If the user passed 0 then image contrast will not be improved.

Best results are obtained if uContrast is in the range of 15% ~ 30%. The larger the value the stronger the enhancement will be. Any stronger enhancement than 30% will reveal noise and no new enhancement will be noticed.

User can further enhance the image with:

edge enhancements (use MSE_EDGEENH) and/or

latitude reduction (use MSE_LATRED)

uEdgeLevels, uEdgeCoeff, uLatitudeLevels and uLatitudeCoeff are available for advanced users. Using MSE_DEFAULT would give the maximum enhancements. MSE_DEFAULT is defined as (L_UINT)1

To update a status bar or detect a user interrupt during execution of this function, refer to LBase::EnableStatusCallback.

This function supports 12 and 16-bit grayscale and 48 and 64-bit color images. Support for 12 and 16-bit grayscale and 48 and 64-bit color images is available only in the Document/Medical toolkits. It also can process the whole image or a region of the image. If a bitmap has a region, the effect is applied only to the region.

This function supports signed data images.

This function does not support 32-bit grayscale images. It returns the error code ERROR_GRAY32_UNSUPPORTED if a 32-bit grayscale image is passed to this function.

Required DLLs and Libraries

LTIMG

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

Platforms

Win32, x64.

See Also

Functions:

LBitmap::ChangeIntensity, LBitmap::GammaCorrect, LBitmap::ChangeContrast, LBitmap::StretchIntensity, LBitmap::RemapIntensity, LBitmap::Invert, LBitmap::ChangeHue, LBitmap::ChangeSaturation, LBitmap::HistoEqualize, LBitmapBase::Fill, LBitmapBase::GetPixelColor, LBitmapBase::PutPixelColor, LBitmap::GetHistogram, LBitmap::WindowLevel, LBitmap::WindowLevelExt, LBitmap::HistoContrast, LBitmap::AddWeighted, LBitmap::Multiply, LBitmap::SelectiveColor, LBitmap::AllocFTArray, LBitmap::ChangeHueSatInt, LBitmap::ColorReplace, LBitmap::ColorThreshold, LBitmap::DirectionEdgeStatistical, LBitmap::FFT, LBitmap::FreeFTArray, LBitmap::FTDisplay, LBitmap::FrqFilter, LBitmap::FrqFilterMask, LBitmap::MathFunction, LBitmap::SubtractBackground, LBitmap::UserFilter, LBitmap::AdaptiveContrast, LBitmap::ApplyMathLogic, LBitmap::ColorIntensityBalance, LBitmap::ColorizeGray, LBitmap::ContBrightInt, LBitmap::DigitalSubtract, LBitmap::DynamicBinary, LBitmap::EdgeDetectEffect, LBitmap::FunctionalLight, LBitmap::SelectData, LBitmap::ShiftData, LBitmap::DirectionEdgeStatistical2

Topics:

Raster Image Functions: Filtering Images

 

Removing Noise

Example

L_INT LBitmap__MultiScaleEnhancementExample(LBitmap *pLeadBitmap) 
{
   
   /* This example applies multiscale enhancement. */
   // Apply multiscale enhancement
   return pLeadBitmap->MultiScaleEnhancement( 2000, 4, MSE_DEFAULT , 0, 0, MSE_GAUSSIAN | MSE_EDGEENH); 
}