剪切xld轮廓示例clip_contours_xld
By
admin
at 2019-04-22 • 0人收藏 • 2582人看过
import com; HOperatorSetX = com.CreateObject("{6ebd90e2-d219-11d2-ade5-0000c00f4ef9}") Image = HOperatorSetX.ReadImage( "img/angio-part" ); var Width , Height = HOperatorSetX.GetImageSize( Image ); var WindowHandle = HOperatorSetX.OpenWindow( 0 , 0 , mainForm.picturebox.width , mainForm.picturebox.height , mainForm.picturebox.hwnd , "transparent", "" ); HOperatorSetX.DispObj( Image , WindowHandle ); var Lines = HOperatorSetX.LinesGauss( Image, 2.3, 0.0, 0.7, 'dark', 'true', 'parabolic', 'true' ); //HOperatorSetX.SetColor( WindowHandle , "yellow" ); //HOperatorSetX.DispObj( Lines , WindowHandle ); Top = 200 Left = 100 Bottom = 300 Right = 200 var Rectangle = HOperatorSetX.GenRectangle1( Top, Left, Bottom, Right ); var AngioReduced = HOperatorSetX.ReduceDomain( Image, Rectangle ); var LinesClipped = HOperatorSetX.ClipContoursXld( Lines, Top, Left, Bottom, Right ); HOperatorSetX.SetColor( WindowHandle , "white" ); HOperatorSetX.SetDraw( WindowHandle , "margin" ); HOperatorSetX.DispObj( Rectangle , WindowHandle ); HOperatorSetX.SetColor( WindowHandle , "dim gray" ); HOperatorSetX.DispObj( Lines , WindowHandle ); HOperatorSetX.SetColor( WindowHandle , "yellow" ); HOperatorSetX.DispObj( LinesClipped , WindowHandle );
有时候我们只想用到取得的xld的一部分, 就可以利用这个函数.
同样的,有剪切region
登录后方可回帖