[Insight-users] Select one lable of interest among several labels

Gaëtan Lehmann gaetan.lehmann at jouy.inra.fr
Mon Aug 22 04:02:52 EDT 2011


Le 10 août 11 à 14:55, David Doria a écrit :

> On Wed, Aug 10, 2011 at 8:34 AM, Abayiz <abayiz at yahoo.com> wrote:
>> Hello,
>>
>> In my current 3D data, there are several labels generated by  
>> "ConnectComponentImageFilter". Right now, I want to just keep one  
>> of them, and ignore/delete the other unwanted labels. How can I do  
>> this? I've read something about the "itkLableMaskImageFilter" and  
>> "itkLabelMapToBinaryImageFilter", but cannot figure out how to use  
>> them.
>>
>>
>> Examples would be very appreciated. Many thanks in advance.
>
> I have put many examples of LabelMap operations here:
>
> http://www.itk.org/Wiki/ITK/Examples#Blob_Detection.2C_Labeling.2C_and_Properties
>
> You may be interested in how to:
>
> Iteratively process each label:
> http://www.itk.org/Wiki/ITK/Examples/ImageProcessing/ObjectByObjectLabelMapFilter
>
> Remove labels based on shape properties:
> http://www.itk.org/Wiki/ITK/Examples/ImageProcessing/ShapeOpeningLabelMapFilter
>
> I just added this one:
> http://www.itk.org/Wiki/ITK/Examples/ImageProcessing/ManuallyRemovingLabels
>
> which I believe is exactly what you're looking to do here.


There is also the LabelSelectionLabelMapFilter for this task. Its  
primary role is to select some label objects based on their label, but  
the other label objects - the removed ones - are copied to the second  
output.
So if you pass a set of label to this filter, and continue the  
pipeline by using

   selection->GetOutput( 1 )

instead of

   selection->GetOutput()

then the output label map contain all the objects in the input label  
map excepted the ones with the label passed to that filter.

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://mima2.jouy.inra.fr  http://www.itk.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/20110822/1f68f707/attachment.pgp>


More information about the Insight-users mailing list