[Insight-users] Iterative operation

Luis Ibanez luis.ibanez@kitware.com
Fri May 21 22:34:25 EDT 2004


Hi Radhika,

Given that ITK uses a datapipeline architecture, the
method for iteratively running a filter involves  a
series of connections and disconnections of the input
and output.


Typically something like:



   Image1 = GetOriginalInputImage();

   for( unsinged int i=0; i < numIterations; i++)
    {
    filter->SetInput( Image1 )
    filter->Update();
    Image2 = filter.GetOutput();
    Image2->DisconnectPipeline();
    Image1 = Image2;
    }

   writer->SetInput( Image2 );



Please let us know if you have further questions,


    Thanks


      Luis


-----------------------------
Radhika Sivaramakrishna wrote:

> Hi there,
> 
> I have a question. Does anybody have  sample code for how one would do 
> an iterative application of a filter?
> 
> For eg if I wanted to run a dilate filter "n" times where n could be 
> variable, then how do I set this up?
> 
> Thanks
> 
> Radhika
> 
>                                                     
> ----------------------------------------------------- 
> Confidentiality Notice.
> This email message is for the sole use of the intended recipient(s) and 
> may contain confidential and privileged information. Any unauthorized 
> review, use, disclosure or distribution is prohibited. If you are not 
> the intended recipient, please contact the sender by reply email and 
> destroy all copies of the original message. If you are the intended 
> recipient, please be advised that the content of this message is subject 
> to access, review and disclosure by the sender's Email System Administrator.
> 






More information about the Insight-users mailing list