draw with vtkImageCanvasSource2D in every slice

Adrian Anner a.anner at medres.ch
Mon Dec 6 10:30:58 EST 1999


hello

I read some ct-slices in a vtkImageData. Now I want to draw in each slice
with vtkImageCanvasSource2D.

I tried the following:

vtkImageThreshold  * threshold = vtkImageThreshold::New();
  ..
  threshold->Update();

vtkExtractVOI  *extract = vtkExtractVOI::New();
vtkImageCanvasSource2D *canvas = vtkImageCanvasSource2D::New();

for (int slice = 0; slice < 20; slice++) {
      extract->SetInput( threshold->GetOutput() );
      extract->SetVOI( 0, x-1, 0, y-1, slice, slice );
      extract->Update();

      canvas->SetImageData( extractorT->GetOutput() );
      canvas->SetDrawColor( 200 );
      canvas->FillPixel( 0, 0 );
      canvas->Update();
}

now I display the slices but I just get the slices without the drawing.
If I set canvas->SetImageData( threshold->GetOutput() );
I get the drawing just in the first slice. What do I have to change or is
there an other way to do this ?

Thanks,

Adrian



-----------------------------------------------------------------------------
This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------




More information about the vtkusers mailing list