Yes. It has to match the datatype of the "output" 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"><<a href="mailto:xanadu.michael@googlemail.com">xanadu.michael@googlemail.com</a>></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->GetPaintbrushDrawing()->GetPaintbrushData()->GetPaintbrushDataAsImageData(output);<br>
<br></div>typedef itk::Image<unsigned char,3> UC3DType;<br>typedef itk::VTKImageToImageFilter<UC3DType> VtkToItkType;<div class="im"><br><div>VtkToItkType::Pointer filter = VtkToItkType::New();<br>filter->SetInput(output);<br>
<br>filter->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'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->GetPaintbrushDrawing()->GetPaintbrushData()->GetPaintbrushDataAsImageData(output);<br>
<br></div>vtkMetaImageWriter *writer = vtkMetaImageWriter::New();<br>writer->SetInput(output);<br>writer->SetFileName("image.mha");<br>writer->Write();<br><br><br>2. The message "There is no source code available for the current location." perhaps points to the fact that you aren'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>