←Select platform

BackGroundRemovalCommand Class

Summary

Removes the background from an image by applying sigmoid curve to attenuate non-anatomic areas.

Syntax
C#
VB
Java
Objective-C
C++
public class BackGroundRemovalCommand : RasterCommand 
Public Class BackGroundRemovalCommand 
InheritsRasterCommand 
ImplementsRasterCommand 
@interface LTBackGroundRemovalCommand : LTRasterCommand 
public class BackGroundRemovalCommand extends RasterCommand 
c+ + [C++ Syntax] 
public ref class BackGroundRemovalCommand : publicRasterCommand, RasterCommand 
public: 
   ref class BackGroundRemovalCommand : RasterCommand 

Remarks
  • This command is useful, especially with medical images and grayscale images, in reducing the values of the background area.
  • This command reduces background by matching the histgram of the input image to a predefined Sigmoid curve.
  • BGRemovalFactor property of this command affects the center of the applied Sigmoid curve.
  • In order to enhance anatomic areas, user needs to apply MultiscaleEnhancementCommand to the output of this command.
  • This command removes background by attenuating its values according to the lower half of the Sigmoid curve, whereas, SubtractBackgroundCommand subtracts the estimated background from the rolling ball algorithm.
  • This command supports 12 and 16 - bit grayscale and 48 and 64 - bit color images.Support for 12 and 16 - bit grayscale and 48 and 64 - bit color images is available only in theDocument / Medical toolkits.
  • This command does not support signed data images.
  • This command does not support 32 - bit grayscale images.

Example

Run theBackGroundRemovalCommand on an image.

C#
VB
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing.Core; 
 
public void BackGroundRemovalCommandExample() 
{ 
   // Load an image 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Image2.dcm")); 
 
   // Prepare the command 
   BackGroundRemovalCommand command = new BackGroundRemovalCommand(); 
   command.BGRemovalFactor = 600; 
   command.Run(image); 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images"; 
} 
Imports Leadtools 
Imports Leadtools.Codecs 
Imports Leadtools.ImageProcessing.Core 
 
Public Sub BackGroundRemovalCommandExample() 
   Dim codecs As New RasterCodecs() 
   codecs.ThrowExceptionsOnInvalidImages = True 
 
   Dim leadImage As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Clean.tif")) 
 
   ' Prepare the command 
   Dim command As BackGroundRemovalCommand = New BackGroundRemovalCommand 
   'Determine whether the image is blank. 
   command.BGRemovalFactor = 800 
 
   command.Run(leadImage) 
End Sub 
 
Public NotInheritable Class LEAD_VARS 
   Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images" 
End Class 

Requirements

Target Platforms

Help Version 20.0.2019.3.12
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2019 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.ImageProcessing.Core Assembly