<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Hi all,<br><br>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.<br><br>static const unsigned int Dimension = 2;<br>typedef float PixelType;<br>typedef itk::Image< PixelType, Dimension > FixedImageType;<br>typedef itk::VTKImageToImageFilter<FixedImageType> VTKImageToITKImageType;<br><br>vtkSmartPointer<vtkImageData> USImage = vtkSmartPointer<vtkImageData>::New();<br>VTKImageToITKImageType::Pointer VTKToITKConnector = VTKImageToITKImageType::New();<br> <br>vector<FixedImageType::Pointer> *ImagePanorama;<br>ImagePanorama = NULL;<br>vector<FixedImageType::Pointer>::iterator PanoramaIterator;<br>USImage->SetScalarTypeToUnsignedChar();<br>USImage->SetDimensions(960,480,1);<br>USImage->SetSpacing(1,1,1);<br>USImage = sonixGrabber->GetOutput();<br>USImage->Update();<br> <br>VTKToITKConnector->SetInput(USImage);<br>VTKToITKConnector->Execute();<br> <br>FixedImageType::Pointer ITKImagePointer = FixedImageType::New();<br>ITKImagePointer = VTKToITKConnector->GetImporter()->GetOutput();<br>ITKImagePointer->Update();<br><br>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.<br><br>Regards,<br>Alexis Cheng<br>University of British Columbia<br>Electrical Engineering<br>                                            </body>
</html>