Navneeth:<br><br>You can&#39;t cast to a smart pointer like that. Use a raw pointer for casting and then assign it to a smart pointer ...<br><br><br>void myFunction(void* userData)<br>
{<br>  ImageType *image = reinterpret_cast&lt; ImageType* &gt;(userData);<br>  ImageType::Pointer myImage = image;<br>}<br><br>...<br><br>int main(int argc, char *argv[])<br>{<br><div id=":1k3">  ImageType::Pointer image = reader-&gt;GetOutput();<br>
  myFunction( image.GetPointer() );<br>}<br></div><br><br><div class="gmail_quote">On Fri, Jan 7, 2011 at 8:50 PM, David Doria <span dir="ltr">&lt;<a href="mailto:daviddoria@gmail.com">daviddoria@gmail.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="im">On Fri, Jan 7, 2011 at 10:11 AM, Navneeth Subramanian<br>
&lt;<a href="mailto:navneeth.s@gmail.com">navneeth.s@gmail.com</a>&gt; wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; I am trying to cast some user data (void*) into an itk image as in the code<br>
&gt; below:<br>
<br>
</div>I think you need to use the ImportImageFilter:<br>
<a href="http://www.itk.org/Wiki/ITK/Examples/IO/ImportImageFilter" target="_blank">http://www.itk.org/Wiki/ITK/Examples/IO/ImportImageFilter</a><br>
<br>
David<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>
</blockquote></div><br>