virtual L_INT LBitmap::MultiScaleEnhancement (uContrast, uEdgeLevels, uEdgeCoeff, uLatitudeLevels, uLatitudeCoeff, uFlags)
Enhances an image's 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.
Fraction of contrast enhancement applied to the image. Valid value range is from 0 to 10000, interpreted as 0% - 100%. This value is internally divided by 10000. Greater values will produce stronger contrast.
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.
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.
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.
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.
Flags that determine function behavior.
|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.|
|MSE_DONTUSE_MULTITHREADING||[0x0040] Do not use multi-threading (Use this with single-core CPUs).|
|MSE_DEFAULT||[-1] Use the default level value (which is 5).|
|MSE_GAUSSIAN||[0x0000] Use Gaussian filter.|
|MSE_RESAMPLE||[0x0001] Use resample filter.|
|MSE_BICUBIC||[0x0002] Use bicubic filter.|
|MSE_NORMAL||[0x0003] Use normal filter.|
|SUCCESS||The function was successful.|
|< 1||An error occurred. Refer to Return Codes.|
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
latitude reduction (use
uLatitudeCoeff are available for advanced users. Using
MSE_DEFAULT would give the maximum enhancements.
MSE_DEFAULT is defined as (
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.
L_INT LBitmap__MultiScaleEnhancementBitmapExample(LBitmap *pLeadBitmap)
/* This example applies multiscale enhancement. */
// Apply multiscale enhancement
return pLeadBitmap->MultiScaleEnhancement( 2000, 4, MSE_DEFAULT , 0, 0, MSE_GAUSSIAN | MSE_EDGEENH);
Medical Web Viewer .NET
.NET, Java, Android, and iOS/macOS Assemblies
C API/C++ Class Libraries