Click or drag to resize

IMcDisplayDisplayLUT Property

A lookup table that can be used change the appearance of the display.

Namespace:  MediaCy.IQL.Display.Viewer
Assembly:  MediaCy.IQL.Display.Viewer (in MediaCy.IQL.Display.Viewer.dll) Version: 10.0.6912.0
Syntax
VB
Property DisplayLUT As Object
	Get
	Set

Property Value

Type: Object
Remarks
ImageToDisplay pixels may be passed through a Red, Green, Blue lookup table. On access this property will be either a length-2 array of Variant or an array of Long COLORREF values (packed Red, Green, Blue bytes, with Red being the least significant byte). If returned as a length-2 array of Variant, then the first element will be a length-2 array of double, giving the luminance limits over which the LUT is defined, while the second element will be the LUT as an array of COLORREF, as described above. On assignment, the property may be assigned from a Long array of COLORREF values, or from a Byte array of RGB triplets, or from an array of single Bytes. The length of this assigned array must be equal to the length of the array that the McLookupTable.ExtendedLutEx(mceltDisplay, FrameToDisplay) property exposes for the ImageToDisplay.LookupTable property (i.e., the McLookupTable.Length property). Note that in this case, you cannot assign a "trimmed" LUT, but only one that covers the full DisplayedImage RangeMin to RangeMax. The property may also be assigned from an object instance of type McLookupTables, McLookupTable, McImage or McPseudoColor. In the first three cases, the McLookupTable.ExtendedLutEx(mceltDisplay Or mceltTrimLutToActiveRange, FrameToDisplay) property is used as the LUT to assign. If the object is a McLookupTables, then McLookupTables.Item(0) is used. If the object is a McImage, then McImage.LookupTable is used; the McImage and the ImageToDisplay must be of the same bit depth or an error will result. If the assigned object is a McPseudoColor object, then the rules are more complex. This is because source channel values that fall outside of the McPseudoColor.IntensityRange are not pseudocolored. Instead, these pixels are either: 1) passed through the ImageToDisplay.LookupTable ExtendedLutEx( mceltDisplay Or mceltTrimLutToActiveRange, FrameToDisplay) if EnableResponseLUT is True at the time of the assignment, or 2) unchanged from the current LUT being used for Display if EnableResponseLUT is False at the time of the assignment (see Example code). Thus, you must set the McPseudoColor.IntensityRange before assigning it as the DisplayLUT if you wish to restrict the pseudocoloring to other than the full McImage.RangeMin/RangeMax.
Examples
VB
Option Explicit

Private Function uLoadExampleImage(Optional strImage As String = "BoneBig.jpg") As Boolean
    If MsgBox("Open example image?", vbYesNo) = vbYes Then
        Images.Open Path + "Images\" + strImage
    End If 'user wants to open an example image
    'Else leave the ActiveImage alone
    If ActiveImage Is Nothing Then
        MsgBox "There is no ActiveImage, so the example cannot run."
    End If
    uLoadExampleImage = ActiveImage Is Nothing
End Function 'uLoadExampleImage

Sub DifferentDisplayLutsInTwoWindows()
    uLoadExampleImage "GrayBlk.tif"
    ActiveWindow.Position = Array(10, 30)
    Dim VD1 As McDisplay, VD2 As McDisplay
    Set VD1 = ActiveWindow.View.Display
    With VD1
        .EnableResponseLUT = True
        .EnableDisplayLUT = False
        .DisplayLUT = Empty
    End With
    Windows.Add
    ActiveWindow.Position = Array(400, 30)
    Set VD2 = ActiveWindow.View.Display
        'Set LUT's to defaults
    With VD2
        .EnableResponseLUT = True
        .EnableDisplayLUT = False
        .DisplayLUT = Empty
    End With
        'Invert Luminace
    With ActiveImage.LookupTables
        .Item(0).Inverse = True
        .Realize
        MsgBox "Both windows should show inverted."
        VD1.EnableResponseLUT = False 'turn off Window 1 LookupTable
        MsgBox "Only window 2 should show inverted."
        Dim dupLUTs As McLookupTables
        Set dupLUTs = .Duplicate
        .Reset mclrmAll 'reset the LUT's, but not the duplicate
        VD1.EnableResponseLUT = True
        VD1.EnableDisplayLUT = True 'takes precedence over EnableResponseLUT
        VD1.DisplayLUT = dupLUTs 'Assign inverted LUT's to window 1 DisplayLUT
        MsgBox "Only window 1 should show inverted."

            ' create a new pseudo-color
        Dim pscNew As New McPseudoColor
        pscNew.Size = 256
        pscNew.IntensityRange = Array(50, 200) 'only color part of the range
        pscNew.ColorSpectrum = mccsRed
        pscNew.Visible = True
        VD2.EnableResponseLUT = False 'don't combine with LookupTable
        VD2.DisplayLUT = pscNew 'Assign pseudo color to window 2 DisplayLUT
        VD2.EnableDisplayLUT = True 'now show the pseudo color
        MsgBox "Window 2 should now show pseudocolored without inverted top and bottom."
        VD2.EnableResponseLUT = True 'turn on combining of PseudoColor with LookupTable
        .Item(0).Inverse = True 'make LookupTable inverted
        VD2.DisplayLUT = pscNew 'Assign pseudo color to window 2 DisplayLUT
        MsgBox "Window 2 should now show pseudocolored WITH inverted top and bottom."

        VD1.EnableDisplayLUT = False
        VD2.EnableDisplayLUT = False
        .Reset mclrmAll 'reset the LUT's
        MsgBox "Both windows should now show normally.  Both will close on OK."

    End With

    ActiveImage.Close 'close both windows

End Sub 'DifferentDisplayLutsInTwoWindows
See Also