←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#
Objective-C
C++/CLI
Java
Python
public class ApplyLinearVoiLookupTableCommand : RasterCommand 
@interface LTApplyLinearVoiLookupTableCommand : LTRasterCommand 
public class ApplyLinearVoiLookupTableCommand 
    extends RasterCommand 
public ref class ApplyLinearVoiLookupTableCommand : public RasterCommand   
class ApplyLinearVoiLookupTableCommand(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#
Java
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:\LEADTOOLS23\Resources\Images"; 
} 
 
import static org.junit.Assert.assertTrue; 
 
import java.io.File; 
import java.io.IOException; 
import org.junit.*; 
import org.junit.runner.JUnitCore; 
import org.junit.runner.Result; 
import org.junit.runner.notification.Failure; 
 
import leadtools.*; 
import leadtools.codecs.*; 
import leadtools.imageprocessing.core.*; 
 
 
public void applyLinearVoiLookupTableCommandExample() { 
 
   final String LEAD_VARS_IMAGES_DIR = "C:\\LEADTOOLS23\\Resources\\Images"; 
 
   // Load an image 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.setThrowExceptionsOnInvalidImages(true); 
 
   RasterImage image = codecs.load(combine(LEAD_VARS_IMAGES_DIR, "DICOM\\Image1.dcm")); 
 
   // Prepare the command 
   ApplyLinearVoiLookupTableCommand command = new ApplyLinearVoiLookupTableCommand(); 
   command.setFlags(VoiLookupTableCommandFlags.NONE.getValue()); 
   command.setCenter(330.0); 
   command.setWidth(600.0); 
 
   // Apply "Abdomen T1" window-level , high bit is assumed 
   // to be "11" and low bit "0. 
   command.run(image); 
 
   // Save the image 
   String outputFileName = combine(LEAD_VARS_IMAGES_DIR, "image1Result.dcm"); 
   codecs.save(image, outputFileName, RasterImageFormat.DICOM_COLOR, 0); 
 
   assertTrue(new File(outputFileName).exists()); 
   System.out.println("Command run, image saved to " + outputFileName); 
 
} 
Requirements

Target Platforms

Help Version 23.0.2024.3.3
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 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.