<div dir="ltr">Excellent David!<br><br>That greatly helped to understand how to instantiate itk objects.<br><br>Thanks very much<br><br>Jothy<br><br><div class="gmail_quote">On Thu, Jun 7, 2012 at 2:31 PM, David Doria <span dir="ltr"><<a href="mailto:daviddoria@gmail.com" target="_blank">daviddoria@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Thu, Jun 7, 2012 at 9:05 AM, Jothybasu Selvaraj <<a href="mailto:jothybasu@gmail.com">jothybasu@gmail.com</a>> wrote:<br>
> Thanks!<br>
><br>
> Do I need to add the below typdef declaration in .h and .cxx<br>
><br>
><br>
> typedef itk::DefaultStaticMeshTraits<<br>
> vtkFloatingPointType, PointDimension, MaxCellDimension,<br>
> vtkFloatingPointType,vtkFloatingPointType >MeshTraits;<br>
><br>
> typedef itk::Mesh< vtkFloatingPointType,PointDimension,MeshTraits >MeshType;<br>
<br>
</div>You just need the typedef to be in scope. So if you declare it in the<br>
header, and you include the header in the implementation file, you<br>
should be good to go. You'll get "type undefined" errors if it can't<br>
find the typedef.<br>
<div class="im"><br>
> Is there any example on how to declare and return itk objects in classes?<br>
<br>
</div>I just added this:<br>
<br>
<a href="http://www.itk.org/Wiki/ITK/Examples/Utilities/ReturnObjectFromFunction" target="_blank">http://www.itk.org/Wiki/ITK/Examples/Utilities/ReturnObjectFromFunction</a><br>
<br>
If someone else familiar with this could look at case 4 of returning a<br>
normal pointer and storing it in a smart pointer and give a better<br>
explanation of why it doesn't work, that'd be great. You'll see that<br>
case 1 is the only one that works.<br>
<span class="HOEnZb"><font color="#888888"><br>
David<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Jothy<br></div><br>
</div>