[vtkusers] vtkImagePlaneWidget in QVTKWidget

John Drescher drescherjm at gmail.com
Sun May 20 09:03:07 EDT 2012


> 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();
>

Are you compiling with Visual Studio?

John



More information about the vtkusers mailing list