[Insight-users] How to make the input of a filter to its output

Luis Ibanez luis.ibanez at kitware.com
Sat Oct 30 11:53:25 EDT 2004


Hi Pan,

If you want to take the output of a filter and connect it as
the input of the same filter, you should first call Update()
on the filter, then take its output and call DisconnectPipeline()
on the output. Something like

filter->SetInput( inputImage );
filter->Update();
ImageType::Pointer outputImage = filter->GetOutput();
outputImage->DisconnectPipeline();
filter->SetInput( outputImage );

This operation is interesting when you want to reuse
a filter in an iterative cycle.


Regards,

Luis

-------------------
Pan Ross wrote:

> I want to make the input of a filter to its output. But I do not know
> how to do it. I have write the following code, but there are some
> errors when I run the program. Could anyone help me?
> ImageType::Pointer workImage;
> workImage = imageReader->GetOutput();
> ...
> ...
> FlipFilterType::Pointer flip = FlipFilterType::New();
> flip->SetInput(workImage);
> FlipFilterType::FlipAxesArrayType flipAxesSet=flip->GetFlipAxes();
> flipAxesSet[1]=true;
> flip->SetFlipAxes(flipAxesSet);
> workImage = flip->GetOutput();
> the error is:
> itk::InvalidRequestedRegionError @ 0x0012eeec
>
>
> ------------------------------------------------------------------------
> *Do You Yahoo!?*
> 150万曲MP3疯狂搜,带您闯入音乐殿堂 <http://music.yisou.com>
> 美女明星应有尽有,搜遍美图、艳图和酷图 <http://image.yisou.com>
> 1G就是1000兆,雅虎电邮自助扩容!
> <http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/>
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Insight-users mailing list
>Insight-users at itk.org
>http://www.itk.org/mailman/listinfo/insight-users
>  
>






More information about the Insight-users mailing list