←Select platform

ApplyLinearVoiLookupTableCommand Class

Summary
Sets up the paint or paint and image processing methods window leveling options for a specific image through a linear transformation described by the window center and width.
Syntax
C#
VB
Objective-C
C++
Java
public class ApplyLinearVoiLookupTableCommand : RasterCommand 
Public Class ApplyLinearVoiLookupTableCommand  
   Inherits RasterCommand 
@interface LTApplyLinearVoiLookupTableCommand : LTRasterCommand 
public class ApplyLinearVoiLookupTableCommand extends RasterCommand 
public ref class ApplyLinearVoiLookupTableCommand : public RasterCommand   
Remarks

This command is available in the Document and Medical Imaging toolkits.

  • This class sets up the window-leveling options for paint or paint and image processing methods for a specific image through a linear transformation described by the window center and width. In the DICOM world, this remapping of the Lookup Table is referred to as "applying a linear VOI LookupTable (LookupTable)".
  • The DICOM standard states:
  • "Window Center and Window Width specify a linear conversion from stored pixel values (after any Modality LookupTable or Rescale Slope and Intercept specified in the IOD have been applied) to values to be displayed. Window Center contains the input value that is the center of the window. Window Width contains the width of the window." Refer to "VOI LookupTable (LookupTable) Module Attributes" in the DICOM standard for more details.
  • This class does not change the image data; it only updates the entries inside the image LookupTable.
  • It is best to always set the VoiLookupTableCommandFlags.UpdateMinMax flag.
  • In the DICOM world you must set the VoiLookupTableCommandFlags.ReverseOrder flag if the photometric interpretation of the image is "MONOCHROME1", where the minimum grayscale value is intended to be displayed as white after any VOI gray scale transformations have been performed.
  • This class supports 12 and 16-bit grayscale. Support for 12 and 16-bit grayscale is available only in the Document/Medical toolkits.
  • This command does not support 32-bit grayscale images.

For more information, refer to Changing Brightness and Contrast.

Example

Run the ApplyLinearVoiLookupTableCommand on an image.

C#
VB
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing.Core; 
 
public void ApplyLinearVoiLookupTableCommandExample() 
{ 
   // Load an image 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "IMAGE2.dcm")); 
 
   // Prepare the command 
   ApplyLinearVoiLookupTableCommand command = new ApplyLinearVoiLookupTableCommand(); 
   command.Flags = VoiLookupTableCommandFlags.None; 
   command.Center = 330.0; 
   command.Width = 600.0; 
   // Apply "Abdomen T1" window-level , high bit is assumed  
   // to be "11" and low bit "0.  
   command.Run(image); 
 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS21\Resources\Images"; 
} 
Imports Leadtools 
Imports Leadtools.Codecs 
Imports Leadtools.ImageProcessing.Core 
 
Public Sub ApplyLinearVoiLookupTableCommandExample() 
   Dim codecs As New RasterCodecs() 
   codecs.ThrowExceptionsOnInvalidImages = True 
 
   Dim leadImage As RasterImage = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "IMAGE2.dcm")) 
 
   ' Prepare the command 
   Dim command As ApplyLinearVoiLookupTableCommand = New ApplyLinearVoiLookupTableCommand 
   command.Flags = VoiLookupTableCommandFlags.None 
   command.Center = 330.0 
   command.Width = 600.0 
   ' Apply "Abdomen T1" window-level , high bit is assumed  
   ' to be "11" and low bit "0.  
   command.Run(leadImage) 
 
End Sub 
 
Public NotInheritable Class LEAD_VARS 
   Public Const ImagesDir As String = "C:\LEADTOOLS21\Resources\Images" 
End Class 
Requirements

Target Platforms

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

Leadtools.ImageProcessing.Core Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.