Available in LEADTOOLS Medical Imaging toolkits. |
GetHistogramGray example for Visual Basic
'This example gets a histogram for a 12-bit or 16-bit grayscale image and then
'displays the number of occurrences of the brightest and darkest intensities
Private Sub Command4_Click()
Dim nRet As Integer
MsgBox "Table size before call to GetHistogramGray: " & LEAD1.HistogramGrayTableSize
nRet = LEAD1.GetHistogramGray
If nRet = 0 Then
LEAD1.GetMinMaxVal
MsgBox "Highest Intensity: 0x" & Hex(LEAD1.MaxVal) & " Count: " & LEAD1.HistogramGrayTable(LEAD1.MaxVal) _
& Chr(13) & "Lowest Intensity: 0x" & Hex(LEAD1.MinVal) & " Count: " & LEAD1.HistogramGrayTable(LEAD1.MinVal)
End If
MsgBox "Table size of current histogram: " & LEAD1.HistogramGrayTableSize
End Sub