Setting modality LUT data and attributes Example for VB.NET
'LEADDICOM1 is a DICOM Dataset defined outside this method
Private Sub TestSettingModalityLUTDataAndAttributes()
' 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 LTDICLib.LModalityLUTAttributes
Dim iRet As Short
Dim Data As Object
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)
End Sub