# Trying to access LabelGeometryImageFilter in ITK 5.2.1.post1 python package.

**URL:** <https://discourse.itk.org/t/trying-to-access-labelgeometryimagefilter-in-itk-5-2-1-post1-python-package/4538>\
**Category:** Beginner Questions\
**Tags:** itkv5, filtering, labels, python\
**Created:** [October 31, 2021, 3:39pm UTC](https://discourse.itk.org/t/trying-to-access-labelgeometryimagefilter-in-itk-5-2-1-post1-python-package/4538 "2021-10-31T15:39:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![LalithShiyam](https://discourse.itk.org/user_avatar/discourse.itk.org/lalithshiyam/32/2344_2.png) [@LalithShiyam](https://discourse.itk.org/u/LalithShiyam)\
**Post date:** [October 31, 2021, 3:39pm UTC](https://discourse.itk.org/t/trying-to-access-labelgeometryimagefilter-in-itk-5-2-1-post1-python-package/4538/1 "2021-10-31T15:39:15Z")

</div>

Dear ITK devs,  
Many thanks for creating such a solid tool. I am currently trying to migrate from SimpleITK to ITK python because of LabelGeometryImageFilter’s ability to calculate orientation as well. I would like to calculate the orientation of the binary label objects for my morphometric analysis.  
I installed ITK 5.2.1.post1 using PIP (itk-filtering included, OS: Linux and Mac) . However, when I try to use LabelGeometryImageFilter using “itk. LabelGeometryImageFilter” - I get the following error: AttributeError: module ‘itk’ has no attribute ‘LabelGeometryImageFilter’. Am I doing something wrong? Any guidance would be highly appreciated.  
Many thanks,  
Lalith 🙂

---

<div class="post-metadata">

**Author:** ![zivy](https://discourse.itk.org/user_avatar/discourse.itk.org/zivy/32/1726_2.png) [@zivy](https://discourse.itk.org/u/zivy)\
**Post date:** [October 31, 2021, 9:28pm UTC](https://discourse.itk.org/t/trying-to-access-labelgeometryimagefilter-in-itk-5-2-1-post1-python-package/4538/2 "2021-10-31T21:28:21Z")

</div>

Hello @LalithShiyam

Possibly take a look at SimpleITK’s [LabelShapeStatisticsImageFilter](https://simpleitk.org/doxygen/v2_0/html/classitk_1_1simple_1_1LabelShapeStatisticsImageFilter.html), it computes orientation information too. For a detailed usage example, characterizing the shapes of bacteria, see [this jupyter notebook](https://github.com/InsightSoftwareConsortium/SimpleITK-Notebooks/blob/master/Python/35_Segmentation_Shape_Analysis.ipynb).

---

<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:** [November 1, 2021, 4:02pm UTC](https://discourse.itk.org/t/trying-to-access-labelgeometryimagefilter-in-itk-5-2-1-post1-python-package/4538/3 "2021-11-01T16:02:24Z")

</div>

`LabelGeometryImageFilter` is part of `Review` module, and is not built by default. To get it, you should compile ITK with Python wrapping and `Module_ITKReview` turned on.

---

<div class="post-metadata">

**Author:** ![LalithShiyam](https://discourse.itk.org/user_avatar/discourse.itk.org/lalithshiyam/32/2344_2.png) [@LalithShiyam](https://discourse.itk.org/u/LalithShiyam)\
**Post date:** [November 1, 2021, 4:04pm UTC](https://discourse.itk.org/t/trying-to-access-labelgeometryimagefilter-in-itk-5-2-1-post1-python-package/4538/4 "2021-11-01T16:04:24Z")

</div>

Many thanks 🙂 will do so!

---

<div class="post-metadata">

**Author:** ![LalithShiyam](https://discourse.itk.org/user_avatar/discourse.itk.org/lalithshiyam/32/2344_2.png) [@LalithShiyam](https://discourse.itk.org/u/LalithShiyam)\
**Post date:** [November 1, 2021, 4:04pm UTC](https://discourse.itk.org/t/trying-to-access-labelgeometryimagefilter-in-itk-5-2-1-post1-python-package/4538/5 "2021-11-01T16:04:40Z")

</div>

Many thanks - will check it out again 😃

---

<div class="post-metadata">

**Author:** ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)\
**Post date:** [November 1, 2021, 7:38pm UTC](https://discourse.itk.org/t/trying-to-access-labelgeometryimagefilter-in-itk-5-2-1-post1-python-package/4538/6 "2021-11-01T19:38:14Z")

</div>

There are some issue with some computations in the LabelGeometryImageFilter not correctly taking into account the image’s direction cosine matrix and/or the pixel spacing. These have been corrected in the implementation in the ITK LabelMap framework. Please look at the [LabelImageToShapeLabelMapFilter](https://itk.org/Doxygen/html/classitk_1_1LabelImageToShapeLabelMapFilter.html) for an updated implementation.
