Setting modality LUT data and attributes Example for Visual Basic
' 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
Dim ModalityLUTAttributes As LModalityLUTAttributes
Dim iRet As Integer
Dim Data As Variant
Set ModalityLUTAttributes = LEADDICOM1.ModalityLUTAttributes
'No Modality LUT Sequence (0028,3000)
ModalityLUTAttributes.IsModalityLUTSequence = False
'Yes there is a rescale slope and intercept
ModalityLUTAttributes.IsRescaleSlopeIntercept = True
ModalityLUTAttributes.RescaleIntercept = -128
ModalityLUTAttributes.RescaleSlope = 1
ModalityLUTAttributes.RescaleType = "UNSPECIFIED"
' Delete the existing modality LUT,
' although we don't have to !
LEADDICOM1.DeleteModalityLUT (0)
'Set rescale slope and intercept
iRet = LEADDICOM1.SetModalityLUT (Data, 0)