Getting palette color LUT data and attributes Example for VB.NET

'LEADDICOM1 is a DICOM Dataset defined outside this method
Private Sub GettingPaletteColorLUTDataAndAttributes()
   ' This example will retrieve the data under
   ' "Red Palette Color Lookup Table Data"(0028,1201)
   ' element and if the data is segmented it will get the data under
   ' "Segmented Red Palette Color Lookup Table Data" (0028,1221) and decode it
   Dim LUTData As Object
   ' Object that will hold Palette Color LUT attributes
   Dim PaletteColorLUTAttributes As LTDICLib.LPaletteColorLUTAttributes
   Dim iRet As Short

   ' Get "Palette Color Lookup Table" attributes
   iRet = LEADDICOM1.GetPaletteColorLUTAttributes(0)
   If (iRet <> 0) Then
      MessageBox.Show("error")
      Exit Sub
   End If
   PaletteColorLUTAttributes = LEADDICOM1.PaletteColorLUTAttributes
   ' Retrieve "Red Palette Color Lookup Table Data"
   ' This function will automatically decode the LUT data
   ' if it was segmented
   iRet = LEADDICOM1.GetPaletteColorLUTData(LUTData, LTDICLib.DicomPaletteColorLUTConstants.DICOM_PALETTE_COLOR_LUT_TYPE_RED, 0)
   'do something with vData '...
End Sub