Yes. It has to match the datatype of the &quot;output&quot; drawing data, which probably is UCHAR<br><br>--<br>karthik<br><br><div class="gmail_quote">On Fri, Nov 13, 2009 at 3:40 AM, Michael Xanadu <span dir="ltr">&lt;<a href="mailto:xanadu.michael@googlemail.com">xanadu.michael@googlemail.com</a>&gt;</span> wrote:<br>
<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"><div>Hi, finally I found the solution. The ITK filter needs to be set to unsigned char. Short type leads to crashes:<div class="im">
<br><br>vtkImageData *output = vtkImageData::New();<br>m_paintbrushRepresentation2D-&gt;GetPaintbrushDrawing()-&gt;GetPaintbrushData()-&gt;GetPaintbrushDataAsImageData(output);<br>
<br></div>typedef itk::Image&lt;unsigned char,3&gt; UC3DType;<br>typedef itk::VTKImageToImageFilter&lt;UC3DType&gt; VtkToItkType;<div class="im"><br><div>VtkToItkType::Pointer filter = VtkToItkType::New();<br>filter-&gt;SetInput(output);<br>

<br>filter-&gt;Update();<br></div><br><br><br> </div></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 class="im">
<div>
<div><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></div><font color="#888888">karthi<br>
</font></blockquote></div><br>
<br>_______________________________________________<br>
VtkEdge mailing list<br>
<a href="mailto:VtkEdge@vtkedge.org">VtkEdge@vtkedge.org</a><br>
<a href="http://public.kitware.com/cgi-bin/mailman/listinfo/vtkedge" target="_blank">http://public.kitware.com/cgi-bin/mailman/listinfo/vtkedge</a><br>
<br></blockquote></div><br><br clear="all"><br>