[Insight-users] itk::ChangeLabelImageFilter

Atwood, Robert C r.atwood at imperial.ac.uk
Wed Jun 7 14:56:46 EDT 2006


Why would you NOT relabel the image after the watershed? :-0
 

But, I use itk::RelabelComponentImageFilter to get a compact numbering scheme and useable data type.


 

-----Original Message-----
From: insight-users-bounces+r.atwood=imperial.ac.uk at itk.org [mailto:insight-users-bounces+r.atwood=imperial.ac.uk at itk.org] On Behalf Of Gaetan Lehmann
Sent: 07 June 2006 19:49
To: Henning Meyer
Cc: insight-users at itk.org
Subject: Re: [Insight-users] itk::ChangeLabelImageFilter


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


More information about the Insight-users mailing list