Getting modality LUT data and attributes Example for C#
//LEADDICOM1 is a DICOM Dataset defined outside this method
private void GettingModalityLUTDataAndAttributes()
{
// This example will retrieve the LUT Data (0028,3006)
// under the Modality LUT Sequence (0028,3000)
short Ret = 0;
// Object that will hold modality LUT attributes
LTDICLib.LModalityLUTAttributes MLUTAttributes = null;
// Get modality LUT attributes
Ret = LEADDICOM1.GetModalityLUTAttributes(0);
if (Ret != 0)
{
MessageBox.Show("error");
return;
}
MLUTAttributes = LEADDICOM1.ModalityLUTAttributes;
// If there is no modality LUT sequence then there is no data !
if (MLUTAttributes.IsModalityLUTSequence == false)
{
MessageBox.Show("No LUT");
return;
}
object Data = null; //
Retrieve the LUT Data (0028,3006) LEADDICOM1.
// Retrieve the
LUT Data (0028,3006) LEADDICOM1.GetModalityLUTData(ref
Data, 0);
// Do something with the data
}