<div dir="ltr"><div><div><div>Hi Miro,<br><br></div>when you scroll the slices, you are moving a 2D plane in 3D space toward/away from the camera.<br>At some point, the camera will clip the object you are moving past the near/far clipping plane. So in <br>
</div>addition to updating the widget&#39;s slice location when using a scroll bar, you will have to manipulate<br>the camera. Look at the doc for vtkRenderer:  ResetCamera or ResetCameraClippingRange.<br><br></div>Dean<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 27, 2013 at 1:18 PM, Miro Drahos <span dir="ltr">&lt;<a href="mailto:mdrahos@robodoc.com" target="_blank">mdrahos@robodoc.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  

    
  
  <div text="#000000" bgcolor="#FFFFFF">
    Hi,<br>
    I have trouble with vtkImagePlaneWidget. It is connected to a GUI
    slider and the plane widget&#39;s SetSliceIndex(slice) method is called
    to move it through slices of a 3D volume. <br>
    Some slices however get clipped, see attached screenshots. <br>
    If I click on the QVTKWidget and rotate the scene by a slightest
    bit, the whole widget is rendered properly again. <br>
    I suspect I need to call some Update() method by I am failing to
    figure it out. I tried to call Modified() and UpdatePlacement() of
    the widget but no luck.<br>
    Here are the relevant snippets:<br>
    <br>
    <tt>//set up plane widget:</tt><br>
    <tt>void myClass::myClass() </tt><br>
    <tt>{</tt><br>
    <tt>  m_planeWidget-&gt;SetInput(image);</tt><br>
    <tt>  m_planeWidget-&gt;RestrictPlaneToVolumeOn();</tt><br>
    <tt>  m_planeWidget-&gt;SetPlaneOrientationToZAxes(); </tt><br>
    <tt>  m_planeWidget-&gt;SetDisplayText(1);</tt><br>
    <tt>  m_planeWidget-&gt;SetInteractor(iren);</tt><br>
    <tt>  m_planeWidget-&gt;SetSliceIndex(0);</tt><br>
    <tt>  m_planeWidget-&gt;SetEnabled(1);</tt><br>
    <tt>}</tt><br>
    <tt>...</tt><br>
    <tt>//move slices (a Qt slot that is called on slider change)</tt><br>
    <tt>void myClass::setPlaneWidgetSlice(const int &amp; slice) </tt><br>
    <tt>{   </tt><br>
    <tt>  m_planeWidget-&gt;SetSliceIndex(slice);</tt><br>
    <tt>  m_planeWidget-&gt;Modified();   //-- this doesn&#39;t seem to help</tt><br>
    <tt>  m_planeWidget-&gt;UpdatePlacement();  //neither does this</tt>
    <div style="font-size:75%"><tt><big>}<br>
        </big><big><big><br>
            // outside call:<br>
            myClass C;<br>
            C-&gt;setPlaneWidgetSlice(index);</big><br>
          <big>C-&gt;render();  //calls 
            QVKTWidget-&gt;GetRenderWindow()-&gt;Render()</big></big></tt>
      <pre><big><big><big>

</big></big></big></pre>
      <big>Thank you for help!!</big><span class="HOEnZb"><font color="#888888"><small><small><br>
        </small></small><big>Miro </big><br>
    </font></span></div>
    <div>
    </div>
  </div>

<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>