<div dir="ltr"><div><div>Hello, <br><br></div>I have a problem using the vtkcontourwidget in 3D. What I'm trying to do is to draw contours on my 3D image, where a different contour can be drawn on each slice of the image. <br><br></div>The problem that I'm getting is that when I draw a contour on one of the slices, the same contour appears on all the other slices as well. <br><div><br></div><div>Here's a piece of the code i'm using: <br><br>    vtkSmartPointer<vtkImageViewer2> ImageViewer = vtkSmartPointer<vtkImageViewer2>::New();<br>    ImageViewer->SetInputData(reader->GetOutput());<br>    ImageViewer->SetColorLevel(127);<br>    ImageViewer->SetColorWindow(255);<br><br>    vtkSmartPointer<vtkRenderWindowInteractor> iren = vtkSmartPointer<vtkRenderWindowInteractor>::New();<br>    ImageViewer->SetupInteractor(iren);<br>    ImageViewer->Render();<br>    ImageViewer->GetRenderer()->ResetCamera();<br>    ImageViewer->Render();<br><br>    vtkSmartPointer<vtkSliderWidget> SliderWidget = vtkSmartPointer<vtkSliderWidget>::New();<br>    SliderWidget->SetInteractor(iren);<br>    SliderWidget->SetRepresentation(SliderRepres2D);<br>    SliderWidget->KeyPressActivationOff();<br>    SliderWidget->SetAnimationModeToAnimate();<br>    SliderWidget->SetEnabled(true);<br><br>    vtkSmartPointer<vtkSliderCallback> SliderCb = vtkSmartPointer<vtkSliderCallback>::New();<br>    SliderCb->SetImageViewer(ImageViewer);<br>    SliderWidget->AddObserver(vtkCommand::InteractionEvent, SliderCb);<br><br>    ImageViewer->SetSlice(static_cast<int>(SliderRepres2D->GetValue()));<br><br>vtkSmartPointer<vtkContourWidget> ContourWidget = vtkSmartPointer<vtkContourWidget>::New();<br>    vtkSmartPointer<vtkOrientedGlyphContourRepresentation> rep = vtkSmartPointer<vtkOrientedGlyphContourRepresentation>::New();<br>    ContourWidget->SetRepresentation(rep);<br><br>    vtkSmartPointer<vtkImageActorPointPlacer>  imageActorPointPlacer = vtkSmartPointer<vtkImageActorPointPlacer>::New();<br>    imageActorPointPlacer->SetImageActor(ImageViewer->GetImageActor());<br>    rep->SetPointPlacer(imageActorPointPlacer);<br>    rep->GetProperty()->SetColor(0, 1, 0);<br><br>    ContourWidget->SetInteractor(iren);<br>    ContourWidget->FollowCursorOn();<br>    ContourWidget->SetEnabled(true);<br>    ContourWidget->ProcessEventsOn();<br><br>    iren->Start();<br><br><br></div><div>Any idea what's causing this problem and eventually how to fix it ? <br><br></div><div>Any help would be really appreciated, <br><br></div><div>Thanks in advance, <br><br></div><div>Iyas<br></div></div>