draw with vtkImageCanvasSource2D in every slice

Charles Law charles.law at kitware.com
Tue Dec 7 07:15:01 EST 1999


<x-flowed>Adrian,

In VTK2.4 vtkImageCanvasSource could only draw in the first slice.  This 
has been fixed.
If you want, you can use vtkImageTranslateExtent to move the slice to 0, 
and then draw on it.

Charles.


At 04:30 PM 12/6/99 +0100, you wrote:
>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.
>-----------------------------------------------------------------------------



-----------------------------------------------------------------------------
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.
-----------------------------------------------------------------------------

</x-flowed>



More information about the vtkusers mailing list