# Closed figure expansion/contraction algorithm

Frederic Leymarie leymarie at lems.brown.edu
Wed Nov 27 12:44:24 PST 2002

```Dear Ted

Look for Mathematical Morphology on the web.
What you are describing are called "dilations" and "erosions"
by a "structural element" usually taken to be a round ball
(say of radius 1cm), sometimes approximated by a squared block, etc.

The same technology works in 3D; e.g., see my version of it:
http://www.lems.brown.edu/vision/people/leymarie/MathMorpho/Medical.html

In 2D, you will find good implementation in packages like MATLAB
(with the image processing toolbox).
The khoros package also has many mathematical morphology tools
(the student version is free).
Micromorph from the originators of the field is available under
http://malte.ensmp.fr/Micromorph/mmorpha.htm

I believe you can find free software from researchers active in this
area (especially if you only need a simple dilation/erosion, not
necessarily Euclidean, ...).

I hope this helps,
Frederic
--

Ted Hill wrote:

> Hello,
>
> I am working on a medical imaging application and I need to be able to
> 'expand' and 'contract' closed shapes. These are defined in two dimensions
> as an ordered set of x,y points.
>
> I am wondering if anyone knows of an algorithm in the public domain that can
> be
> used for this?
>
> For example, in my application a physician may trace a line around a tumor
> using the mouse
> (thus defining the set of x,y points). Then the physician may want to expand
> the
> shape by adding a 1 cm margin around it. Alternatively, the physician may
> want to 'shrink' the contour.
>
> Thank you for any suggestions,
>
> Ted Hill
> Software Engineer
> www.tomotherapy.com
>
> -------------
> The compgeom mailing lists: see
> or send mail to compgeom-request at research.bell-labs.com with the line:
> Now archived at http://www.uiuc.edu/~sariel/CG/compgeom/maillist.html.

--
Frederic FOL LEYMARIE, R&D Project leader, SHAPE Lab.
http://www.lems.brown.edu/vision/extra/SHAPE/
Brown University, Division of Engineering, LEMS, Box D
182-4 Hope Street, Providence, Rhode Island 02912, U.S.A.
Tel: +1.401.863.2760, Alternate Voice: x2177, Fax: x9039
mailto:leymarie at lems.brown.edu , http://www.lems.brown.edu/~leymarie
---
It does play with dice ... but are they fixed?

-------------
The compgeom mailing lists: see