[vtkusers] actor not showing

johnsonjonaris jgadel2 at uic.edu
Sun Jun 30 01:22:58 EDT 2013


Hi
I found part of the problem it was in the releasedataflag, I had to not set
the last step to ON
The code now is tripped to the minimum, a threshold and a marching cubes
the behavior is as follow: the actors appear then disappear, I believe it is
a memory update issue, but I can't get it to work properly
this example is similar to the one posted in
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Medical/GenerateModelsFromLabels

except that I want to display the generated labels as separate actors while
the example saves them into files which I successfully can do.

        vtkSmartPointer<vtkImageThreshold> threshold =
vtkSmartPointer<vtkImageThreshold>::New();;

    threshold->SetOutValue(0);

    threshold->SetInput(brain);

    threshold->ReleaseDataFlagOn();

    vtkSmartPointer<vtkMarchingCubes> mcubes =
vtkSmartPointer<vtkMarchingCubes>::New();

    mcubes->SetInputConnection(threshold->GetOutputPort());

    for (uint i = 0;i <5;i++) { 

        threshold->ThresholdBetween(lblValues(i),lblValues(i));

        mcubes->SetValue(0,lblValues(i));

        vtkSmartPointer<vtkPolyDataMapper> isoMapper =
vtkSmartPointer<vtkPolyDataMapper>::New();

        isoMapper->SetInput(mcubes->GetOutput());

        vtkSmartPointer<vtkActor> isoActor =
vtkSmartPointer<vtkActor>::New();

        isoActor->SetMapper(isoMapper);

        renderer->AddActor(isoActor);

        renWin->Render();

    }


Thanks
Johnson



-----
Johnson Jonaris 
PhD Candidate
Electrical & Computer Eng 
University of IL at Chicago
--
View this message in context: http://vtk.1045678.n5.nabble.com/actor-not-showing-tp5721647p5721683.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list