[Insight-users] how to remove an object (connected component) from the labled volume?

Gaëtan Lehmann gaetan.lehmann at jouy.inra.fr
Thu Apr 28 04:27:15 EDT 2011


Hi Anna,

Le 27 avr. 11 à 16:19, anna han wan a écrit :

> Hi Gaetan and thank you for your prompt reply
>
> I can specify my object by its label or even by its size.
>

To remove an object based on its label, you can use  
ChangeLabelImageFilter.
For the size, or other shape attributes, you should look at the  
LabelMap classes which are in the review directory.

> Also, do you know where I can found an example of using the  
> ChangeLabelImageFilter? Sorry it may seem a stupid question but I am  
> just newbie to itk and even c++.
>
You can look at the test

   Testing/Code/BasicFilters/itkChangeLabelImageFilterTest.cxx

Once you'll be comfortable with that class, it would be nice to  
contribute an example on

   http://www.itk.org/Wiki/ITK/Examples

Regards,

Gaëtan


> Thank you
>
> anna
>
>
> 2011/4/27 Gaëtan Lehmann <gaetan.lehmann at jouy.inra.fr>
>
> Le 27 avr. 11 à 16:03, anna han wan a écrit :
>
>
> Hi all and sorry to send my questions in different emails.
> I have another question regarding ConnectedComponentImageFilter and  
> RelabelComponentImageFilter.
> Once I have the list of objects (connected components) in my volume  
> after applying RelabelComponentImageFilter, which class or function  
> can I use to specify a given object so I can remove it?
>
> How do you want to specify which object you want to remove?
>
>
> Also can I access to the voxels belonging to a given connected  
> component?
>
>
> You can iterate over all the pixels of the image and check the pixel  
> value, but this is quite inefficient.
> You can also use a LabelMap - in that case you can access only the  
> pixel in a given object.
>
> Gaëtan
>
> -- 
> 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.itk.org
> http://www.mandriva.org  http://www.bepo.fr
>
>

-- 
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.itk.org
http://www.mandriva.org  http://www.bepo.fr

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 203 bytes
Desc: Ceci est une signature ?lectronique PGP
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110428/ae34ee5c/attachment.pgp>


More information about the Insight-users mailing list