<div class="gmail_quote">On Wed, Nov 11, 2009 at 7:00 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;">
Hi,<br><br>I want to convert a vtkImageData, delivered by vtkKWEPaintbrushWidget respectively it&#39;s vtkKWEPaintbrushRepresentation2D, to an itk::Image:<br><br><br>vtkImageData *output = vtkImageData::New();<br>m_paintbrushRepresentation2D-&gt;GetPaintbrushDrawing()-&gt;GetPaintbrushData()-&gt;GetPaintbrushDataAsImageData(output);<br>


<br>typedef itk::VTKImageToImageFilter&lt;Short3DType&gt; VtkToItkType;<br>VtkToItkType::Pointer filter = VtkToItkType::New();<br>filter-&gt;SetInput(output);<br><br>filter-&gt;Update();<br><br><br>The problem is, that the applications crashes if I call filter-&gt;Update() and following message is shown: &quot;There is no source code available for the current location.&quot; It seems that something is wrong with the output data of the paintbrush. Whether the paintbrush delivers an correct image I can look at with a vtkImageViewer (all looks fine), the indent of that image says, that there&#39;s currently no image!? I guess that&#39;s the reason why the filter can&#39;t process the data. Does anybody know a solution?<br>
</blockquote><div><br><br>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...<br><br>m_paintbrushRepresentation2D-&gt;GetPaintbrushDrawing()-&gt;GetPaintbrushData()-&gt;GetPaintbrushDataAsImageData(output);<br>
<br>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><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Regards, Michael<br><br>
<br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br>--<br>karthik<br>