←Select platform

WindowLevelExtCommand Constructor()

Summary
Initializes a new WindowLevelExtCommand class object with default parameters.
Syntax
C#
Objective-C
C++/CLI
Java
Python
- (instancetype)init 
public WindowLevelExtCommand(); 
public: 
WindowLevelExtCommand(); 
__init__() # Default constructor 
Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing; 
using Leadtools.ImageProcessing.Core; 
 
public void WindowLevelExtCommandExample() 
{ 
   // Load an image 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "IMAGE3.dcm")); 
 
   // Prepare the command 
   int x; 
   int y; 
   int Size; 
   RasterColor16[] LookupTable; 
 
   MinMaxBitsCommand MinMaxBits = new MinMaxBitsCommand(); 
   MinMaxValuesCommand MinMaxValues = new MinMaxValuesCommand(); 
   WindowLevelExtCommand command = new WindowLevelExtCommand(); 
 
   MinMaxBits.Run(image); 
   MinMaxValues.Run(image); 
 
   Size = (1 << (MinMaxBits.MaximumBit - MinMaxBits.MinimumBit + 1)); 
   LookupTable = new Leadtools.RasterColor16[Size]; 
 
   // fill the first half of the LookupTable with RED. 
   for (x = 0; x < Size / 2; x++) 
      LookupTable[x] = new Leadtools.RasterColor16(Leadtools.RasterColor16.MaximumComponent, 0, 0); 
 
   // fill the rest with gray values. 
   for (x = Size / 2; x < Size; x++) 
   { 
      y = (int)((x - MinMaxValues.MinimumValue) * Leadtools.RasterColor16.MaximumComponent / (MinMaxValues.MaximumValue - MinMaxValues.MinimumValue)); 
      LookupTable[x] = new Leadtools.RasterColor16(y, y, y); 
   } 
 
   command.HighBit = MinMaxBits.MaximumBit; 
   command.LowBit = MinMaxBits.MinimumBit; 
   command.LookupTable = LookupTable; 
   command.Order = Leadtools.RasterByteOrder.Bgr; 
 
   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.