shapeOpeningLabelMapFilter

I am using shapeOpeningLabelMapFilter and I am getting a strange message saying the attributes are not a member of ShapeOpeningLabelMapFilter.

/usr/local/include/ITK-5.2/itkShapeOpeningLabelMapFilter.hxx:44:5: error: ‘FERET_DIAMETER’ is not a member of ‘itk::ShapeOpeningLabelMapFilter<itk::LabelMap<itk::LabelObject<long unsigned int, 3> > >::LabelObjectType’ {aka ‘itk::LabelObject<long unsigned int, 3>’}

Here is my code:

auto binaryImageToShapeLabelMapFilter = BinaryImageToLabelMapFilterType_Nodule::New();
binaryImageToShapeLabelMapFilter->SetInput(Binary_Nodule->GetOutput());
binaryImageToShapeLabelMapFilter->Update();

// Remove label objects that have PERIMETER greater than 50
typedef itk::ShapeOpeningLabelMapFilter< BinaryImageToLabelMapFilterType_Nodule::OutputImageType > ShapeOpeningLabelMapFilterType_Nodule;
auto shapeOpening_nodule = ShapeOpeningLabelMapFilterType_Nodule::New();
shapeOpening_nodule->SetInput( binaryImageToShapeLabelMapFilter->GetOutput());
shapeOpening_nodule->SetLambda( 33 );
shapeOpening_nodule->ReverseOrderingOn();
shapeOpening_nodule->SetAttribute( ShapeOpeningLabelMapFilterType_Nodule::LabelObjectType::EQUIVALENT_ELLIPSOID_DIAMETER);
shapeOpening_nodule->Update();

thanks in advance

I am getting this:

error: ‘EQUIVALENT_ELLIPSOID_DIAMETER’ is not a member of ‘itk::ShapeOpeningLabelMapFilter<itk::LabelMap<itk::LabelObject<long unsigned int, 3> > >::LabelObjectType’ {aka ‘itk::LabelObject<long unsigned int, 3>’}
7950 | shapeOpening_nodule->SetAttribute( ShapeOpeningLabelMapFilterType_Nodule::LabelObjectType::EQUIVALENT_ELLIPSOID_DIAMETER);
|

Does shapeOpening_nodule->SetAttribute("EquivalentEllipsoidDiameter"); work?

no.

Do you think that is because the image is a 3d image?
Or because the original image is int64_t?

Or maybe something is wrong with the installation.

A am getting:

/usr/local/include/ITK-5.2/itkShapeOpeningLabelMapFilter.hxx: In instantiation of ‘itk::ShapeOpeningLabelMapFilter::ShapeOpeningLabelMapFilter() [with TImage = itk::LabelMap<itk::LabelObject<long unsigned int, 3> >]’:
/usr/local/include/ITK-5.2/itkShapeOpeningLabelMapFilter.h:74:3: required from ‘static itk::ShapeOpeningLabelMapFilter::Pointer itk::ShapeOpeningLabelMapFilter::New() [with TImage = itk::LabelMap<itk::LabelObject<long unsigned int, 3> >; itk::ShapeOpeningLabelMapFilter::Pointer = itk::SmartPointer<itk::ShapeOpeningLabelMapFilter<itk::LabelMap<itk::LabelObject<long unsigned int, 3> > > >]’

I am almost certain it is not because it is a 3D image. It is also very doubtful it is because the original image was 64-bit. It is probably because of syntax. Maybe take a look at the tests (1 2 3) to figure out proper syntax.

You should use itk::BinaryImageToShapeLabelMapFilter instead of the version without Shape in its name.

Regards,
Christina

2 Likes