<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->GetPaintbrushDrawing()->GetPaintbrushData()->GetPaintbrushDataAsImageData(output);<br>
<br>typedef itk::Image<unsigned char,3> UC3DType;<br>typedef itk::VTKImageToImageFilter<UC3DType> VtkToItkType;<br><div id=":13" class="ii gt">VtkToItkType::Pointer filter = VtkToItkType::New();<br>filter->SetInput(output);<br>
<br>filter->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'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->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><font color="#888888">karthi<br>
</font></blockquote></div><br>