[vtkusers] vtkImagePlaneWidget and save to jpg

Raúl Ferriz raul at torresyvalero.com
Mon Oct 4 05:34:43 EDT 2010


  Dear developers,

I have a fully working vtkImagePlaneWidget on a volume dataset, and now 
I want save image generated by this widget. I think that image is 
accessed through vtkImagePlaneWidget->GetTexture, so my code is like this:

                 vtkTexture * tex =  this->m_ImagePlaneWidget->GetTexture();
                 if ( tex )
                 {
                     vtkJPEGWriter * jpeg =
                         vtkJPEGWriter::New();

                     jpeg->SetFileName ( filename );
                     jpeg->SetInputConnection ( tex->GetOutputPort() );
                     jpeg->Write();
                     jpeg->Delete();
                     jpeg = NULL;
                 }

But this code does not create my file. I can step by step this code and 
is not thowing a exception, simply does nothing.
Any advice on how I am doing wrong?



More information about the vtkusers mailing list