[vtkusers] temporarily hide axes in vtkResliceImageViewer

Panayiotis Georgiou ps.georgiou at gmail.com
Fri Apr 11 12:46:46 EDT 2014


Hello,

I am using the vtkResliceImageViewer class in a project for displaying 2D
slices from DICOM files in a Quadview (very similarly to the
Examples\GUI\Qt\FourPaneViewer\QtVTKRenderWindow.cxx example). At some
point the software takes screenshots of one of the render windows showing a
2D slice using the vtkWindowToImageFilter class. Up to this point
everything works fine and screenshots are correctly taken and saved using
the vtkPNGWriter class.

What I would like to do is before taking the screenshots hide the two axes
shown by the vtkResliceCursoWidget. Once the screenshots are taken I would
like to make the two axes visible again.

I have tried several ways to hide the axes but none of them seem to work.
Here are some of the things I have tried (each one separately):

// Note:
// vtkSmartPointer<vtkResliceImageViewer> RIV[3];

//hides the widget including the 2D slices
RIV[selectedView]->GetResliceCursorWidget()->GetRepresentation()->SetVisibility(0);


//hides the widget including the 2D slices
RIV[selectedView]->GetResliceCursorWidget()->GetResliceCursorRepresentation()->SetVisibility(0);

//no effect
RIV[selectedView]->GetResliceCursor()->SetThickness(0.0,0.0,0.0);

//A render was issued after each change
RIV[selectedView]->GetResliceCursorWidget()->Render();

Does anyone know how to hide the axes while the 2D slice image remains
visible?

Thanks for your help.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140411/eb85c71d/attachment.html>


More information about the vtkusers mailing list