Why vtkImageTracerWidget doesn’t work?
import vtk
reader=vtk.vtkDICOMImageReader()
reader.SetDirectoryName("DicomData/16")
reader.Update()
view=vtk.vtkImageViewer2()
view.SetInputConnection(reader.GetOutputPort())
interactor = vtk.vtkInteractorStyleImage()
iren=vtk.vtkRenderWindowInteractor()
iren.SetInteractorStyle(interactor)
imageActor = vtk.vtkImageActor()
imageActor.GetMapper().SetInputData(view.GetInput())
view.SetupInteractor(iren)
itw = vtk.vtkImageTracerWidget()
itw.SetCaptureRadius(100)
itw.GetGlyphSource().SetColor(1, 0, 0)
itw.GetGlyphSource().SetScale(3.0)
itw.GetGlyphSource().SetRotationAngle(45.0)
itw.GetGlyphSource().Modified()
itw.ProjectToPlaneOn()
itw.SetViewProp(imageActor)
itw.SetInputData(view.GetInput())
itw.SetInteractor(iren)
itw.PlaceWidget()
itw.SnapToImageOff()
itw.AutoCloseOn()
itw.On()
iren.Start()