Search code examples
pythonvtkplane

How to get orgin and normal for a plane, from PlaneWidget


How to get orgin and normal, from plane widget, and give it to vktPlane? My code actually doesn't work.

planeWidget = vtk.vtkImagePlaneWidget()
planeWidget.SetInputData(reader.GetOutput())
planeWidget.SetSliceIndex(reader.GetOutput().GetDimensions()[2]/2)

clippingPlane=vtk.vtkPlane()
clippingPLane.SetOrigin(planeWidget.GetSelectedPlaneProperty())

Solution

  • vtkImagePlaneWidget::GetCenter() and vtkImagePlaneWidget::GetNormal() should give you what you need.