Leadtools.ImageProcessing.Core Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
AutoSegmentCommand Class
See Also  Members   Example 
Leadtools.ImageProcessing.Core Namespace : AutoSegmentCommand Class



Performs automated segmentation of a rectangular area in the image specified by the user.

Syntax

Visual Basic (Declaration) 
Public Class AutoSegmentCommand 
   Inherits RasterCommand
   Implements IRasterCommand 
Visual Basic (Usage)Copy Code
Dim instance As AutoSegmentCommand
C# 
public class AutoSegmentCommand : RasterCommand, IRasterCommand  
C++/CLI 
public ref class AutoSegmentCommand : public RasterCommand, IRasterCommand  

Example

Runs the AutoSegmentCommand on the Image.

Visual BasicCopy Code
Public Sub AutoSegmentCommandExamples()
   RasterCodecs.Startup()
   Dim codecs As New RasterCodecs()
   codecs.ThrowExceptionsOnInvalidImages = True

   Dim leadImage As RasterImage = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "Master.jpg")

   ' Prepare the command
   Dim command As AutoSegmentCommand = New AutoSegmentCommand
   'Apply
   command.SegementationRectangle = New Rectangle(50, 100, 100, 150)
   command.Run(leadImage)

   RasterCodecs.Shutdown()
End Sub
C#Copy Code
public void AutoSegmentCommandExample() 

    // Load an image 
    RasterCodecs.Startup(); 
    RasterCodecs codecs = new RasterCodecs(); 
    codecs.ThrowExceptionsOnInvalidImages = true; 
 
    RasterImage image =codecs.Load( "D:\\Lead15\\images2\\LEADTOOLS Images\\Master.jpg"); 
 
    // Prepare the command 
    AutoSegmentCommand command = new AutoSegmentCommand(); 
    command.SegementationRectangle = new Rectangle(25, 25, 50, 100); 
    command.Run(image); 
 
    RasterCodecs.Shutdown(); 
}

Remarks

The result is applied to the image as a region. This function was designed specifically for CT/MRI images, to segment regions of cancer clusters.

  • Use MakeRegionEmpty to delete the resulting region.
  • The Rectangle must not exceed the borders of the image or the function will return an ERROR_INVALID_PARAMETER error and will not execute. This function is available only in the Document/Medical toolkits.
  • This command does not support 32-bit grayscale images.

Inheritance Hierarchy

System.Object
   Leadtools.ImageProcessing.RasterCommand
      Leadtools.ImageProcessing.Core.AutoSegmentCommand

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also