Setting modality LUT data and attributes Example for C++ 6.0 and later
// This example will set Rescale Intercept (0028,1052)
// element to -128.0 and Rescale Slope (0028,1053)
// element to 1.0
// Object that will hold modality LUT attributes
ILModalityLUTAttributesPtr pModalityLUTAttributes = NULL;
short iRet;
pModalityLUTAttributes = m_pLEADDicomDS->GetModalityLUTAttributes();
//No Modality LUT Sequence (0028,3000)
pModalityLUTAttributes->IsModalityLUTSequence = FALSE;
//Yes there is a rescale slope and intercept
pModalityLUTAttributes->IsRescaleSlopeIntercept = TRUE;
pModalityLUTAttributes->RescaleIntercept = -128.0f;
pModalityLUTAttributes->RescaleSlope = 1.0f;
pModalityLUTAttributes->RescaleType = "UNSPECIFIED";
// Delete the existing modality LUT,
// although we don't have to !
m_pLEADDicomDS->DeleteModalityLUT(0);
//Set rescale slope and intercept
VARIANT vData;
VariantInit(&vData);
iRet = m_pLEADDicomDS->SetModalityLUT (vData, 0);
return;