[vtkusers] How to get the input to a filter as algorithm output?

David Doria daviddoria+vtk at gmail.com
Mon Dec 14 20:25:38 EST 2009


The first thing I typically do (and I got this by looking at existing
filters) at the beginning of a RequestData() is:

 vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
  vtkImageData *input = vtkImageData::SafeDownCast(
      inInfo->Get(vtkDataObject::DATA_OBJECT()));

However, now I have an actual object, so I have to do things like the following:

  vtkSmartPointer<vtkImageBlend> blend = vtkSmartPointer<vtkImageBlend>::New();
  //blend->AddInputConnection(input->GetOutputPort()); //can't do this
because 'input' is not an algorithm output
  blend->AddInput(input);

David G. would have my head for this! How should this be done instead?

Thanks,

David D.



More information about the vtkusers mailing list