# Decomposition of **3D** structuring elements for morphological operations

I am struggling to implement a mathematical morphology toolset in an image processing package. I base my implementation on what I saw in MATLAB, and on several papers on the subject.

There seems to be abundant literature on morphological operation optimization through structuring element (strel) decomposition. For instance, one can get a tremendous speed bonus by using two orthogonal lines instead of a square as structuring element for dilation. Several papers give methods for optimization through strel decomposition:

1. Rolf Adams, "Radial Decomposition of Discs and Spheres," CVGIP: Graphical Models and Image Processing, vol. 55, no. 5, September 1993, pp. 325-332.
2. Rein van den Boomgard and Richard van Balen, Methods for Fast Morphological Image Transforms Using Bitmapped Binary Images, CVGIP: Models and Image Processing, vol. 54, no. 3, May 1992, pp. 252-254

etc...

However, all these publications are about 2D structuring elements. I could not find much on 3D decompositions.

Do you have any clues on how to decompose:

1. a 3D sphere. Not a ball that is used in 2D grayscale morphology, but an actual flat 3D sphere;
2. a 3D diamond?
• Can you explain why the flat 2D sphere (AKA circle) approach cannot be generalized to a flat 3D sphere?
– Peter K.
Nov 15, 2013 at 20:22
• @PeterK.: I actually don't know. Yet. I just did experiments on the diamond decomposition and saw it does not generalize. The papers explicitly only treat the 2D case. Nov 15, 2013 at 21:41
• Did you manage to implement a sphere decomposition? (maybe even in Matlab?) Thanks for your response! Jul 24, 2017 at 9:10
– Peter K.
Jul 24, 2017 at 10:59

I guess this depends on the digital distance transform that one is approximating on the 3d grid and there are various local connectivities possible. There is an implementation in ImageJ here.

It would also be good to verify if you are using a non-flat structuring element or a correct 3d structuring element. Read Matlab reference here. In the place of euclidean distance sqrt(x.^2 + y.^2 + z.^2) one could add the Manhattan distance using this. Quick 3d distance here.

For 3d structuring element decomposition one can see. But the 3d decompositions of a convex shapes like sphere into separable 2d lines is non-trivial, certain shapes are easier than others like the cube. One can refer here for efficient algorithms for spheres.

• Hi. I am thinking of a proper flat 3D structuring element. Thanks, I had no clue that changing the distance transform could help simplify the problem. Nov 25, 2013 at 10:26
• Hey Jean, The comment is for flat 3d structuring element, if its non flat - it would become 4d - in the sense, you would have numerical weights for each element in the structuring function - and you would use the Minkowski addition to determine the result of the operation. Also the distance function basically determines what connectivity we are using. If one can express this locally in windows of 3x3 or 5x5 or in 3d windows, one can obtain different forms like Manhattan distance, the disk etc. Nov 25, 2013 at 17:33
• Thank you very much for the paper by Vaz et al. about the decomposition of a 3D flat sphere. It is efficient and clever. However, I could not find an implementation anywhere that would help me to get started. Would you have some leads there? Nov 26, 2013 at 12:50
• Jean-Yeves: I will can give you code if you are still interested (you can connect with me via Linkedin). Best, Michael Vaz
– user8564
Apr 13, 2014 at 4:21
• @MichaelVaz: Thanks! But there are too many homonyms on LinkedIn to find you. Would you care to post the code on a public repository? Apr 14, 2014 at 12:11