[vtkusers] actor not showing

Johnson jgadel2 at uic.edu
Sat Jun 29 12:58:15 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

On 6/28/2013 8:21 AM, David Doria wrote:
> On Thu, Jun 27, 2013 at 10:31 PM, johnsonjonaris <jgadel2 at uic.edu> wrote:
>> Dear All
>> I made a pipeline which visualize a set of shapes from a vtkImageData volume
>> with integral data (integer values). The pipeline executes but the output is
>> not rendered in the rendering window, although I can save the output and
>> load it in PARAVIEW.
>> Moreover, I know that the actors I create are there since I can probe their
>> color property later.
>> Please help
> I would suggest taking that example that you posted and stripping it
> down a piece at a time until it breaks. That is, make the actor use
> the data from the very beginning of the pipeline and see if it is
> displayed properly at that point. Then add one filter at a time until
> it breaks. Once you get it to as small of a case as possible that
> demonstrates the problem, we can take a look if you still can't figure
> it out. Be sure to generate data programmatically rather than read an
> input file as it is much easier to reproduce.
>
> David
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130629/5ab0b443/attachment.htm>


More information about the vtkusers mailing list