[Insight-users] VTK to ITK conversion problem

itkvtk123 at gmx.net itkvtk123 at gmx.net
Mon Oct 19 19:28:26 EDT 2009


Hey,

I can't get the VTK to ITK converter to work.
I'm always getting

"error C2440: 'initializing' : cannot convert from 'const itk::Image<TPixel,VImageDimension> *' to 'itk::SmartPointer<TObjectType>'"


Minimalistic code example:

vtkImageData* vtkData = vtkImageData::New();

//read in some vtk data

//now try to convert to itk
typedef unsigned short PixTyp;
typedef itk::Image<PixTyp, 3> Im3DType;

typedef itk::VTKImageToImageFilter<Im3DType> VTKConverter3DType;
VTKConverter3DType::Pointer conv = VTKConverter3DType::New();

conv->SetInput(vtkData);
conv->Update();
Im3DType::Pointer result = conv->GetOutput();	//-> C2440


Thanks a lot
-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01


More information about the Insight-users mailing list