Getting palette color LUT data and attributes Example for C#

//LEADDICOM1 is a DICOM Dataset defined outside this method
private void 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
   object LUTData = null;
   // Object that will hold Palette Color LUT attributes
   LTDICLib.LPaletteColorLUTAttributes PaletteColorLUTAttributes = null;
   short iRet = 0;

   // Get "Palette Color Lookup Table" attributes
   iRet = LEADDICOM1.GetPaletteColorLUTAttributes(0);
   if (iRet != 0)
   {
      MessageBox.Show("error");
      return;
   }
   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(ref LUTData, LTDICLib.DicomPaletteColorLUTConstants.DICOM_PALETTE_COLOR_LUT_TYPE_RED, 0);
   //do something with vData
   //...
}