<div class="gmail_quote"><div>Hi, finally I found the solution. The ITK filter needs to be set to unsigned char. Short type leads to crashes:<br><br>vtkImageData *output = vtkImageData::New();<br>m_paintbrushRepresentation2D-&gt;GetPaintbrushDrawing()-&gt;GetPaintbrushData()-&gt;GetPaintbrushDataAsImageData(output);<br>
<br>typedef itk::Image&lt;unsigned char,3&gt; UC3DType;<br>typedef itk::VTKImageToImageFilter&lt;UC3DType&gt; VtkToItkType;<br><div id=":13" class="ii gt">VtkToItkType::Pointer filter = VtkToItkType::New();<br>filter-&gt;SetInput(output);<br>
<br>filter-&gt;Update();<br></div><br><br><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="gmail_quote">1. Let&#39;s take this step by step. Verify if the image is fine, before taking it all the way to ITK. Something like...<div>
<div class="im"><br><br>m_paintbrushRepresentation2D-&gt;GetPaintbrushDrawing()-&gt;GetPaintbrushData()-&gt;GetPaintbrushDataAsImageData(output);<br>
<br></div>vtkMetaImageWriter *writer = vtkMetaImageWriter::New();<br>writer-&gt;SetInput(output);<br>writer-&gt;SetFileName(&quot;image.mha&quot;);<br>writer-&gt;Write();<br><br><br>2. The message &quot;There is no source code available for the current location.&quot; perhaps points to the fact that you aren&#39;t building all your libraries for the debug mode. There must be some point in the stack trace where there is source code. What is the last such point.<br>

<br></div></div><font color="#888888">karthi<br>
</font></blockquote></div><br>