# Calculate volume of largest and minimum ellipse around a segmentation

**URL:** https://discourse.itk.org/t/calculate-volume-of-largest-and-minimum-ellipse-around-a-segmentation/2667
**Category:** Algorithms
**Tags:** python, dicom
**Created:** [January 31, 2020, 3:39pm UTC](https://discourse.itk.org/t/calculate-volume-of-largest-and-minimum-ellipse-around-a-segmentation/2667 "2020-01-31T15:39:53Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![ral\_san](https://discourse.itk.org/user_avatar/discourse.itk.org/ral_san/32/236_2.png) [@ral\_san](https://discourse.itk.org/u/ral_san)
#### Post date: [February 14, 2020, 10:21am UTC](https://discourse.itk.org/t/calculate-volume-of-largest-and-minimum-ellipse-around-a-segmentation/2667/5 "2020-02-14T10:21:31Z")

</div>

I think I managed to solve this issue.

> <https://gist.github.com/raluca-san/5d8bd4dcb3278b8e2f6dfa959614f9c8>

What is missing is extracting the surface points from a segmentation mask. That could be extracted using the `SimpleITK.LabelContour(img, fullyConnected=False)`.  
Also the spacing information is missing, so the ellipsoid should be adjusted by placing it on the correct grid.  
This can be achieved `scikit-image.draw.ellipsoid`[https://scikit-image.org/docs/dev/api/skimage.draw.html#skimage.draw.ellipsoid](https://scikit-image.org/docs/dev/api/skimage.draw.html#skimage.draw.ellipsoid).

Is it possible to propose adding this functionality to the official SimpleITK library?

---

_[View the full topic](https://discourse.itk.org/t/calculate-volume-of-largest-and-minimum-ellipse-around-a-segmentation/2667)._
