[vtkusers] vtkContourWidget for multiple-slice DICOM

Sam Raby rabysam28 at gmail.com
Tue Feb 25 12:57:11 EST 2014


Hello,

I am using vtkImageViewer2 and vtkContourWidget and can scroll through
DICOM slices, but I am able to contour only the current visible slice, not
all slices.

Here is my question: I need to contour each slice independently, and then
later when I am reviewing the DICOM, I would like to be able to see every
slice along with its corresponding contour aligned on it. The following is
my code so far, would you advise how to architecterize this?

Thanks



    vtkSmartPointer<vtkInteractorStyleImage> interactorStyle =
vtkSmartPointer<vtkInteractorStyleImage>::New();

    imageViewer->SetInputConnection(DICOMreader->GetOutputPort());


    ui->myQvtkwidget->SetRenderWindow(imageViewer->GetRenderWindow());

    imageViewer->SetSlice(10); // the current slice


    imageViewer->SetupInteractor(ui->myQvtkwidget->GetInteractor());

    ui->myQvtkwidget->GetRenderWindow()->GetInteractor()->SetInteractorStyle(interactorStyle);

    ui->myQvtkwidget->GetRenderWindow()->Render();

    ui->myQvtkwidget->update();



         vtkSmartPointer<vtkOrientedGlyphContourRepresentation> rep1 =
vtkSmartPointer<vtkOrientedGlyphContourRepresentation>::New();

         rep1->GetLinesProperty()->SetLineWidth(3.0f);

    ContourWidget->SetRepresentation(rep1);

    vtkSmartPointer<vtkImageActorPointPlacer> imageActorPointPlacer =
vtkSmartPointer<vtkImageActorPointPlacer>::New();

    imageActorPointPlacer->SetImageActor(imageViewer->GetImageActor());

    rep1->SetPointPlacer(imageActorPointPlacer);


    vtkContourWidget *ContourWidget = vtkContourWidget::New();

         ContourWidget->SetInteractor(ui->widget->GetInteractor());

    ContourWidget->SetEnabled(true);

    ContourWidget->ProcessEventsOn();

    ContourWidget->FollowCursorOn();
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140225/c8c32cec/attachment.html>


More information about the vtkusers mailing list