[Insight-users] Troubles with the manipulation of label objects

Cagatay Bilgin bilgincc at gmail.com
Wed May 15 12:44:29 EDT 2013


Well then first of welcome!

the input to your binaryImageToShapeLabelMapFilterPointer is
addImageFilterPointer_2->GetOutput() which makes me believe that you are
not providing a binary image to this filter. Apart from that the
code snippet you provide here looks OK. What is the output of
addImageFilterPointer_2
look like ?

About your binarization question, you can set the inside and outside values
as you wish. Take a look at this example
http://www.itk.org/Wiki/ITK/Examples/ImageProcessing/BinaryThresholdImageFilter



On Wed, May 15, 2013 at 8:08 AM, Antonio Calabrese <calantoanto at gmail.com>wrote:

> Thanks a lot Cagatay.
> The first thing that i would say is that i'm a newbie itk's users, so i
> have
> a simple question early:
> When i define an image class with pixelType as an integer or as an unsigned
> char and then i do a simple BinaryThreshold of this, Can i do consider the
> thresholder's output as a Binary image or else do i have use an image with
> the pixelType define as a bool?
>
> Here below there is my code:
> typedef itk::BinaryImageToShapeLabelMapFilter<ImageType>
> BinaryImageToShapeLabelMapFilterType;
>  BinaryImageToShapeLabelMapFilterType::Pointer
> binaryImageToShapeLabelMapFilterPointer
> =BinaryImageToShapeLabelMapFilterType::New();
>     binaryImageToShapeLabelMapFilterPointer->FullyConnectedOn ();
>
>
> binaryImageToShapeLabelMapFilterPointer->SetInput(addImageFilterPointer_2->GetOutput());
>     // (IV)______________
> typedef itk::ShapeOpeningLabelMapFilter<
> BinaryImageToShapeLabelMapFilterType::OutputImageType >
> ShapeOpeningLabelMapFilterType;
>     ShapeOpeningLabelMapFilterType::Pointer shapeOpeningLabelMapFilter =
> ShapeOpeningLabelMapFilterType::New();
>     shapeOpeningLabelMapFilter->SetInput(
> binaryImageToShapeLabelMapFilterPointer->GetOutput() );
>     shapeOpeningLabelMapFilter->SetLambda(6);
>     shapeOpeningLabelMapFilter->ReverseOrderingOff();
>     shapeOpeningLabelMapFilter->SetAttribute(
> ShapeOpeningLabelMapFilterType::LabelObjectType::NUMBER_OF_PIXELS);
>
>     // (V)______________
>     typedef
>
> itk::LabelMapToBinaryImageFilter<BinaryImageToShapeLabelMapFilterType::OutputImageType,
> ImageType> LabelMapToBinaryImageFilterType;
>     LabelMapToBinaryImageFilterType::Pointer
> labelMapToBinaryImageFilterPointer =
> LabelMapToBinaryImageFilterType::New();
>
>
> labelMapToBinaryImageFilterPointer->SetInput(shapeOpeningLabelMapFilter->GetOutput());
>     labelMapToBinaryImageFilterPointer->Update();
>
>     typedef itk::BinaryImageToLabelMapFilter<ImageType>
> BinaryImageToLabelMapFilterType;
>     BinaryImageToLabelMapFilterType::Pointer binaryImageToLabelMapFilter =
> BinaryImageToLabelMapFilterType::New();
>     binaryImageToLabelMapFilter->FullyConnectedOn ();
>
>
> binaryImageToLabelMapFilter->SetInput(labelMapToBinaryImageFilterPointer->GetOutput());
>
>
>
>
>
> --
> View this message in context:
> http://itk-users.7.n7.nabble.com/Troubles-with-the-manipulation-of-label-objects-tp31457p31463.html
> Sent from the ITK - Users mailing list archive at Nabble.com.
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> 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-users
>



-- 
Cemal Cagatay Bilgin, PhD
Life Sciences Division
Lawrence Berkeley National Lab
MS977, One Cyclotron Road
Berkeley, CA 94720, USA
Email: ccbilgin at lbl.gov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130515/7bd9d613/attachment.htm>


More information about the Insight-users mailing list