[Insight-users] simple ITK App keeps crashing - what do I do wrong?

Luis Ibanez luis.ibanez at kitware.com
Mon May 15 10:50:31 EDT 2006


Hi Henning,



When an image is produced by a filter, you can get access
to the filter by invoking the method:

              image->GetSource()


in this way you could update the filter by doing

              image->GetSource()->Update();


which is equivalent to the call:

              image->Update();



Please read the ITK Software Guide

     http://www.itk.org/ItkSoftwareGuide.pdf


in particular part III, where the data pipeline architecture
of ITK is described.


About the methods for creating images from functions,
you should be ok by returning a SmartPointer from
the function. For more details please read the Tutorials:

     http://www.itk.org/HTML/Tutorials.htm

in particular

"Integrating ITK into your application"
http://www.itk.org/CourseWare/Training/GettingStarted-V.pdf


which describes how to use ITK filters in a non-fully ITK
application.



    Regards,



       Luis



=========================
Henning Meyer wrote:
> Hello Luis,
> 
> I think I got it so far. My problem seems to be solved. Still I'm
> unsure about two points:
> 
> As far as I understood an image is owned by the filter it was produces 
> from.
> Can I pass an Image::Pointer res = filter.GetOutput() as result of my
> function and destroy the filter afterwards? res should then be the
> owner of the image, shouldn't it?
> 
>> the GetOutput() method of a filter does not give you a filter, it gives
>> you an image. The syntax of SmartPointer is the same as raw pointers.
> 
> 
> Why not? Why can't my image know it has to be produced from an filter.
> The filter could be stored in an SmartPointer inside the image. This
> seems inconsequent to me.
> 
> Henning
> 
> 




More information about the Insight-users mailing list