[Insight-users] Troubles with the manipulation of label objects
Antonio Calabrese
calantoanto at gmail.com
Wed May 15 11:08:20 EDT 2013
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.
More information about the Insight-users
mailing list