[vtkusers] vtkImagePlaneWidget in QVTKWidget

qlizhi qlizhi at gmail.com
Sun May 20 08:37:29 EDT 2012


Hi all:
I use vtkImagePlaneWidget  to get a cross-sectional view, the program works fine; but when i combine it with Qt,  when the mouse move into the QVTKInteractor area , the program crash down. I suppose the reason was QVTKInteractor ;  Can  anybody help me ?Thank you!
Some important codes:

QVTKInteractor *iren=qVTK1->GetInteractor(); 
.
.
.
 vtkSmartPointer<vtkCellPicker> picker =
  vtkSmartPointer<vtkCellPicker>::New();
  picker->SetTolerance(0.005);

  vtkSmartPointer<vtkProperty> ipwProp =
  vtkSmartPointer<vtkProperty>::New();

  vtkSmartPointer<vtkImagePlaneWidget> planeWidgetZ =
  vtkSmartPointer<vtkImagePlaneWidget>::New();
  planeWidgetZ->SetInteractor( iren);
  planeWidgetZ->SetKeyPressActivationValue('z');
  planeWidgetZ->SetPicker(picker);
  planeWidgetZ->GetPlaneProperty()->SetColor(0,0,1);
  planeWidgetZ->SetTexturePlaneProperty(ipwProp);
  planeWidgetZ->TextureInterpolateOn();
  planeWidgetZ->SetResliceInterpolateToCubic();
  planeWidgetZ->SetInput(v16->GetOutput());
  planeWidgetZ->SetPlaneOrientationToZAxes();
  planeWidgetZ->SetSliceIndex(32);
  //planeWidgetZ->SetLookupTable( planeWidgetX->GetLookupTable());
  planeWidgetZ->SetLookupTable( hueLut);
  planeWidgetZ->DisplayTextOn();
  planeWidgetZ->On();
 





qlizhi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120520/74b0cc5f/attachment.htm>


More information about the vtkusers mailing list