[Insight-developers] how to reuse a filter correctly
Gaëtan Lehmann
gaetan.lehmann at jouy.inra.fr
Mon Feb 23 16:34:43 EST 2009
Le 23 févr. 09 à 22:26, Ivan Macia a écrit :
> Hi Leila,
>
> You should do something like this (just an example):
>
> std::vector<ImageType::Pointer> outputs;
>
> for( ... ) // your loop
> {
> filter->SetInput( newInput ); // new input or parameters every
> time, in any case this will call Modify() for the filter internally
> filter->Update();
>
filter->UpdateLargestPossibleRegion() may be better, if the input can
be of different size/place/...
And a filter->Modified(); may help to force your filter to reprocess
the input.
> ImageType::Pointer newOutput = filter->GetOutput();
> newOutput->DisconnectPipeline();
>
> outputs.push_back( newOutput );
> }
>
>
> Hope that helps
>
> Iván
>
>
> 2009/2/23 Leila Baghdadi <baghdadi at phenogenomics.ca>
> I use ITK-3.10
>
> I know reusing filters somehow void the concept of filters but I
> have no
> choice.
> I am segmenting multiple mouse embryos and need to be able to reuse
> various filters.
>
> Leila
>
> On Mon, 2009-02-23 at 16:06 -0500, Bradley Lowekamp wrote:
> > What version of ITK are you using?
> >
> > On Feb 23, 2009, at 2:19 PM, Leila Baghdadi wrote:
> >
> > > Hi guys
> > >
> > > I want to be able to use my filter in a loop,
> > > i.e, change the input and get a different output at every
> iteration.
> > >
> > > The problem is my filter seem to be stuck to the first input
> somehow
> > >
> > > I tried calling Update() within the loop and no luck,
> > > I tried calling New() and Delete() within the loop and no luck
> > >
> > > any thoughts
> > >
> > > Leila
> > >
> > > _______________________________________________
> > > Powered by www.kitware.com
> > >
> > > Visit other Kitware open-source projects at
> > > http://www.kitware.com/opensource/opensource.html
> > >
> > > Please keep messages on-topic and check the ITK FAQ at:
> > > http://www.itk.org/Wiki/ITK_FAQ
> > >
> > > Follow this link to subscribe/unsubscribe:
> > > http://www.itk.org/mailman/listinfo/insight-developers
> > >
> >
> > ========================================================
> >
> > Bradley Lowekamp
> >
> > Lockheed Martin Contractor for
> >
> > Office of High Performance Computing and Communications
> >
> > National Library of Medicine
> >
> > blowekamp at mail.nih.gov
> >
> >
> >
> >
> >
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-developers
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-developers
--
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66 fax: 01 34 65 29 09
http://voxel.jouy.inra.fr http://www.mandriva.org
http://www.itk.org http://www.clavier-dvorak.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: Ceci est une signature ?lectronique PGP
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20090223/c3954a8f/attachment.pgp>
More information about the Insight-developers
mailing list