[Insight-users] [vtkusers] Return itkObjects
Jothybasu Selvaraj
jothybasu at gmail.com
Thu Jun 7 10:20:07 EDT 2012
Last one question
How would you pass the itkObject to a function.
it would be great if you can add the same into the example (for future use
and other novices)
Thanks very much
Jothy
On Thu, Jun 7, 2012 at 2:58 PM, Jothybasu Selvaraj <jothybasu at gmail.com>wrote:
> 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
>
>
--
Jothy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120607/35680d2e/attachment-0001.htm>
More information about the Insight-users
mailing list