←Select platform

BackGroundRemovalCommand Class

Summary
Removes the background from an image by applying sigmoid curve to attenuate non-anatomic areas.
Syntax
C#
Objective-C
C++/CLI
Java
Python
public class BackGroundRemovalCommand : RasterCommand 
@interface LTBackGroundRemovalCommand : LTRasterCommand 
@interface LTBackGroundRemovalCommand : LTRasterCommand 
public class BackGroundRemovalCommand 
    extends RasterCommand 
public ref class BackGroundRemovalCommand : publicRasterCommand, RasterCommand 
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#
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:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

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

Leadtools.ImageProcessing.Core Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.