<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">&lt;<a href="mailto:acheng_1221@hotmail.com">acheng_1221@hotmail.com</a>&gt;</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&#39;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&lt; PixelType, Dimension &gt;  FixedImageType;<br>typedef itk::VTKImageToImageFilter&lt;FixedImageType&gt; VTKImageToITKImageType;<br><br>vtkSmartPointer&lt;vtkImageData&gt; USImage = vtkSmartPointer&lt;vtkImageData&gt;::New();<br>
VTKImageToITKImageType::Pointer VTKToITKConnector = VTKImageToITKImageType::New();<br>        <br>vector&lt;FixedImageType::Pointer&gt; *ImagePanorama;<br>ImagePanorama = NULL;<br>vector&lt;FixedImageType::Pointer&gt;::iterator PanoramaIterator;<br>
USImage-&gt;SetScalarTypeToUnsignedChar();<br>USImage-&gt;SetDimensions(960,480,1);<br>USImage-&gt;SetSpacing(1,1,1);<br>USImage = sonixGrabber-&gt;GetOutput();<br>USImage-&gt;Update();<br>                <br>VTKToITKConnector-&gt;SetInput(USImage);<br>
VTKToITKConnector-&gt;Execute();<br>                <br>FixedImageType::Pointer ITKImagePointer = FixedImageType::New();<br>ITKImagePointer = VTKToITKConnector-&gt;GetImporter()-&gt;GetOutput();<br>ITKImagePointer-&gt;Update();<br>
<br>I&#39;ve isolated the error to the usage of VTKImageToImageFilter. I haven&#39;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>