[Insight-users] How to disconnect a pipeline

Luis Ibanez luis.ibanez@kitware.com
Fri, 25 Oct 2002 12:07:38 -0400


Hi Martin,

The itk::Image class derives from itk::DataObject

http://www.itk.org/Insight/Doxygen/html/classitk_1_1DataObject.html

Which provides a method:

     void DisconnectPipeline () const;


You probably may want to use it like:

    FilterB->SetInput( FilterA->GetOutput() );
    FilterB->Update();

    ImageType::Pointer image = FilterB->GetOutput();

    image->DisconnectPipeline();

    FilterB->Delete();
    FilterA->Delete();


Please let us know if you find any problem,

   Thanks

     Luis


---

PS. There are not taboo words in ITK   :-)
The toolkit is supposed to be used in
combination with other libraries.

Well, thinking again, maybe "goto" is
actually a taboo workd in ITK   :-)
http://www.acm.org/classics/oct95/

=======================================

Martin Styner wrote:
> Hi Luis
> Yes, that worked ! Thanks, much 'nicer' than my solution. Nevertheless, 
> for curiosity sake, what would be the best way to disconnect an image 
> fully from the pipeline and free the whole pipeline before the image, 
> e.g. to be processed by a routine from a different libary (THERE, I 
> dared to say the taboo-word... ;) ).
> 
> Best regads
> Martin
>