[Insight-users] How to disconnect a pipeline

Martin Styner martin_styner@ieee.org
Thu, 24 Oct 2002 18:17:42 +0200


Hi everybody
I have a question in regard to the itk pipeline system.
In some cases my pipeline has grown too large so that I run out of 
memory. Now I want to separate as nicely as possible the pipeline into 2 
separate parts.
The 'nicest' I could so far come up with is the following:

Before:

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

After:

FilterB->SetInput(FilterA->GetOutput());
FilterB->Update();
ImageOutB = FilterB->GetOutput();
ImageOutB->DisconnectPipeline();
FilterA->Delete();
// Can't do a FilterB->Delete(), otherwise ImageOutB iscorrupted ?
FilterC->SetInput(ImageOutB);

Is there maybe an easy way to create a Duplicate of an image, this would 
solve the whole business.

Regards
Martin


-- 
Martin Styner, PhD. Ing. ETH
Group Head Medical Image Analysis for Orthopaedics
M.E. Mueller Institute for Biomechanics
Center for Computed Assisted Surgery
University of Bern
Murtenstrasse 35
P.O.Box 30
CH - 3010 Bern
Switzerland
Tel office: ++41-31-632-0940 , FAX: ++41-31-632-4951
email: Martin.Styner@memot.unibe.ch, martin_styner@ieee.org
WWW: http://cranium.unibe.ch/~mstyner