<div dir="ltr"><span style=" color:#008000;"></span><font size="4"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);"><font size="2">Hi all,<br><br>I am trying to convert a vtkImageData into a itk image. I tried the following as given in the itk examples wiki.</font></span></font><br>
<br><font size="2"><span style="color: rgb(0, 0, 0);">typedef itk::Image<float, 2> ImageType;</span></font>
<pre style="margin: 0px; text-indent: 0px; color: rgb(0, 0, 0);"><font size="4">typedef itk::VTKImageToImageFilter<ImageType> VTKImageToImageType;</font></pre>
<pre style="margin: 0px; text-indent: 0px; color: rgb(0, 0, 0);"><font size="4">VTKImageToImageType::Pointer vtkImageToImageFilter = VTKImageToImageType::New();</font></pre>
<pre style="margin: 0px; text-indent: 0px; color: rgb(0, 0, 0);"><font size="4">vtkImageToImageFilter->SetInput(inputVTKImage);</font></pre>
<pre style="margin: 0px; text-indent: 0px; color: rgb(0, 0, 0);"><font size="4">vtkImageToImageFilter->Update();<br><br></font><font size="4"><span style="color: rgb(0, 0, 0);"><font size="2"> <font size="4">But the program crashes. I found in the users list that </font></font></span></font><font><font size="4">VTKImageToImageFilter is not supposed to be used directly. I am new to itk and it seems to be highly templated.<br>
I am a novice new c++ user to decipher the itk templates fully. Is there any easy to follow example on this?<br></font></font>
<font size="4">Thanks<br><br>Jothy</font><br></pre></div>