LEADTOOLS Image Processing (Leadtools.ImageProcessing.Core assembly)
LEAD Technologies, Inc

CountLookupTableColorsExt Method

Example 





16-bit-bit lookup table array to be filled by this method.
Flag that indicates whether the LookupTable contains signed or unsigned data.
Gets the total number of entries between the start color and the end color, and the index of the last occurrence of the start color. The start and end colors are determined internally. .NET support WinRT support Silverlight support
Syntax
public static CountLookupTableColorsResult CountLookupTableColorsExt( 
   RasterColor16[] lookupTable,
   CountLookupTableColorsType type
)
'Declaration
 
Public Shared Function CountLookupTableColorsExt( _
   ByVal lookupTable() As RasterColor16, _
   ByVal type As CountLookupTableColorsType _
) As CountLookupTableColorsResult
'Usage
 
Dim lookupTable() As RasterColor16
Dim type As CountLookupTableColorsType
Dim value As CountLookupTableColorsResult
 
value = CoreUtilities.CountLookupTableColorsExt(lookupTable, type)
public static CountLookupTableColorsResult CountLookupTableColorsExt( 
   RasterColor16[] lookupTable,
   CountLookupTableColorsType type
)
 function Leadtools.ImageProcessing.Core.CoreUtilities.CountLookupTableColorsExt( 
   lookupTable ,
   type 
)
public:
static CountLookupTableColorsResult CountLookupTableColorsExt( 
   array<RasterColor16>^ lookupTable,
   CountLookupTableColorsType type
) 

Parameters

lookupTable
16-bit-bit lookup table array to be filled by this method.
type
Flag that indicates whether the LookupTable contains signed or unsigned data.
Remarks
Example
 
Public Sub CountLookupTableColorsExtExample()
   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 CountLookupTableColorsResult = CoreUtilities.CountLookupTableColorsExt(leadImage.GetLookupTable16, CountLookupTableColorsType.Signed)
   MessageBox.Show("First Index = " + command.FirstIndex.ToString + Chr(13) + "Number Of Entries = " + command.NumberOfEntries.ToString)

End Sub

Public NotInheritable Class LEAD_VARS
   Public Const ImagesDir As String = "C:\Users\Public\Documents\LEADTOOLS Images"
End Class
public void CountLookupTableColorsExtExample()
   {
      // Load an image
      RasterCodecs codecs = new RasterCodecs();
      codecs.ThrowExceptionsOnInvalidImages = true;

      RasterImage image = codecs.Load(Path.Combine(LEAD_VARS.ImagesDir, "Image2.dcm"));

      // Prepare the command
      CountLookupTableColorsResult command = CoreUtilities.CountLookupTableColorsExt(image.GetLookupTable16(), CountLookupTableColorsType.Signed);
      MessageBox.Show("First Index = " + command.FirstIndex + "\n" +
         "Number Of Entries = " + command.NumberOfEntries);

   }

static class LEAD_VARS
{
   public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";
}
//   [TestMethod]
//   public async Task CountLookupTableColorsExtExample()
//   {
//      // Load an image
//      RasterCodecs codecs = new RasterCodecs();
//      codecs.ThrowExceptionsOnInvalidImages = true;

//      // Load the image
//      string srcFileName = @"Assets\Image2.dcm";
//      StorageFile loadFile = await Tools.AppInstallFolder.GetFileAsync(srcFileName);
//      RasterImage image = await codecs.LoadAsync(LeadStreamFactory.Create(loadFile));

//      // Prepare the command
//      CountLookupTableColorsResult command = CoreUtilities.CountLookupTableColorsExt(image.GetLookupTable16(), CountLookupTableColorsType.Signed);
//      Debug.WriteLine("First Index = " + command.FirstIndex + "\n" +
//         "Number Of Entries = " + command.NumberOfEntries);

//   }
//
[TestMethod]
public async Task CountLookupTableColorsExtExample()
{
   // Load an image
   RasterCodecs codecs = new RasterCodecs();
   codecs.ThrowExceptionsOnInvalidImages = true;
   // Load the image
   string srcFileName = @"Assets\Image2.dcm";
   StorageFile loadFile = await Tools.AppInstallFolder.GetFileAsync(srcFileName);
   RasterImage image = await codecs.LoadAsync(LeadStreamFactory.Create(loadFile));

   // Prepare the command
   CountLookupTableColorsResult command = CoreUtilities.CountLookupTableColorsExt(image.GetLookupTable16(), CountLookupTableColorsType.Signed);
   Debug.WriteLine("First Index = " + command.FirstIndex + "\n" +
      "Number Of Entries = " + command.NumberOfEntries);

}
public void CountLookupTableColorsExtExample(RasterImage image)
{
   // Prepare the command
   CountLookupTableColorsResult command = CoreUtilities.CountLookupTableColorsExt(image.GetLookupTable16(), CountLookupTableColorsType.Signed);
   Debug.WriteLine("First Index = " + command.FirstIndex + "\n" +
      "Number Of Entries = " + command.NumberOfEntries);
   image.Dispose();
}
Public Sub CountLookupTableColorsExtExample(ByVal image As RasterImage)
   ' Prepare the command
   Dim command As CountLookupTableColorsResult = CoreUtilities.CountLookupTableColorsExt(image.GetLookupTable16(), CountLookupTableColorsType.Signed)
   Debug.WriteLine("First Index = " & command.FirstIndex + Constants.vbLf & "Number Of Entries = " & command.NumberOfEntries)
   image.Dispose()
End Sub
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

CoreUtilities Class
CoreUtilities Members
CountLookupTableColors Method
Detecting Registration Marks
WindowLevelCommand Class
Leadtools.RasterPalette.WindowLevelFillLookupTable(Leadtools.RasterColor[],Leadtools.RasterColor,Leadtools.RasterColor,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,Leadtools.RasterPaletteWindowLevelFlags)
Leadtools.ImageProcessing.Effects.EffectsUtilities.GetUserLookupTable(System.Int32[],Leadtools.LeadPoint[])
Leadtools.ImageProcessing.Color.RemapIntensityCommand
ApplyLinearVoiLookupTableCommand Class

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.