[vtkusers] Breaking the pipeline

Matthias Haack haack at rz.rwth-aachen.de
Fri Aug 29 03:00:13 EDT 2003


Hi Kevin and all the others who helped,

with a slightly modification your suggestion works although the 
img->Register(0) looks weird to me.

I do it like this (imData is the image which is set as an input to a 
vtkImageActor):

     vtkImageData* temp = vtkImageData::New();
     flip->SetInput(temp);
     temp->DeepCopy(imData);
     temp = flip->GetOutput();
     temp->Update();
     imData->DeepCopy(temp);
     flip->RemoveAllInputs();
     temp->Register(0);
     temp->Delete();

So I never need to put my finger on the vtkImageActor which suits my 
current implementation although I do two deep copies. The main problem 
is that I currently only have access to the vtkImageData in my data 
object and the display is done in another class using vtkImageActor but 
this might change and then there would be no vtkImageActor needed.


If someone knows how to do it with less copies, please let me know.


Matthias


Kevin Wright wrote:
> vtkImageData *img = imageReader->GetOutput();
> img->Register(0);
> imageReader->SetOutput(0);
> 
> imageFlip->SetInput(img);
> actor->SetInput(imageFlip->GetOutput());
> 
> I've never tried anything like that, but it might work.





More information about the vtkusers mailing list