[Insight-users] itkVTK Pipeline

Yan Yang y.yang at apu.ac.uk
Mon Apr 4 10:25:01 EDT 2005


Dear all,

I got a problem about connecting ITK and VTK. 

I use itk::ImageToVTKImageFilter and itk::VTKImageToImageFilter for converting data. 

  // Connect a ITK pipeline to an VTK pipeline
  typedef itk::ImageToVTKImageFilter< OutputType > ConnectorFilterType;
  ConnectorFilterType::Pointer connector = ConnectorFilterType::New();
  connector->SetInput( caster->GetOutput() );     // an image can be created by image writer using caster->GetOutput() data
  connector->GetImporter()->SetDataScalarTypeToUnsignedChar();
  this->RegisteredImage = connector->GetOutput(); 

"this->RegisteredImage" is accessed in vtk pipeline by a get method in another file.
vtkImageData *image = registration->GetRegisteredImage();
image->Update();

There is an error exception when running vtkImageData Updata() method, the execution goes into itkVTKImageExportBase.cxx, and fails at calling UpdataInformationCallback() as the following.

void VTKImageExportBase::UpdateInformationCallbackFunction(void* userData)
{
  static_cast<VTKImageExportBase*>(userData)->
    UpdateInformationCallback(); // failed
}

I would be grateful if you could help solve this problem, thanks in advance.

Regards,

Yan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20050404/2d36b3a2/attachment.htm


More information about the Insight-users mailing list