# itk::LabelGeometryImageFilter GetMajorAxisLength() return type

**URL:** <https://discourse.itk.org/t/itk-labelgeometryimagefilter-getmajoraxislength-return-type/4876>\
**Category:** Beginner Questions\
**Created:** [March 24, 2022, 4:48am UTC](https://discourse.itk.org/t/itk-labelgeometryimagefilter-getmajoraxislength-return-type/4876 "2022-03-24T04:48:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anillspawar](https://discourse.itk.org/letter_avatar_proxy/v4/letter/a/49beb7/32.png) [@anillspawar](https://discourse.itk.org/u/anillspawar)\
**Post date:** [March 24, 2022, 4:48am UTC](https://discourse.itk.org/t/itk-labelgeometryimagefilter-getmajoraxislength-return-type/4876/1 "2022-03-24T04:48:58Z")

</div>

I am using itk::LabelGeometryImageFilter to GetMajorAxisLength() of an object. I want to know the return unit of length given, is it in millimeter or pixel? If it is in pixel how to convert it into millimeter?

Thanks in advance 🙂

---

<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:** [March 24, 2022, 12:47pm UTC](https://discourse.itk.org/t/itk-labelgeometryimagefilter-getmajoraxislength-return-type/4876/2 "2022-03-24T12:47:49Z")

</div>

Hello @anillspawar,

The measurement is always in metric units. For many use cases this is mm.

ITK is not aware of the unit associated with the image spacing. If the unit is something other than mm then that is the unit of your length (for microscopy images this will more commonly be nm and not mm).

---

<div class="post-metadata">

**Author:** ![Lee\_Newberg](https://discourse.itk.org/user_avatar/discourse.itk.org/lee_newberg/32/1461_2.png) [@Lee\_Newberg](https://discourse.itk.org/u/Lee_Newberg)\
**Post date:** [March 24, 2022, 12:57pm UTC](https://discourse.itk.org/t/itk-labelgeometryimagefilter-getmajoraxislength-return-type/4876/3 "2022-03-24T12:57:10Z")

</div>

A little off topic, but in case it helps … if the image is organic tissue (with hundreds to thousands of cells) then the resolution is typically expressed in microns rather than mm or nm. In this case, if the image is labeled as “10x” magnification then that is approximately 1 micron per pixel. If it is labeled as “20x” magnification then that is approximately 0.5 microns per pixel, and so on.

---

<div class="post-metadata">

**Author:** ![anillspawar](https://discourse.itk.org/letter_avatar_proxy/v4/letter/a/49beb7/32.png) [@anillspawar](https://discourse.itk.org/u/anillspawar)\
**Post date:** [March 26, 2022, 3:43am UTC](https://discourse.itk.org/t/itk-labelgeometryimagefilter-getmajoraxislength-return-type/4876/4 "2022-03-26T03:43:16Z")

</div>

Thanks @zivy for quick answer.  
I am using CT images and pixel spacing is in mm, so you are saying measured lengths using itk::LabelGeometryImageFilter will be in mm only and there is no need to multiply with pixel spacing additionally?

---

<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:** [March 26, 2022, 8:51pm UTC](https://discourse.itk.org/t/itk-labelgeometryimagefilter-getmajoraxislength-return-type/4876/5 "2022-03-26T20:51:48Z")

</div>

Hello @anillspawar,

Yes, that is correct, the measurement will be in mm and you don’t need to multiply by the pixel spacing.
