<meta http-equiv="content-type" content="text/html; charset=utf-8"><div>On Fri, Jan 28, 2011 at 8:09 PM, Alexis Cheng <span dir="ltr"><<a href="mailto:acheng_1221@hotmail.com">acheng_1221@hotmail.com</a>></span> wrote:</div>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>
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</div></blockquote><div><br></div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div>Alexis,</div><div><br></div><div>
Please see:</div><a href="http://www.itk.org/Wiki/ITK/Examples/Broken/Images/VTKImageToImageFilter">http://www.itk.org/Wiki/ITK/Examples/Broken/Images/VTKImageToImageFilter</a><br clear="all"><br></div><div class="gmail_quote">
We are currently working on improving these classes, but the above example demonstrates the current capability.<br><br>David</div>