# shapeOpeningLabelMapFilter

**URL:** <https://discourse.itk.org/t/shapeopeninglabelmapfilter/5183>\
**Category:** Beginner Questions\
**Created:** [July 14, 2022, 8:34pm UTC](https://discourse.itk.org/t/shapeopeninglabelmapfilter/5183 "2022-07-14T20:34:41Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oddone-Scatena](https://discourse.itk.org/user_avatar/discourse.itk.org/oddone-scatena/32/2651_2.png) [@Oddone-Scatena](https://discourse.itk.org/u/Oddone-Scatena)\
**Post date:** [July 14, 2022, 8:34pm UTC](https://discourse.itk.org/t/shapeopeninglabelmapfilter/5183/1 "2022-07-14T20:34:41Z")

</div>

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:

```cpp
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();

```

---

<div class="post-metadata">

**Author:** ![Oddone-Scatena](https://discourse.itk.org/user_avatar/discourse.itk.org/oddone-scatena/32/2651_2.png) [@Oddone-Scatena](https://discourse.itk.org/u/Oddone-Scatena)\
**Post date:** [July 14, 2022, 8:36pm UTC](https://discourse.itk.org/t/shapeopeninglabelmapfilter/5183/2 "2022-07-14T20:36:36Z")

</div>

thanks in advance

---

<div class="post-metadata">

**Author:** ![Oddone-Scatena](https://discourse.itk.org/user_avatar/discourse.itk.org/oddone-scatena/32/2651_2.png) [@Oddone-Scatena](https://discourse.itk.org/u/Oddone-Scatena)\
**Post date:** [July 14, 2022, 8:43pm UTC](https://discourse.itk.org/t/shapeopeninglabelmapfilter/5183/3 "2022-07-14T20:43:43Z")

</div>

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);  
|

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [July 14, 2022, 9:05pm UTC](https://discourse.itk.org/t/shapeopeninglabelmapfilter/5183/4 "2022-07-14T21:05:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Oddone-Scatena](https://discourse.itk.org/user_avatar/discourse.itk.org/oddone-scatena/32/2651_2.png) [@Oddone-Scatena](https://discourse.itk.org/u/Oddone-Scatena)\
**Post date:** [July 14, 2022, 9:27pm UTC](https://discourse.itk.org/t/shapeopeninglabelmapfilter/5183/5 "2022-07-14T21:27:57Z")

</div>

no.

Do you think that is because the image is a 3d image?  
Or because the original image is int64\_t?

---

<div class="post-metadata">

**Author:** ![Oddone-Scatena](https://discourse.itk.org/user_avatar/discourse.itk.org/oddone-scatena/32/2651_2.png) [@Oddone-Scatena](https://discourse.itk.org/u/Oddone-Scatena)\
**Post date:** [July 14, 2022, 9:38pm UTC](https://discourse.itk.org/t/shapeopeninglabelmapfilter/5183/6 "2022-07-14T21:38:48Z")

</div>

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\> \> \> \>]’

---

<div class="post-metadata">

**Author:** ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)\
**Post date:** [July 14, 2022, 10:27pm UTC](https://discourse.itk.org/t/shapeopeninglabelmapfilter/5183/7 "2022-07-14T22:27:08Z")

</div>

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](https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Filtering/LabelMap/test/itkShapeLabelMapFilterGTest.cxx) [2](https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Filtering/LabelMap/test/itkShapeRelabelImageFilterTest1.cxx) [3](https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Filtering/LabelMap/test/itkShapeLabelObjectAccessorsTest1.cxx)) to figure out proper syntax.

---

<div class="post-metadata">

**Author:** ![crossmanith](https://discourse.itk.org/user_avatar/discourse.itk.org/crossmanith/32/569_2.png) [@crossmanith](https://discourse.itk.org/u/crossmanith)\
**Post date:** [July 20, 2022, 12:10pm UTC](https://discourse.itk.org/t/shapeopeninglabelmapfilter/5183/8 "2022-07-20T12:10:07Z")

</div>

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

Regards,  
Christina
