Leadtools.ImageProcessing.Core Namespace : KaufmannRegionCommand Class |
public class KaufmannRegionCommand : Leadtools.ImageProcessing.RasterCommand, Leadtools.ImageProcessing.IRasterCommand
'Declaration Public Class KaufmannRegionCommand Inherits Leadtools.ImageProcessing.RasterCommand Implements Leadtools.ImageProcessing.IRasterCommand
'Usage Dim instance As KaufmannRegionCommand
public sealed class KaufmannRegionCommand : Leadtools.ImageProcessing.IRasterCommand
function Leadtools.ImageProcessing.Core.KaufmannRegionCommand()
public ref class KaufmannRegionCommand : public Leadtools.ImageProcessing.RasterCommand, Leadtools.ImageProcessing.IRasterCommand
Public Sub KaufmannRegionCommandExample() Dim codecs As New RasterCodecs() codecs.ThrowExceptionsOnInvalidImages = True Dim leadImage As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "IMAGE3.dcm")) ' Prepare the command Dim startPoint As LeadPoint = New LeadPoint((leadImage.Width \ 2), (leadImage.Height \ 2)) ' apply the command in order to get the pixels count of the first region. Dim KaufmannCommandInner As KaufmannRegionCommand = New KaufmannRegionCommand KaufmannCommandInner.CombineMode = RasterRegionCombineMode.Set KaufmannCommandInner.MaximumInput = 110 KaufmannCommandInner.MinimumInput = 54 KaufmannCommandInner.Radius = 21 KaufmannCommandInner.RegionStart = startPoint KaufmannCommandInner.RegionThreshold = 13 KaufmannCommandInner.RemoveHoles = True KaufmannCommandInner.Run(leadImage) Dim firstPixelCount As Integer = KaufmannCommandInner.PixelsCount ' apply the command once more. Dim KaufmannCommandOuter As KaufmannRegionCommand = New KaufmannRegionCommand(29, 51, 229, 207, startPoint, True, RasterRegionCombineMode.Set) KaufmannCommandOuter.Run(leadImage) Dim secondPixelCount As Integer = KaufmannCommandOuter.PixelsCount ' print the ratio between the first and the second region. Dim result As Double = (firstPixelCount * 1.0 / secondPixelCount) MessageBox.Show(result.ToString()) End Sub Public NotInheritable Class LEAD_VARS Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images" End Class
public void KaufmannRegionCommandExample() { // Load an image RasterCodecs codecs = new RasterCodecs(); codecs.ThrowExceptionsOnInvalidImages = true; RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Image3.dcm")); // Prepare the command LeadPoint startPoint = new LeadPoint((image.Width / 2), (image.Height / 2)); // apply the command in order to get the pixels count of the first region. KaufmannRegionCommand KaufmannCommandInner = new KaufmannRegionCommand(); KaufmannCommandInner.CombineMode = RasterRegionCombineMode.Set; KaufmannCommandInner.MaximumInput = 110; KaufmannCommandInner.MinimumInput = 54; KaufmannCommandInner.Radius = 21; KaufmannCommandInner.RegionStart = startPoint; KaufmannCommandInner.RegionThreshold = 13; KaufmannCommandInner.RemoveHoles = true; KaufmannCommandInner.Run(image); int firstPixelCount = KaufmannCommandInner.PixelsCount; // apply the command once more. KaufmannRegionCommand KaufmannCommandOuter = new KaufmannRegionCommand(29, 51, 229, 207, startPoint, true, RasterRegionCombineMode.Set); KaufmannCommandOuter.Run(image); int secondPixelCount = KaufmannCommandOuter.PixelsCount; // print the ratio between the first and the second region. double result = (firstPixelCount * 1.0 / secondPixelCount); MessageBox.Show(result.ToString()); } static class LEAD_VARS { public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images"; }
function KaufmannRegionCommandExample() { var codecs = new Leadtools.Codecs.RasterCodecs(); codecs.throwExceptionsOnInvalidImages = true; // Load the image var srcFileName = "Assets\\image3.dcm"; return Tools.AppInstallFolder().getFileAsync(srcFileName).then(function (loadFile) { return codecs.loadAsync(Leadtools.LeadStreamFactory.create(loadFile)); }).then(function (image) { // Prepare the command with (Leadtools.ImageProcessing.Core) { var startPoint = Leadtools.LeadPointHelper.create((image.width / 2), (image.height / 2)); // apply the command in order to get the pixels count of the first region. var KaufmannCommandInner = new KaufmannRegionCommand(); KaufmannCommandInner.combineMode = Leadtools.RasterRegionCombineMode.set; KaufmannCommandInner.maximumInput = 110; KaufmannCommandInner.minimumInput = 54; KaufmannCommandInner.radius = 21; KaufmannCommandInner.regionStart = startPoint; KaufmannCommandInner.regionThreshold = 13; KaufmannCommandInner.removeHoles = true; KaufmannCommandInner.run(image); var firstPixelCount = KaufmannCommandInner.pixelsCount; // apply the command once more. var KaufmannCommandOuter = new KaufmannRegionCommand(29, 51, 229, 207, startPoint, true, Leadtools.RasterRegionCombineMode.set); KaufmannCommandOuter.run(image); var secondPixelCount = KaufmannCommandOuter.pixelsCount; // print the ratio between the first and the second region. var result = (firstPixelCount * 1.0 / secondPixelCount); console.error(result.toString()); } }); }
[TestMethod] public async Task KaufmannRegionCommandExample() { // Load an image RasterCodecs codecs = new RasterCodecs(); codecs.ThrowExceptionsOnInvalidImages = true; // Load the image string srcFileName = @"Assets\Image3.dcm"; StorageFile loadFile = await Tools.AppInstallFolder.GetFileAsync(srcFileName); RasterImage image = await codecs.LoadAsync(LeadStreamFactory.Create(loadFile)); // Prepare the command LeadPoint startPoint = LeadPointHelper.Create((image.Width / 2), (image.Height / 2)); // apply the command in order to get the pixels count of the first region. KaufmannRegionCommand KaufmannCommandInner = new KaufmannRegionCommand(); KaufmannCommandInner.CombineMode = RasterRegionCombineMode.Set; KaufmannCommandInner.MaximumInput = 110; KaufmannCommandInner.MinimumInput = 54; KaufmannCommandInner.Radius = 21; KaufmannCommandInner.RegionStart = startPoint; KaufmannCommandInner.RegionThreshold = 13; KaufmannCommandInner.RemoveHoles = true; KaufmannCommandInner.Run(image); int firstPixelCount = KaufmannCommandInner.PixelsCount; // apply the command once more. KaufmannRegionCommand KaufmannCommandOuter = new KaufmannRegionCommand(29, 51, 229, 207, startPoint, true, RasterRegionCombineMode.Set); KaufmannCommandOuter.Run(image); int secondPixelCount = KaufmannCommandOuter.PixelsCount; // print the ratio between the first and the second region. double result = (firstPixelCount * 1.0 / secondPixelCount); Debug.WriteLine(result.ToString()); }
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
KaufmannRegionCommand Members
Leadtools.ImageProcessing.Core Namespace
Leadtools.ImageProcessing.Color.ChangeIntensityCommand
Leadtools.ImageProcessing.Color.GammaCorrectCommand
Leadtools.ImageProcessing.Color.ChangeContrastCommand
Leadtools.ImageProcessing.Color.StretchIntensityCommand
Leadtools.ImageProcessing.Color.RemapIntensityCommand
Leadtools.ImageProcessing.Color.ChangeHueCommand
Leadtools.ImageProcessing.Color.ChangeSaturationCommand
Leadtools.ImageProcessing.Color.HistogramEqualizeCommand
WindowLevelCommand Class
Leadtools.ImageProcessing.Color.HistogramContrastCommand
Leadtools.ImageProcessing.Color.ColorLevelCommand
Leadtools.ImageProcessing.Effects.GaussianCommand
Leadtools.ImageProcessing.Effects.RegionHolesRemovalCommand