[Insight-users] itk::VTKImageToImageFilter Questions
Alexis Cheng
acheng_1221 at hotmail.com
Fri Jan 28 20:09:42 EST 2011
Hi all,
I'm having a bit of trouble using the itk::VTKImageToImageFilter class. My program crashes on runtime. The following is a snippet of my code.
static const unsigned int Dimension = 2;
typedef float PixelType;
typedef itk::Image< PixelType, Dimension > FixedImageType;
typedef itk::VTKImageToImageFilter<FixedImageType> VTKImageToITKImageType;
vtkSmartPointer<vtkImageData> USImage = vtkSmartPointer<vtkImageData>::New();
VTKImageToITKImageType::Pointer VTKToITKConnector = VTKImageToITKImageType::New();
vector<FixedImageType::Pointer> *ImagePanorama;
ImagePanorama = NULL;
vector<FixedImageType::Pointer>::iterator PanoramaIterator;
USImage->SetScalarTypeToUnsignedChar();
USImage->SetDimensions(960,480,1);
USImage->SetSpacing(1,1,1);
USImage = sonixGrabber->GetOutput();
USImage->Update();
VTKToITKConnector->SetInput(USImage);
VTKToITKConnector->Execute();
FixedImageType::Pointer ITKImagePointer = FixedImageType::New();
ITKImagePointer = VTKToITKConnector->GetImporter()->GetOutput();
ITKImagePointer->Update();
I've isolated the error to the usage of VTKImageToImageFilter. I haven't had any luck finding examples that used this filter. What is the correct pipeline for using this filter? Thank you all in advance.
Regards,
Alexis Cheng
University of British Columbia
Electrical Engineering
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110128/fc118605/attachment.htm>
More information about the Insight-users
mailing list