[vtkusers] vtkImagePlaneWidget clipped

Miro Drahos mdrahos at robodoc.com
Thu Jun 27 13:18:13 EDT 2013


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130627/b62ceb25/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: planeGood.png
Type: image/png
Size: 70801 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130627/b62ceb25/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: planeClipped.png
Type: image/png
Size: 72497 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130627/b62ceb25/attachment-0001.png>


More information about the vtkusers mailing list