[Insight-users] [vtkusers] Return itkObjects

Jothybasu Selvaraj jothybasu at gmail.com
Thu Jun 7 09:58:51 EDT 2012


Excellent David!

That greatly helped to understand how to instantiate itk objects.

Thanks very much

Jothy

On Thu, Jun 7, 2012 at 2:31 PM, David Doria <daviddoria at gmail.com> wrote:

> On Thu, Jun 7, 2012 at 9:05 AM, Jothybasu Selvaraj <jothybasu at gmail.com>
> wrote:
> > Thanks!
> >
> > Do I need to add the below typdef declaration in .h and .cxx
> >
> >
> > typedef itk::DefaultStaticMeshTraits<
> > vtkFloatingPointType, PointDimension, MaxCellDimension,
> > vtkFloatingPointType,vtkFloatingPointType >MeshTraits;
> >
> > typedef itk::Mesh< vtkFloatingPointType,PointDimension,MeshTraits
> >MeshType;
>
> You just need the typedef to be in scope. So if you declare it in the
> header, and you include the header in the implementation file, you
> should be good to go. You'll get "type undefined" errors if it can't
> find the typedef.
>
> > Is there any example on how to declare  and return itk objects in
> classes?
>
> I just added this:
>
> http://www.itk.org/Wiki/ITK/Examples/Utilities/ReturnObjectFromFunction
>
> If someone else familiar with this could look at case 4 of returning a
> normal pointer and storing it in a smart pointer and give a better
> explanation of why it doesn't work, that'd be great. You'll see that
> case 1 is the only one that works.
>
> David
>



-- 
Jothy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120607/c08d99ef/attachment.htm>


More information about the Insight-users mailing list