# How do you find minimum and maximum diameters using the closed curve function?

**URL:** <https://discourse.slicer.org/t/how-do-you-find-minimum-and-maximum-diameters-using-the-closed-curve-function/13944>\
**Category:** Support\
**Created:** [October 8, 2020, 8:32pm UTC](https://discourse.slicer.org/t/how-do-you-find-minimum-and-maximum-diameters-using-the-closed-curve-function/13944 "2020-10-08T20:32:10Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trex48](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/trex48/32/8381_2.png) [@Trex48](https://discourse.slicer.org/u/Trex48)\
**Post date:** [October 8, 2020, 8:32pm UTC](https://discourse.slicer.org/t/how-do-you-find-minimum-and-maximum-diameters-using-the-closed-curve-function/13944/1 "2020-10-08T20:32:10Z")

</div>

RT, I am trying to find the minimum and maximum diameters of a irregular closed curve in the shape of a circle/oval. Does anyone know how to do this via python code or another extension? Thanks!

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [October 9, 2020, 3:02am UTC](https://discourse.slicer.org/t/how-do-you-find-minimum-and-maximum-diameters-using-the-closed-curve-function/13944/2 "2020-10-09T03:02:39Z")

</div>

Have you already extracted the centerline and computed the radius values?

---

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [October 9, 2020, 6:35am UTC](https://discourse.slicer.org/t/how-do-you-find-minimum-and-maximum-diameters-using-the-closed-curve-function/13944/3 "2020-10-09T06:35:04Z")

</div>

I may be wrong, but I understand that @Trex48 is asking for metrics of a closed curve like in the below image, i.e, with respect to the center of an irregular closed curve. The latter can be more complex; perhaps the very notion of minimum and maximum diameters is not valid. Now I may have badly understood @Trex48.

 ![Screenshot](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/2/d2d65e91262088f83302fb3432937d3639097c5e.png)

---

<div class="post-metadata">

**Author:** ![Trex48](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/trex48/32/8381_2.png) [@Trex48](https://discourse.slicer.org/u/Trex48)\
**Post date:** [October 9, 2020, 10:20am UTC](https://discourse.slicer.org/t/how-do-you-find-minimum-and-maximum-diameters-using-the-closed-curve-function/13944/4 "2020-10-09T10:20:56Z")

</div>

Thank you both.

I am simply trying to find the minimum and maximum diameter of a closed curve that has all of its points in the same plane.

Like for this irregular oval shape that I have below. I was able to find a python code to find its surface area but not the minimum and maximum diameter. This is why I am seeking help here. Thanks again.

 ![Capture](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/c/8c2a0abb966261db70e3fef2a095cd80d56aec48.png)

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [October 9, 2020, 1:45pm UTC](https://discourse.slicer.org/t/how-do-you-find-minimum-and-maximum-diameters-using-the-closed-curve-function/13944/5 "2020-10-09T13:45:27Z")

</div>

There are dozens of definition of minimum/maximum diameter for a closed curve. Would you like to use side length of oriented bounding box, diameters of best-fit ellipse, diameter of minimum inscribed/minimum circumsribed circle,…? Or min/max axis length across the centroid? Do the axes have to be orthogonal?

Which one do you need to compute?

---

<div class="post-metadata">

**Author:** ![Trex48](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/trex48/32/8381_2.png) [@Trex48](https://discourse.slicer.org/u/Trex48)\
**Post date:** [October 9, 2020, 8:23pm UTC](https://discourse.slicer.org/t/how-do-you-find-minimum-and-maximum-diameters-using-the-closed-curve-function/13944/6 "2020-10-09T20:23:39Z")

</div>

It would be min/max diameter across the centroid, and the axes would have to be perpendicular to each other.

Thanks! Sorry I was not clear with this.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [October 9, 2020, 10:11pm UTC](https://discourse.slicer.org/t/how-do-you-find-minimum-and-maximum-diameters-using-the-closed-curve-function/13944/7 "2020-10-09T22:11:42Z")

</div>

> [@Trex48](#):
>
> min/max diameter across the centroid, and the axes would have to be perpendicular to each other

This would be an overconstrained specification (there is no solution except very special cases). If the axes must be orthogonal then you need to specify a different criteria (e.g., axes of best fit ellipse).

---

<div class="post-metadata">

**Author:** ![Trex48](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/trex48/32/8381_2.png) [@Trex48](https://discourse.slicer.org/u/Trex48)\
**Post date:** [October 9, 2020, 10:23pm UTC](https://discourse.slicer.org/t/how-do-you-find-minimum-and-maximum-diameters-using-the-closed-curve-function/13944/8 "2020-10-09T22:23:12Z")

</div>

I see. Thank you, I will go back and rethink about my criteria. I appreciate your insights on this.

---

<div class="post-metadata">

**Author:** ![CNCLD\_Ragama](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cncld_ragama/32/79513_2.png) [@CNCLD\_Ragama](https://discourse.slicer.org/u/CNCLD_Ragama)\
**Post date:** [February 20, 2025, 3:07pm UTC](https://discourse.slicer.org/t/how-do-you-find-minimum-and-maximum-diameters-using-the-closed-curve-function/13944/9 "2025-02-20T15:07:16Z")

</div>

> [@lassoan](#):
>
> axes of best fit ellipse).

i also need to know how to get this

---

<div class="post-metadata">

**Author:** ![Deep\_Learning](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deep_learning/32/15345_2.png) [@Deep\_Learning](https://discourse.slicer.org/u/Deep_Learning)\
**Post date:** [February 21, 2025, 12:33pm UTC](https://discourse.slicer.org/t/how-do-you-find-minimum-and-maximum-diameters-using-the-closed-curve-function/13944/10 "2025-02-21T12:33:45Z")

</div>

look at PCA, Principal component analysis.
