<div dir="ltr"><div class="markdown-here-wrapper" style=""><p style="margin:1.2em 0px!important">Hi everyone,</p>
<p style="margin:1.2em 0px!important">I’ve looked at other emails from the mailing list but have not found anything which explains the problem I’m having.</p>
<p style="margin:1.2em 0px!important">I have a vtkImageData object with scalars set as a <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">vtkUnsignedCharArray</code> ranging from 0 to 1. This volume represents rock porosity, with 0 meaning solid rock and 1 meaning a pore.</p>
<p style="margin:1.2em 0px!important">I’m using 3 <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">vtkImagePlaneWidget</code> instances, each along one axis, to show 3 plane cuts of the rock. </p>
<p style="margin:1.2em 0px!important">I’m trying to use a <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">vtkLookupTable</code> to show solid rock as black, and pore as white:</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code class="hljs language-python" style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important;display:block;overflow-x:auto;padding:0.5em;background:rgb(35,36,31);color:rgb(248,248,242)">lookup_table = vtk.vtkLookupTable()
lookup_table.SetNumberOfTableValues(<span class="hljs-number" style="color:rgb(174,129,255)">2</span>)
lookup_table.SetTableValue(<span class="hljs-number" style="color:rgb(174,129,255)">0</span>, (<span class="hljs-number" style="color:rgb(174,129,255)">0.</span>, <span class="hljs-number" style="color:rgb(174,129,255)">0.</span>, <span class="hljs-number" style="color:rgb(174,129,255)">0.</span>, <span class="hljs-number" style="color:rgb(174,129,255)">1.0</span>))
lookup_table.SetTableValue(<span class="hljs-number" style="color:rgb(174,129,255)">1</span>, (<span class="hljs-number" style="color:rgb(174,129,255)">1.</span>, <span class="hljs-number" style="color:rgb(174,129,255)">1.</span>, <span class="hljs-number" style="color:rgb(174,129,255)">1.</span>, <span class="hljs-number" style="color:rgb(174,129,255)">1.0</span>))
</code></pre>
<p style="margin:1.2em 0px!important">Unfortunately the planes appear as completely black. Changing the color values to other colors (say, first entry red and second entry blue) has no effect on the image. If I change the first table entry’s alpha value to zero though, I can then see the pores of the image as black, which shows that the data is correct and that the lookup table is being used. It seems that it is not using the RGB part of the lookup table somehow.</p>
<p style="margin:1.2em 0px!important">Here’s the relevant part of the code:</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code class="hljs language-python" style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important;display:block;overflow-x:auto;padding:0.5em;background:rgb(35,36,31);color:rgb(248,248,242)">self._plane_widgets = []

lookup_table = vtk.vtkLookupTable()
lookup_table.SetNumberOfTableValues(<span class="hljs-number" style="color:rgb(174,129,255)">2</span>)
lookup_table.SetTableValue(<span class="hljs-number" style="color:rgb(174,129,255)">0</span>, (<span class="hljs-number" style="color:rgb(174,129,255)">0.</span>, <span class="hljs-number" style="color:rgb(174,129,255)">0.</span>, <span class="hljs-number" style="color:rgb(174,129,255)">0.</span>, <span class="hljs-number" style="color:rgb(174,129,255)">1.0</span>))
lookup_table.SetTableValue(<span class="hljs-number" style="color:rgb(174,129,255)">1</span>, (<span class="hljs-number" style="color:rgb(174,129,255)">1.</span>, <span class="hljs-number" style="color:rgb(174,129,255)">0.</span>, <span class="hljs-number" style="color:rgb(174,129,255)">1.</span>, <span class="hljs-number" style="color:rgb(174,129,255)">1.0</span>))
lookup_table.SetTableRange(<span class="hljs-number" style="color:rgb(174,129,255)">0.</span>, <span class="hljs-number" style="color:rgb(174,129,255)">1.</span>)

<span class="hljs-keyword" style="color:rgb(249,38,114)">for</span> plane_name <span class="hljs-keyword" style="color:rgb(249,38,114)">in</span> [<span class="hljs-string" style="color:rgb(230,219,116)">'XY'</span>, <span class="hljs-string" style="color:rgb(230,219,116)">'XZ'</span>, <span class="hljs-string" style="color:rgb(230,219,116)">'YZ'</span>]:
    orientation = vtk_reslice_details.GetVtkPlaneIndexValue(plane_name)
    slice_data = mpr_representation.slices_data[orientation]

    plane_widget = vtk.vtkImagePlaneWidget()
    plane_widget.SetInteractor(vizu.GetInteractor())

    plane_widget.GetPlaneProperty().SetColor(slice_data.norm_color)
    plane_widget.TextureInterpolateOff()
    plane_widget.TextureVisibilityOn()            
    plane_widget.SetInputData(vtk_image)
    plane_widget.SetPlaneOrientation(orientation)            
    plane_widget.SetSliceIndex(slice_data.slice_index)
    plane_widget.UserControlledLookupTableOn()
    plane_widget.SetLookupTable(lookup_table)

    plane_widget.SetMiddleButtonAction(vtk.vtkImagePlaneWidget.VTK_CURSOR_ACTION)            
    plane_widget.SetRightButtonAction(vtk.vtkImagePlaneWidget.VTK_CURSOR_ACTION)
    plane_widget.On()
    plane_widget.InteractionOn()
    plane_widget.DisplayTextOn()

    self._plane_widgets.append(plane_widget)
</code></pre>
<p style="margin:1.2em 0px!important">Any helps or tips are greatly appreciated.</p>
<p style="margin:1.2em 0px!important">Cheers,<br>Bruno.</p>
<div title="MDH:SGkgZXZlcnlvbmUsPGR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