[vtkusers] vtkImagePlaneWidget: unable to move planes in Mac OS X
Miguel Sotaquira
msotaquira at gmail.com
Fri Jun 6 08:45:09 EDT 2014
Hi everyone,
I've implemented a simple pipeline to allow visualization/interaction of a
3D image using vtkImagePlane Widget. After rendering I can see the three
orthogonal planes of the image, I'm also able to change window level and to
see cursor location... However, I'm not able no move each individual plane,
as if interaction were disabled...
The strangest thing is that I tested the exact same pipeline on Windows and
it works perfectly! My environment: Mac OSX 10.6.8, vtk 5.10.
Below part of my code:
// A renderer and render window
vtkSmartPointer<vtkRenderer> renderer = vtkSmartPointer<vtkRenderer>::New();
vtkSmartPointer<vtkRenderWindow> renderWindow =
vtkSmartPointer<vtkRenderWindow>::New();
renderWindow->AddRenderer(renderer);
// Interactor
vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =
vtkSmartPointer<vtkRenderWindowInteractor>::New();
renderWindowInteractor->SetRenderWindow(renderWindow);
vtkSmartPointer<vtkInteractorStyleTrackballCamera> style =
vtkSmartPointer<vtkInteractorStyleTrackballCamera>::New();
renderWindowInteractor->SetInteractorStyle( style );
// The shared picker
vtkSmartPointer<vtkCellPicker> picker =
vtkSmartPointer<vtkCellPicker>::New();
picker->SetTolerance(0.005);
// The 3 image plane widgets
vtkSmartPointer<vtkImagePlaneWidget> planeWidgetX =
vtkSmartPointer<vtkImagePlaneWidget>::New();
planeWidgetX->DisplayTextOn();
planeWidgetX->SetInput(imgReader->GetOutput());
planeWidgetX->SetPlaneOrientationToXAxes();
planeWidgetX->SetSliceIndex(int(dims[0]/2));
planeWidgetX->SetPicker(picker);
planeWidgetX->SetKeyPressActivationValue('x');
planeWidgetX->GetPlaneProperty()->SetColor(1,0,0);
// Remaining widgets are created the same way
// Set the interactor to the widgets
planeWidgetX->SetInteractor(renderWindowInteractor);
planeWidgetX->On();
planeWidgetY->SetInteractor(renderWindowInteractor);
planeWidgetY->On();
planeWidgetZ->SetInteractor(renderWindowInteractor);
planeWidgetZ->On();
// Rendering
renderWindowInteractor->Initialize();
renderWindow->Render();
// Start mouse interaction
renderWindowInteractor->Start();
Is there something extra I should consider when implementing the code on
Mac OS X?
Thanks for any suggestion!
Miguel Sotaquirá
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140606/b5dfe970/attachment.html>
More information about the vtkusers
mailing list