[vtkusers] vtkImagePlaneWidget clipped

Dean Inglis inglis.dl at gmail.com
Fri Jun 28 10:33:42 EDT 2013


Hi Miro,

when you scroll the slices, you are moving a 2D plane in 3D space
toward/away from the camera.
At some point, the camera will clip the object you are moving past the
near/far clipping plane. So in
addition to updating the widget's slice location when using a scroll bar,
you will have to manipulate
the camera. Look at the doc for vtkRenderer:  ResetCamera or
ResetCameraClippingRange.

Dean


On Thu, Jun 27, 2013 at 1:18 PM, Miro Drahos <mdrahos at robodoc.com> wrote:

>  Hi,
> I have trouble with vtkImagePlaneWidget. It is connected to a GUI slider
> and the plane widget's SetSliceIndex(slice) method is called to move it
> through slices of a 3D volume.
> Some slices however get clipped, see attached screenshots.
> If I click on the QVTKWidget and rotate the scene by a slightest bit, the
> whole widget is rendered properly again.
> 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.
> Here are the relevant snippets:
>
> //set up plane widget:
> void myClass::myClass()
> {
>   m_planeWidget->SetInput(image);
>   m_planeWidget->RestrictPlaneToVolumeOn();
>   m_planeWidget->SetPlaneOrientationToZAxes();
>   m_planeWidget->SetDisplayText(1);
>   m_planeWidget->SetInteractor(iren);
>   m_planeWidget->SetSliceIndex(0);
>   m_planeWidget->SetEnabled(1);
> }
> ...
> //move slices (a Qt slot that is called on slider change)
> void myClass::setPlaneWidgetSlice(const int & slice)
> {
>   m_planeWidget->SetSliceIndex(slice);
>   m_planeWidget->Modified();   //-- this doesn't seem to help
>   m_planeWidget->UpdatePlacement();  //neither does this
> }
>
> // outside call:
> myClass C;
> C->setPlaneWidgetSlice(index);
> C->render();  //calls  QVKTWidget->GetRenderWindow()->Render()
>
>
>  Thank you for help!!
> Miro
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130628/2de9b48d/attachment.htm>


More information about the vtkusers mailing list