[Insight-users] how to use itkVTKImageToImageFilter to convert
vtkimage to itkkimage
Yixun Liu
yxliu at fudan.edu.cn
Sat Mar 10 21:36:31 EST 2007
Hi,
I use itkVTKImageToImageFilter to convert vtkImage to itkImage.
typedef itk::VTKImageToImageFilter<ImageType_Short> VTKToITKConnectorType;
VTKToITKConnectorType::Pointer connector = VTKToITKConnectorType::New();
connector->SetInput(testVtkImage);
try
{
connector ->Update();
}
catch( itk::ExceptionObject & excp )
{
std::cerr << "Error reading the series " << std::endl;
std::cerr << excp << std::endl;
}
ImageType_Short::Pointer testItkImage = connector->GetOutput();
However, the error is:
error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'const class itk::Image<short,3> *' (or there is no acceptable conversion)
How to convert itk::Image<short,3> * to itk::Image<short,3> ::Pointer?
Regards,
Yixun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20070311/3cbdddba/attachment.html
More information about the Insight-users
mailing list