LBitmap::ShrinkWrapTool

#include "ltwrappr.h"

virtual L_INT LBitmap::ShrinkWrapTool(nThreshold, ptCenter, nRadius, uFlags)

L_INT nThreshold;

threshold used in the segmentation process

POINT ptCenter;

center of the rectangle or circle used to segment the object inside

L_INT nRadius;

radius of the rectangle/circle specified by the user

L_UINT uFlags;

flags that specifies which shape to use

Automatically segments a rectangular or circular area in the specified image using the specified threshold.

Parameter Description
nThreshold Threshold used in the segmentation process. Possible grayscale values range from 0 to 255. the efault value is 50.
ptCenter Center of the rectangle or circle used to segment the object inside.  All points inside the search area will be segmented.
nRadius Radius of the rectangular or circular search area. Do not exceed the length of the image diagonal. (If nRadius exceeds the length of the image diagonal, the value is adjusted to fit inside the image.)
uFlags Flags that specify the shape to be used. Possible values are:
Value Meaning
SHRINK_CIRCLE [0x00000008] Start shrinking from a circular-shaped region.
SHRINK_RECT [0x00000010] Start shrinking from a rectangular-shaped region.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

The result is applied to the image as a region.

This function was designed specifically to segment regions of cancer clusters in CT/MRI images.

The nRadius parameter should not exceed the length of the image diagonal.

This function does not support 32-bit grayscale images.

This function supports signed/unsigned images.

Required DLLs and Libraries

LTDIS
LTFIL
LTIMGCOR

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::OtsuThreshold, LBitmap::LevelsetBitmapRgn, LBitmap::LambdaConnectedness, LBitmap::WatershedBitmap, LBitmap::KMeansBitmapSegmentation, LBitmap::GWireGetMinPath, Class Members

Raster Image Functions: Image Analysis
Processing an Image

Example

#define MAKE_IMAGE_PATH(pFileName) TEXT("C:\\Users\\Public\\Documents\\LEADTOOLS Images\\")pFileName 
#if defined (LEADTOOLS_V19_OR_LATER) 
L_INT LBitmap__ShrinkWrapToolExample(L_VOID) 
{ 
   L_INT nRet; 
   LBitmap LeadBitmap ; 
   nRet = LeadBitmap.Load(MAKE_IMAGE_PATH(TEXT("IMAGE3.dcm")), 0,ORDER_BGR); 
   if(nRet !=SUCCESS) 
      return nRet ; 
   POINT Center ; 
   Center.x = 245 ; 
   Center.y = 230 ; 
   nRet = LeadBitmap.ShrinkWrapTool(60, Center, 10, SHRINK_RECT); 
   if(nRet !=SUCCESS) 
      return nRet; 
   return SUCCESS; 
} 
#endif // LEADTOOLS_V19_OR_LATER 

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Raster Imaging C++ Class Library Help