Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.Mrc
Public Sub CombineSegmentsExample()
' Load an image
Dim codecs As RasterCodecs = New RasterCodecs()
codecs.ThrowExceptionsOnInvalidImages = True
Dim image As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "MRCSegmentation.mrc"))
Dim segmenter As MrcSegmenter = New MrcSegmenter(image, Path.Combine(LEAD_VARS.ImagesDir, "MRCSegmentation.sgm"))
segmenter.CombineSegments(0, 1, MrcCombineSegmentFlags.CombineForce, 20)
End Sub
Public NotInheritable Class LEAD_VARS
Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"
End Class
using Leadtools;
using Leadtools.Codecs;
using Leadtools.Mrc;
public void CombineSegmentsExample()
{
// Load an image
RasterCodecs codecs = new RasterCodecs();
codecs.ThrowExceptionsOnInvalidImages = true;
RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir,"MRCSegmentation.mrc"));
MrcSegmenter segmenter = new MrcSegmenter(image,Path.Combine(LEAD_VARS.ImagesDir,"MRCSegmentation.sgm"));
segmenter.CombineSegments(0, 1, MrcCombineSegmentFlags.CombineForce, 20);
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";
}