[Insight-users] itk::ChangeLabelImageFilter
Gaetan Lehmann
gaetan.lehmann at jouy.inra.fr
Wed Jun 7 14:49:14 EDT 2006
I'm not using it this way. I use
changeLabel->SetChange( wit.Get(), mit.Get() );
instead of passing a map to the filter with SetChangeMap(). The full code is
here:
http://voxel.jouy.inra.fr/darcs/contrib-itk/watershed/iwsm.cxx
See if it work for you this way.
Funny to see you are also doing it after a watershed. Can I ask you why you
are relabeling your image after the watershed ?
Gaetan
On Wednesday 07 June 2006 16:15, Henning Meyer wrote:
> I see. But what do I do wrong:
>
> This works:
>
> ChangeLabelFilterType::ChangeMapType changeMap;
> // some code to set the map
> LabeledImageIteratorType watershedIt( watershedImage,
> watershedImage->GetBufferedRegion() );
> for(watershedIt.GoToBegin(); !watershedIt.IsAtEnd(); ++watershedIt)
> watershedIt.Set( changeMap[ watershedIt.Get() ] );
>
> But this does not:
> ChangeLabelFilterType::Pointer labelChanger =
> ChangeLabelFilterType::New(); labelChanger->SetInput( watershedImage );
> labelChanger->SetChangeMap( changeMap );
> labelChanger->Update();
> LabeledImageType::Pointer labelChangedImage = labelChanger->GetOutput();
>
> Thanks for your help!
>
> Henning
>
> 2006/6/7, Gaetan Lehmann <gaetan.lehmann at jouy.inra.fr>:
> > Hi,
> >
> > The ChangeLabelImageFilter works without problem (for me).
> > Most of the code is in the functor declared in the header: this filter
> > use the UnaryFunctorImageFilter to simplify its implementation.
> >
> > Gaetan
> >
> >
> > On Wed, 07 Jun 2006 15:36:52 +0200, Henning Meyer <tutmann at gmail.com>
> >
> > wrote:
> > > Hello,
> > >
> > > maybe a stupid question:
> > > Does itk::ChangeLabelImageFilter (ITK 2.6) do anything usefull at all?
> > > The source just looks like an empty template generated filter.
> > >
> > > Did I do something wrong?
> > >
> > > Thanks for your help!
> > >
> > > Henning
> > > _______________________________________________
> > > Insight-users mailing list
> > > Insight-users at itk.org
> > > http://www.itk.org/mailman/listinfo/insight-users
> >
> > --
> > 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/insight-users/attachments/20060607/b6e28619/attachment-0001.pgp
More information about the Insight-users
mailing list