public RasterColor[] GetLookupTable() @property (nonatomic, strong, readonly, nullable) NSArray<LTRasterColor *> *lookupTable public RasterColor[] getLookupTable();public void setLookupTable(RasterColor[] rasterColor[);
public:array<RasterColor>^ GetLookupTable();
def GetLookupTable(self):
An array of RasterColor structures which represent the lookup table (LUT) of this RasterImage.
The lookup table (LUT) is used when the value of UseLookupTable is set to true.
The 8-bit and 16-bit lookup tables are synchronized, so when you change one, the other is changed as well The 16-bit lookup table (GetLookupTable16) has more precision so it is recommended you use the 16-bit LUT instead of the 8-bit LUT.
LUT is also used for displaying extended Palette color image such as bit stored is 16-bit and LUT contains color value. This is typical of Ultra Sound image.
For more information, refer to Grayscale Images.
using Leadtools;using Leadtools.Codecs;using Leadtools.ImageProcessing;using Leadtools.ImageProcessing.Core;using Leadtools.ImageProcessing.Color;using Leadtools.Dicom;using Leadtools.Drawing;using Leadtools.Controls;using Leadtools.Svg;public void SetLookupTable(){DicomEngine.Startup();// Create a RasterCodecs class for saving out imagesRasterCodecs codecs = new RasterCodecs();// Load a datasetDicomDataSet ds = new DicomDataSet();ds.Load(Path.Combine(LEAD_VARS.ImagesDir, "DICOM", "image3.dcm"), DicomDataSetLoadFlags.None);// Get the image but do NOT auto-apply any of the LUTsDicomElement element = ds.FindFirstElement(null, DicomTag.PixelData, true);RasterImage image = ds.GetImage(element, 0, 16, RasterByteOrder.Gray, DicomGetImageFlags.None);image.UseLookupTable = true;// Save out the image without any LUTs applied. It should be blackcodecs.Save(image, Path.Combine(LEAD_VARS.ImagesDir, "BeforeSetLookupTable.bmp"), RasterImageFormat.Bmp, 8);// Create a LUTRasterColor[] lut = new RasterColor[(int)Math.Pow(2, 16)];// Get the Minimum and Maximum values so we can calculate appropriate LUT values.MinMaxValuesCommand cmdMinMax = new MinMaxValuesCommand();cmdMinMax.Run(image);int maxVal = cmdMinMax.MaximumValue;int minVal = cmdMinMax.MinimumValue;for (int i = 0; i < lut.Length; i++){lut[i].R = Convert.ToByte(Math.Min(255, ((i - minVal) * 255 / (maxVal - minVal))));lut[i].G = lut[i].R;lut[i].B = lut[i].R;}// Set the new lookup tableimage.SetLookupTable(lut);// Save out the image with the LUT applied. It should look normalcodecs.Save(image, Path.Combine(LEAD_VARS.ImagesDir, "DICOM", "AfterSetLookupTable.bmp"), RasterImageFormat.Bmp, 8);DicomEngine.Shutdown();}static class LEAD_VARS{public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images";}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
