12
Volume 14, (1995 ) number 2 pp. 127-138 Fast Generation of Leakproof Surfaces from Well-Defined Objects by a Modified Marching Cubes Algorithm Stefan Roll, Axel Haase and Markus von Kienlin† Universität Würzburg, Physikalisches Institut, EP V, Am Hubland, 97074 Würzburg, Germany [email protected]-wuerzburg.de Abstract Local surface reconstruction by the Marching Cubes algorithm and its derivatives has a well known ambiguity, which prevents constructed surfaces from being closed and simple. We investigate this ambiguity assuming that a 3D image samples well-defined objects. In this case it is justified to aim at tiling of extracted object voxels rather than at reconstructing isosurfaces. Compared to isosurface reconstruction, our algorithm provides essentially the same level of confidence with respect to surface location at a lower computational cost. We present a leak detection and mending scheme which resolves the Marching Cubes ambiguity and guarantees a well-defined behaviour with respect to which objects are covered by which surface. We detail how to implement our leak mending method within a completely tabulated Marching Cubes algorithm. Wefinally give an example of how the adapted algorithm is of benefit to a recently developed 3D MR spectroscopy technique. Keywords: Surface reconstruction; marching cubes; partial volume effect; leak detection. 1. Introduction Over recent years, volumetric imaging by modalities such as computer tomography (CT) or magnetic resonance (MR) imaging has proven its usefulness in various med- ical applications. Fast, stable and accurate rendering algorithms need to be developed to gain visual access to volumetric image data. We present a surface construction algorithm. partic- ularly suited to handle incomplete image information on the objects to be reconstructed. In section 2, we de- fine the term incomplete image information and discuss its implications on local surface reconstruction. Local surface reconstruction, promoted greatly by Lorensen and Cline by introducing the Marching Cubes (MC) algorithm1 (see section 3), has proven to be appropriate for voxel data as the type of image data we consider. However, surfaces constructed by MC do not always exhibit correct local behaviour. In section 4 we examine © The Eurographics Association 1995. Published by Blackwell Publishers, 108 Cowley Road, Oxford OX4 1JF, UK and 238 Main Street, Cambridge, MA 02142, USA. these ambiguous cases, for which missing patches lead to holes in the surface. This ambiguity arising in MC is well known. In contrast to our approach to overcome the ambiguity, methods devised so far rely on the fact that complete information on the object is at hand. We introduce our method of leak mending in section 5 and outline its implementation into a completely tabulated MC algorithm in section 6. Section 7 covers an applica- tion of the presented algorithm, including some remarks on its performance. 2. Assumptions We consider reconstruction of objects by construction of their surfaces from a 3D image. The image is acquired by a spatially resolved measurement of physical param- eters characterizing the objects within the field of view. We deal with intensity images; in this case the result of image acquisition is expressed by a single intensity value at each location of measurement. The image is then given as an ordered set of intensity values form- ing a grid. At each grid vertex, i.e. at each location of

Fast Generation of Leakproof Surfaces from Well-Defined Objects by a Modified Marching Cubes Algorithm

Embed Size (px)

Citation preview

Page 1: Fast Generation of Leakproof Surfaces from Well-Defined Objects by a Modified Marching Cubes Algorithm

Volume 14 , (1995 ) number 2 pp . 127-138

Fast Generation of Leakproof Surfaces from Well-Defined Objects by a

Modified Marching Cubes Algorithm

Stefan Roll, Axel Haase and Markus von Kienlin†

Universität Würzburg, Physikalisches Institut, EP V, Am Hubland, 97074 Würzburg, Germany [email protected]

Abstract Local surface reconstruction by the Marching Cubes algorithm and its derivatives has a well known ambiguity, which prevents constructed surfaces from being closed and simple. We investigate this ambiguity assuming that a 3D image samples well-defined objects. In this case it is justified to aim at tiling of extracted object voxels rather than at reconstructing isosurfaces. Compared to isosurface reconstruction, our algorithm provides essentially the same level of confidence with respect to surface location at a lower computational cost. We present a leak detection and mending scheme which resolves the Marching Cubes ambiguity and guarantees a well-defined behaviour with respect to which objects are covered by which surface. We detail how to implement our leak mending method within a completely tabulated Marching Cubes algorithm. We finally give an example of how the adapted algorithm is of benefit to a recently developed 3D MR spectroscopy technique.

Keywords: Surface reconstruction; marching cubes; partial volume effect; leak detection.

1. Introduction

Over recent years, volumetric imaging by modalities such as computer tomography (CT) or magnetic resonance (MR) imaging has proven its usefulness in various med- ical applications. Fast, stable and accurate rendering algorithms need to be developed to gain visual access to volumetric image data.

We present a surface construction algorithm. partic- ularly suited to handle incomplete image information on the objects to be reconstructed. In section 2, we de- fine the term incomplete image information and discuss its implications on local surface reconstruction. Local surface reconstruction, promoted greatly by Lorensen and Cline by introducing the Marching Cubes (MC) algorithm1 (see section 3), has proven to be appropriate for voxel data as the type of image data we consider. However, surfaces constructed by MC do not always exhibit correct local behaviour. In section 4 we examine

© The Eurographics Association 1995. Published by Blackwell Publishers, 108 Cowley Road, Oxford OX4 1JF, UK and 238 Main Street, Cambridge, MA 02142, USA.

these ambiguous cases, for which missing patches lead to holes in the surface. This ambiguity arising in MC is well known. In contrast to our approach to overcome the ambiguity, methods devised so far rely on the fact that complete information on the object is at hand. We introduce our method of leak mending in section 5 and outline its implementation into a completely tabulated MC algorithm in section 6. Section 7 covers an applica- tion of the presented algorithm, including some remarks on its performance.

2. Assumptions

We consider reconstruction of objects by construction of their surfaces from a 3D image. The image is acquired by a spatially resolved measurement of physical param- eters characterizing the objects within the field of view. We deal with intensity images; in this case the result of image acquisition is expressed by a single intensity value at each location of measurement. The image is then given as an ordered set of intensity values form- ing a grid. At each grid vertex, i.e. at each location of

Page 2: Fast Generation of Leakproof Surfaces from Well-Defined Objects by a Modified Marching Cubes Algorithm

128

measurement, the intensity value represents an average of the measured parameters over a spatial element or voxel. With identical, cuboidal and not-overlapping vox- els centred at the vertex locations this type of image commonly arises in 3D MR imaging.

S. Roll et al. / Leakproof Surfaces

Some points of the isoline I’ are obtained by interpo- lating along the lines connecting neighbouring vertices with intensities above and below I’ (Figure la.). More than that, arbitrarily many points of the isoline can be determined by considering squares formed by four ver-

We note that due to sampling, the true object function, that is the complete information about the spatial distri- bution of the measured object parameters, is unknown. Object details smaller than voxel size are not resolved in the image. Instead, averaged intensity values are ob- tained for partially filled voxels at object boundaries. Stating this we imply that image objects possess well defined boundaries, i.e., the object function is discontin- uous on the scale given by image resolution. Transition regions between adjacent objects are smaller than voxel size and are therefore undersampled. Well-defined ob- jects are commonly the case in medical applications of MR imaging. As detailed by Höhne et al.2, surface reconstruction is indeed only adequate to retrieve the shapes of well-defined objects, whereas other methods are better suited to visualize fuzzy objects.

Our assumptions amount to the fact that the informa- tion on the object in the image (the image information) is incomplete. Former work on local surface reconstruction by algorithms derived from MC is based on the assump- tion that the object function is either known (e.g., in the context of computational geometry, it is given as an analytical function f ( x , y , z ) = const., as in the papers by Wyvill et al.3 and by Williams and van Gelder4), or that it can be interpolated from a discrete intensity image with an arbitrary degree of accuracy (see for example Nielson’s and Hammann’s paper5). In both of these cases, the task of surface generation is to reconstruct isosurfaces defined by f(x,y,z)= const. or

const. of correct topology, i.e., of correct behaviour within a voxel. Only recently Ning and Bloo- menthal published an excellent review of work in this field6.

The question is, whether an interpolant of the image can yield the object function, given that the constraints on the image data as introduced above are in effect. We show in the remainder of this section that generally this is not the case.

In Figure 1, a 2D example is given to demonstrate the idea of isosurface reconstruction by intensity interpola- tion for a smooth object function. We may think of the shown function as a cut of 3D spherically symmetrical, continuous and monotonically decreasing function, in which case an isosurface, defined by an intensity value I’, appears as an isocircle. If we regard this function to be an object function and assume we know its values only at some grid points (point-wise sampling, Figure la.), linear interpolation between grid points approxi- mates this object function and hence each of its isolines.

tices which are crossed by the isoline. In this case, a bilinear interpolation is employed in order to find the isoline in the plane (not shown). Accordingly, isosurfaces can be found by trilinear interpolation in 3D space. The same holds true if we consider the object function to be sampled by voxels (Figure 1b). Due to the fact that the function is smoothly decreasing over voxel dimensions, voxel values are almost equal to values obtained by point sampling. Therefore, interpolation works equally well.

We encounter a different situation if we consider dis- continuous object functions. An example is given in Figure 2. If we approach the problem of discontinu- ity reconstruction by isosurface interpolation as above, we have to choose a boundary-defining intensity thresh- old I’. We detail elsewhere (Röll et al.7), that a value close to the mean value of mean object and mean back- ground intensities serves as an optimum threshold inten- sity, For pointwise sampling (Figure 2a), interpolation then always yields the centre points of the lines connecting inside and outside vertices. Whereas this selection of I’ minimizes the overall error of mislo- cating the object boundary, a single interpolation may deviate up to half the voxel size from the true object boundary.

In case of the disc, interpolation yields a better re- sult when the object is sampled by voxels (Figure 2b). Various intensities along the image discontinuity are generated due to different degrees of filling of the voxel with object intensity. This phenomenon is often referred to as a partial volume effect. The voxel-sampled image becomes similar to the voxel-sampled image of a con- tinuous function. As Figure 2b shows, this additional information is taken into account by interpolation.

However, this regularizing property of voxel sampling does not help to reconstruct more general objects than the regular disc. If an object shows detail of voxel size or smaller, this detail information vanishes and cannot be retrieved by interpolation (see Figure 3).

Regarding voxel sampled image data as the case we are concerned with, we may sum up the discussion of interpolating the object function from the image data as follows: depending on the object function, there are cases where the location of a well-defined object bound- ary can not be computed from the image by interpo- lation. Therefore, it is not always justified to resolve ambiguities in surface reconstruction by comparing re- constructed surfaces to an interpolant of the image as an approximation to the object function. We discussed partial volume effects here in a qualitative manner; a

© The Eurographics Association 1995

Page 3: Fast Generation of Leakproof Surfaces from Well-Defined Objects by a Modified Marching Cubes Algorithm

S. Röll et al. / Leakproof Surfaces 129

Figure 1: a. 2D intensity plot o f a spherically symmetrical, continuous function. The circle singles out an intensity I'. The result of linear interpolation for I' between vertices of the sampling grid is marked by crosses. b. The same function is rastered to the sampling grid, indicating that now each grid point represents the average intensity of its voxel. As in a., interpolation for I' is shown.

Figure 2: a. A disc of uniform intensity surrounded by a uniform background. The result of interpolating the location of the disc is marked by crosses, assuming pointwise sampling and choosing I' to be the average intensity of disc and background. The disc is placed off-centre in order to break symmetry and make the example less special. b. The image of the same disc for the case of voxel sampling. The result of interpolation between inside and outside vertices for the same interpolation value I' is shown.

quantitative approach to the problem is presented in another contribution (Roll et al.7).

Instead of attempting to pinpoint the object function with subvoxel accuracy, we restrict surface reconstruc- tion to the task of finding a surface representation for ex- tracted objects. This is not only a more sound approach with respect to image data lacking subvoxel informa- tion, but this is also the actual problem arising in most applications. In the case of real MR images, complica- tions such as image noise and overlapping intensities of different image objects render isosurface reconstruction by interpolating for a single intensity value infeasible. Instead, more sophisticated segmentation techniques are employed or the object is manually extracted by a human expert. As an example for the first case, the segmentation

technique used in the application presented in section 7 is shown in Figure 4. The result of a segmentation process commonly consists of binary information indi- cating for each voxel at least, whether or not it belongs to an object class. We may leave the decision whether or not two voxels belong not only to the same class but also to the same object, to the surface reconstruction algorithm. In general, once the surfaces of segmented objects are defined they do not correspond to isosur- faces. More precisely, it is hardly possible to reconstruct an isosurface for a segmented object by interpolating between pairs of its boundary vertices and the first layer of outside vertices, since generally not all of these pairs of intensity values will include the intensity value chosen for the interpolation.

© The Eurographics Association 1995

Page 4: Fast Generation of Leakproof Surfaces from Well-Defined Objects by a Modified Marching Cubes Algorithm

130 S. Roll et al. / Leakproof Surfaces

Figure 3: Object function showing detail smaller than voxel size. The intensities for voxel sampling are given and the result of interpolating for the mean object/background intensity is indicated.

It is practical to call vertices belonging to an object class hot vertices. Utilizing only binary hot/cold informa- tion obtained from the segmentation, we expect a surface reconstruction algorithm to satisfy these requirements.

It must decide consistently which hot vertices belong to the same object. Hot vertices belonging to the same object are to be covered by the same surface. The constructed surface must be leakless. The constructed surface must be simple, i.e., it must

Obviously, since we are concerned with the tiling of vox- els, there always is a solution satisfying these require- ments. The cheapest solution would consist of surfaces built by the outside faces of the boundary voxels of the segmented objects. However, such ragged surfaces are hardly acceptable. We demonstrate how binary infor- mation can be used more effectively to obtain smoother tiling surfaces. However, in order to guarantee leakless surfaces our algorithm needs to overcome the ambiguity inherent in the original MC algorithm by using binary information only.

not have ramifications.

3. The Original Marching Cubes Algorithm

Marching Cubes (MC) tackles the problem of surface construction in a local manner: the surface is built up of patches chosen by considering the pattern of hot vertices for elementary cubes, formed by 2x2x2 adja- cent vertices (Figure 5). The algorithm examines each elementary cube inside the grid.

Figure 4: Slice along the long axis of a 3D MRI dataset of a heart (see section 7). Image noise does not allow iso- surface reconstruction by interpolating for a single inten- sity value. In order to segment the cardiac muscle, we em- ployed a 2D deformable contour model (Kass et al.8). The result of the segmentation process in one slice (marked by the white outline) is used as the initial guess in the next slice. Since for this example there is only one object of interest, segmentation yields not only the object class but the object itself:

Figure 5: An elementary cube formed by volumetric data

The shape of a surface patch inside an elementary cube only depends on the combination of the hot and cold vertices of the cube. 28 = 256 combinations are

© The Eurographics Association 1995

Page 5: Fast Generation of Leakproof Surfaces from Well-Defined Objects by a Modified Marching Cubes Algorithm

S. Roll et al. / Leakproof Surfaces 131

Figure 6: Inversion symmetry: the same surface triangle is generated, whether one vertex or seven vertices are hot.

possible. The number of combinations is reduced to 15 distinct cases by taking symmetries into account. Inversion symmetry is the requirement that the surface does not change if we swap hot and cold (Figure 6). Due to inversion symmetry only combinations with none to four hot vertices need to be considered. Rotational symmetry further reduces the number of distinct cases. Figure 7 shows the surface patches of all 15 elementary cases as they were given in the original contribution by Lorensen and Cline1.

In case 0, all vertices lie outside or - due to inversion symmetry - inside an object. Hence no surface is created. The other cases represent all possible elementary vertex combinations on the boundary of objects. In the case of a single hot vertex, case 1 is applied eight times; the vertex is covered by an octahedron (Figure 8a). This is the basic volume shape intrinsic to the algorithm. For a single hot vertex, a cube would be a better approximation of its voxel. However, as soon as objects formed by a few hot vertices are considered, octahedra merge and form a polyhedral surface with less local bending than a cuboidal surface. As shown in Figure 8b, for two hot vertices adjacent to each other, case 2 is applied four times and case 1 again eight times, so that both octahedra are fused to a cuboid with two pyramids at its sides.

Figure 7 lies at the heart of local surface construction. Its modification and its implementation are the main parts of our contribution.

When rendered as such, polyhedral surfaces still look jagged. By interpolating image gradients (taken along the three spatial directions) to the surface location, an approximation of the surface gradient is found. This gradient is useful for shading the surface. Barillot et al.9 and Höhne et al.10 were the first to propose this effective technique known as Grey Level Gradient Shad- ing; Lorenson and Cline incorporated it into Marching Cubes. Modern workstations allow bilinear colour in- terpolation or Gouraud Shading. On these machines, it is straightforward to generate smoothly shaded images

Figure 7: Triangulation o f the 15 elementary cases as in the originaAl MC algorithm

Figure 8: a. A single hot vertex is covered by an octahe- dron. b. For two hot vertices, two octahedra are fused.

from the polyhedral surfaces constructed by Marching Cubes.

4. The Problem of Leaks

At a first glance triangulation according to Figure 7 seems to yield correct surfaces. However, not all pat- terns of Figure 7 can be safely combined with each other. Figure 9 illustrates how a vertex combination in two adjacent cubes leads to a hole (leak) in the con- structed surface. This ambiguity arising in surface recon- struction is well known; it has been pointed out, for

© The Eurographics Association 1995

Page 6: Fast Generation of Leakproof Surfaces from Well-Defined Objects by a Modified Marching Cubes Algorithm

132 S. Roll et al. / Leakproof Surfaces

Figure 9: Combination where the unmodified M C algo- rithm creates a hole.

Figure 10: Possible vertex combinations on a common face of two elementary cubes. Due to inversion symmetry, the case of a single hot vertex is equivalent to the case of three hot vertices.

example by Wyvill et al.3 and by Dürst11. Applying MC triangulation to segmented MR images, we found the number of ambiguous cases to be related to the smooth- ness of the extracted objects. For objects extracted by deformable contours (Figure 4), approximately 0.1 % of the triangles are missing. When objects are more crudely extracted by an intensity threshold, the fraction rises up to 5%. Surface leaks are neither acceptable with respect to surface visualization nor with respect to surface area measurement, another application of local surface con- struction (see e.g. Roll et al.7). As we point out above, since we are concerned with tiling of voxels, we can be sure that a leakless surface does always exist.

We may systemize the formation of leaks in the fol- lowing way: triangulated surfaces are closed and simple if and only if all triangle edges occur exactly twice in the constructed surface. Since triangle edges inside the elementary cubes are connected by definition, holes may only arise on the faces of elementary cubes when trian- gles of adjacent cubes are misconnected. For the com- mon face of two elementary cubes, four distinct cases have to be considered. Trivially, in the case of no hot vertex on the common face, no polygon passes the face and hence no ambiguity arises. Due to inversion sym- metry the same argument applies to the case of four hot vertices.

The remaining three non-trivial occupation patterns of the common face are shown in Figure 10. In the cases of one hot vertex or two hot vertices connected by a cube edge, there is one triangle edge on the common

face. It can be shown in both cases that this edge always experiences a proper connection. Keeping the vertex combination of the common plane fixed, we reduce the number of the remaining 256 possible combinations to a smaller number of distinct combinations by making use of these symmetries: the lower and the upper plane (Figure 10) may be swapped, i.e., considering all com- binations of i hot vertices in the upper and of j in the lower plane, is equivalent to considering j hot vertices in the lower and i in the upper plane. Secondly, rota- tions of planes against each other leading to equivalent cases were looked at only once. Table 1a,b breaks down how the 86 distinct combinations for a single hot vertex in the common plane and the 79 combinations for two adjacent hot vertices are distributed with respect to the number of vertices in the upper and lower plane. None of the combinations lead to a leak.

The original MC triangulation can generate leaks only in the remaining case of two hot vertices in the common plane lying opposite to each other (alternating vertices). For alternating vertices, plane swapping and rotation symmetry reduces the number of distinct combinations to 62. For 22 of these combinations, triangle edges in the common plane remain unconnected (see Figure 9). Again, the result is split up for all distinct numbers of hot vertices in the non-fixed planes (Table 1c). We will address the problem in the following section.

Our examination of polygon connection within cubes sharing a face is completed. Since polygon edges never come to lie on cube edges (see Figure 7), there is no point in examining cubes sharing an edge in order to find more leaky cases. Indeed, only cube faces with alternating vertices are candidates for improper surface connection. Hence, holes may arise in the following elementary cases (Figure 7): on one face of the elementary cases 3 and 6 , on two faces of cases 10 and 12, on three faces of case 7 and on all six faces of case 13.

As mentioned, earlier publications addressed the MC ambiguity in the context of isosurface interpolation (Wyvill et al.3, Wilhelms and van Gelder4). A very readable review on local isosurface reconstruction was published by Ning and Bloomenthal6. We found the contribution by Nielson and Hamman5 closest to our approach. However, they present an alternative way of resolving the ambiguity. We refer to the point where their work deviates from ours in the next section.

In the context of development of MC, a reference to an approach of improvement of local surface reconstruc- tion is merited: the Splitting Box algorithm presented by Muller and Stark12 composes surfaces of generic surface patches. Larger patches are more desirable than the sim- ple MC triangulation with respect to the surface quality and surface rendering.

© The Eurographics Association 1995

Page 7: Fast Generation of Leakproof Surfaces from Well-Defined Objects by a Modified Marching Cubes Algorithm

S. Roll et al. / Leakproof Surfaces 133

a. Single hot vertex on common face: # of hot vertices . . . in upper plane . . . in lower plane

b. Two adjacent hot vertices on common face: # of hot vertices . . . in upper plane , . . in lower plane

c. Two alternating hot vertices on common face: # of hot vertices . . . in upper plane . . . in lower plane

Table 1: Distinct combinations of hot vertices for two ad- jacent cubes. With the common plane fixed to (a.) one hot vertex leading to 86 distinct combinations, or fixed to (b.) two adjacent hot vertices leading to 79 distinct com- binations, polygon edges on the common face experience a proper connection, no leaks are created. (c.) For the case of alternating vertices on the common face, 64 distinct combinations had to be examined. 22 of these combina- tions, marked by *, exhibit leaks.

5. Detection and Mending of Leaks

In this section we propose a simple but effective method of resolving the MC ambiguity. We split the problem into leak detection and leak mending and look at leak detection first. In the previous chapter we examined all 64 distinct cases of adjacent cubes with alternating vertices on the common face. We can summarize the arising of leaks by the following theorem: a hole arises if and only if one of the elementary cubes represents an inverted case (five or six vertices are hot) and the other does not (two, three or four vertices are hot). This fact is implied by Table 1c. In order to obtain the number of hot vertices for the upper and lower cube from Table 1c, we must not forget to add both alternating vertices

Figure 11: a. More examples where inverted meet not- inverted cases. On the common face, four edges forming a rectangle remain unpaired. b. Examples where inverted meet inverted, or not-inverted meet not-inverted cases. All edges are properly connected, simple surfaces are created which cover hot vertices connected by cube edges.

to the number of hot vertices of the upper and lower plane, respectively.

We know of no proof of the theorem other than ex- amining all possible cases by hand or by a computer program. We have manually inspected the 64 distinct combinations of Table 1c. Six examples of adjacent cubes with alternating vertices are shown in Figure 11. Compare the combinations shown in Figure 1 la, where an inverted meets a not-inverted combination and hence a leak arises, to those in Figure 11b, where this is not the case and all edges are connected. In order to verify the correct implementation of our algorithm, we further wrote a program which displays vertex combinations and surface patches in a similar manner as they are shown in Figure 11. After surface reconstruction ac- cording to Figure 7 had been implemented, we used this program to examine visually all 256 combinations of vertices in adjacent cubes with alternating vertices with respect to the theorem. Hereby we made sure that we did not miss an important case when we reduced the num- ber of combinations to 64. Finally, the theorem passed an automated test successfully: a program to detect un- paired edges was applied to all possible 212 = 4096 combinations of hot vertices in adjacent cubes. This test demonstrated, that leaks may only arise in the case of alternating vertices on the common face.

With respect to implementation of leak detection, the theorem says that unambiguous leak detection is achieved by simply looking up the number of hot ver-

© The Eurographics Association 1995

Page 8: Fast Generation of Leakproof Surfaces from Well-Defined Objects by a Modified Marching Cubes Algorithm

134 S. Roll et al. / Leakproof Surfaces

tices of cubes sharing a suspicious face, i.e. a common plane with alternating hot vertices.

Inspection of all Combinations with alternating ver- tices reveals another simple property, which implies how leaks are to be mended: all holes consist of four dis- connected edges forming a rectangle on the common face (Figures 9, 11). Therefore a leak is mended by filling the four intersection points of the ambiguous face with two triangles forming a rectangle.

Nielson and Hamman5(p. 84) state correctly that if a face with alternating vertices is always filled with a rectangular patch, this could lead to more than two triangles sharing a common edge. The constructed sur- face would not be simple. For this reason Nielson and Hamman developed an alternative method of ambiguity resolution in the context of isosurface reconstruction. However, if we fill in a rectangular patch only for the cases where a leak has been detected, exactly two tri- angles share a common edge and therefore a simple surface is constructed. Again, this property has been tested by inspecting all combinations with alternating vertices as well as by the program searching for dis- connected edges. With our scheme of leak detection and mending implemented, not a single unpaired edge is found in any of the 4096 combinations of adjacent cubes.

The topology of the surface constructed by our scheme of leak detection and mending can be summarized by the following theorem: only hot vertices connected to each other by cube edges are covered by the same sur- face. Hot vertices which are not connected in the sense of this next-neighbour neighbourhood are covered by differ- ent surfaces and must therefore be regarded as belonging to different objects. This theorem has been proven by visual inspection of the 64 distinct combinations with alternating vertices. No automated test has been carried out in this case. If we compare the case of two hot vertices sharing a cube edge (Figure 7, case 2) to those hot vertices sharing a cube diagonal (Figure 7 , case 3 and 4), we note that this topology is inherent to the original MC algorithm. We have shown that the ambi- guity arising on faces with alternating vertices does not require abandonment of this well-defined behaviour of surfaces. Heiden et al.13 attempted to extend MC so that hot vertices which are not connected by cube edges are covered by the same surface. However, they do not claim that their algorithm works consistently for all possible combinations.

6. Implementation of a Completely Tabulated

In order to take advantage of the local nature of the MC algorithm, it is essential to reduce run-time computations

Marching Cubes Algorithm

Figure 12: a. Labelling of vertices and edges; b. Labelling o f intersections.

as much as possible. We now describe an MC algorithm based solely on the retrieval of information from several look-up tables. Our leak detection and mending scheme fits in naturally with tabulation.

It is sufficient to read adjacent data planes into mem- ory instead of reading the entire data volume. Two adjacent data planes form a case plane, i.e. plane of elementary cubes. With one bit assigned to each ver- tex of an elementary cube as shown in Figure 12, the combination of hot and cold vertices of each elementary cube is defined by an 8 bit number. For this number we use the variable name comb. Hence, with xres, yres and zres representing the resolution of the dataset, a case plane of bit numbers contains all the information necessary for surface reconstruction between the two data planes. For leak mending an addi- tional case plane has to be kept in memory; calculation of surface normals for Grey Level Gradient Shading requires the storage of two more data planes enveloping the actual case plane. To treat the margin of the vol- ume correctly, the volume is wrapped by two additional layers of background value.

With two adjacent case planes in memory the surface can be reconstructed. The following outline of the im- plementation corresponds to the pseudo-code fragment in Table 2.

© The Eurographics Association 1995

Page 9: Fast Generation of Leakproof Surfaces from Well-Defined Objects by a Modified Marching Cubes Algorithm

S. Roll et al. / Leakproof Surfaces 135

Table 2: Pseudo C code containing the essential algorithm

A major look-up table treatment contains for each combination comb as the first entry casenum = treatment [comb] [0] , the number of the pertinent ele- mentary case. The triangulation of the elementary cases as proposed by Lorensen and Cline is stored in the ar- ray cases in the following manner: for each triangle the edge-numbers (of its intersection points), as they are defined by Figure 12a, are stored consecutively in

cases [casenum] [i] with i running from 0 to 11, since 4 triangles are created at most per elementary case. To find the intersections of the cube edges, i.e. the trian- gle coordinates for a given combination comb, again the major look-up table is consulted: the edge number ed = cases [casenum] [i] serves as an index to look up an intersection number, is, in the treatment table: i s = treatment [comb] [ed] .

The intermediate step of looking up the cases table is redundant. However, to facilitate program modifica- tion it is desirable to keep a two layer data structure here. Furthermore, it is straightforward to recompute the treatment table to look up the true intersections in the order of their occurrence.

The coordinates of the intersection point on an edge could be obtained from a function computing the linear interpolation of an intensity value between the vertices forming the edge, provided that such a value is avail- able. However, according to our remarks in section 2 we prefer to look up these coordinates, too. Only two in- tersection points per cube edge, one for each of the two possible hot/cold combinations at an edge, are allowed. For the applications we have looked at so far, we found it convenient to let both intersections degenerate to the centre of the intersection. These intersection are labeled from 1 to 24 in Figure 12b. A table named iscoo con- tains the coordinates of all 24 intersections relative to the origin of an elementary cube at vertex 1. Using discrete instead of interpolated coordinates yields savings in run time computations and in memory resources. Discrete triangle coordinates of images of virtually any resolution can be stored by short integer numbers, whereas inter- polated coordinates need to be stored as floating point numbers. On most computers memory requirement is thus reduced by a factor of two. Since the algorithm may create a vast amount of triangles, efficient usage of memory is essential for many applications.

So far this is a tabulated version of the original MC algorithm. Leak detection and mending is implemented in the following manner: a leak may occur on all six faces of a cube. To avoid double treatment of leaks leading to unpaired edges, only three faces are to be considered. If we choose these faces as depicted in Fig- ure 13, the other faces of the actual elementary cube are guaranteed to be considered when the other three next neighbours are examined (at the margin of the vol- ume the enveloping background layer guarantees leak- less surfaces). For each combination comb, if at least one of its ambiguous faces comes to lie on one of the faces of Figure 13a, the entries 14-16 of the treatment table provide the face numbers. A small look-up table neighbours contains the case plane coordinates of each cube sharing an ambiguous face with the actual cube. The coordinates are relative to the actual cube. Now

© The Eurographics Association 1995

Page 10: Fast Generation of Leakproof Surfaces from Well-Defined Objects by a Modified Marching Cubes Algorithm

136 S. Röll et al. Leakproof Surfaces

Figure 13: a. Ambiguous faces to look a t ; b. Labelling of ambiguous faces in the elementary case.

treatment [comb] [13] shows whether or not a com- bination is inverted. If an inverted combination meets a non-inverted one, i.e., if treatment [comb] [13] of the actual cube is not equal to treatment [comb2] [13] of the adjacent cube sharing the ambiguous face, leak mending is carried out.

The entries 18-20 of the treatment table contain the face numbers as shown by Figure 13b, to which an ambiguous face of the entries 14-16 respectively corre- sponds in the unrotated elementary case. Hence, with a further look-up table patches, containing the intersec- tions of the triangulated patches to mend the quadri- lateral holes (as cases contains the intersections of the elementary cases), one proceeds with leak mending in a manner analogous to regular triangle construction as described above.

7. Application and Performance of the Tabulated

The implementation of a fast and leakless MC algorithm was motivated by an application of 3D-MR imaging in MR spectroscopy (MRS): von Kienlin and Meija14 elab- orate on how to improve signal to noise ratio of M R spectra by taking into account knowledge of the (arbi- trary) shapes of homogeneous compartments within the

Marching Cubes Algorithm

region of interest and optimizing the parameters of the MRS-examination for these shapes. Hence a 3D-MR imaging experiment precedes the spectroscopic exper- iment. The task of image processing is to solve the segmentation problem.

In our application the target of MRS is the cardiac muscle (myocardium) of the perfused rat heart. Semi- automatic segmentation of the myocardium is achieved by applying a deformable contour model (Kass et al.8). With time being a critical factor, fast assessment of the result of the segmentation process is desirable. To this end surface reconstruction is applied. The surface of the real myocardium is smooth (at the given macroscopic scale). Hence the display of the segmented heart with shading based on the original image data should yield a smooth surface, too. Within regions where the surface appears to be spotted, segmentation can be regarded as poor.

Figure 14 shows surface rendering of the cardiac mus- cle. Since the left cardiac chamber is inflated by a balloon which is invisible to MRI, the cardiac wall separating the left and the right chamber merges with the cardiac muscle. Thus, the shape of the myocardium in this MR image compares to a vase with massive walls. Although surface rendering is not the method of choice for small objects, blood vessels are also depicted to improve 3D perception of the scene. The original MR image con- sists of 1283 nearly cubic voxels. We note first, that despite this modest resolution and despite the fact that we merely used binary information to tile the objects, their shaded surfaces appear smooth even when bent at a small scale.

The vessel surfaces, extracted by intensity value thresholding, consist of 30 000 triangles with 500 holes mended. Segmentation by deformable contours yields a myocard-volume with a regularly shaped surface. There- fore, while 125 000 surface triangles are constructed, only 100 combinations required leak mending. If the myocard surface is extracted computationally less expensively by thresholding, the result still looks acceptable. In this case its surface is more fuzzy: 170000 triangles are con- structed and 1200 holes are mended.

On an Iris Indigo, it took 15.3 seconds to compute and store the coordinates and the normals of all 155 000 triangles of the scene depicted in Figure 14. Table 3 compares run-time requirements of the non-optimized compiled, tabulated MC algorithm to some of the refer- ence values given for the more advanced Splitting Box surface reconstruction algorithm on a SUN SPARC II (Muller and Stark12). Whereas the Splitting Box algo- rithm deals more effectively with memory requirements and probably better with display time by generating bigger surface patches than MC, it obviously requires considerably more run-time calculations.

© The Eurographics Association 1995

Page 11: Fast Generation of Leakproof Surfaces from Well-Defined Objects by a Modified Marching Cubes Algorithm

S. Roll et al. Leakproof Surfaces

a.

137

b.

Figure 14: a. - d. Surface rendering of an MR image of the heart: blood vessels are depicted by blue surfaces, the myocardium is rendered as a reddish surface. The views a. - d. show the myocardium surface at various stages of its construction. Whereas the surface coordinates are computed from the segmented myocard volume, the surface normals needed for shading are obtained from the original image data. Since the surface normals point towards the outside of the myocardium, its interior appears black in the views a. - c.. A view of the complete heart is displayed in d..

© The Eurographics Association 1995

Page 12: Fast Generation of Leakproof Surfaces from Well-Defined Objects by a Modified Marching Cubes Algorithm

138 S. Roll et al. / Leakproof Surfaces

Table 3: Comparison of run-time requirements of the pre- sented tabulated MC algorithm with the Splitting Box (SB) algorithm by Muller and Stark12.

All generated surfaces were tested on unconnected triangle edges. As expected they were all found to satisfy this closeness criterion.

8. Conclusion

The modified Marching Cubes algorithm provides rapid and reliable construction of leakless surfaces. Since leak mending is achieved by only a minor extension of the lo- cal construction operator, the algorithm remains suitable for parallel implementation. We found this algorithm ap- propriate for the purpose of visualisation as well as for surface area computation of medical image data from different modalities such as MR imaging or Computer Tomography.

An ANSI C and a C++ version of the algorithm is available for non-commercial usage on request.

Acknowledgment

We wish to thank Fridtjof Roder for providing the 3D M R image of the heart and Lewis Griffin for many use- ful suggestions. This work was supported by grants Ki 433/1-1 and Ki 433/2-1 of the Deutsche Forschungsge- meinschaft.

References

1. W.E. Lorensen and H.E. Cline, “Marching Cubes: A High Resolution 3D Surface Construction Al- gorithm”, Computer Graphics, 21(4), pp. 163-169 (1987).

K.H. Höhne, M. Bomanns, A. Pommert, M. Riemer, U. Tiede and G. Wiebecke, “Rendering Tomo- graphic Volume Data: Adequacy of Methods for

2.

3.

4.

5.

6.

7.

8.

9.

10

Different Modalities and Organs”, pp. 197-215 in 3- D Imaging in Medicine, K.H. Höhne (ed.), Springer- Verlag, Berlin (1990).

G. Wyvill, C. McPheeters and B. Wyvill, “Data Structure for Soft Objects”, The Visual Computer, 2, pp. 227-234 (1986).

J. Wilhelms and A. v. Gelder, “Topological Con- siderations in Isosurface Generation”, Computer Graphics, 24(5), pp. 79-86 (1990).

G.M. Nielson and B. Hamman, “The Asymptotic Decider: Resolving the Ambiguity in Marching Cubes”, Visualization ’91, IEEE, pp. 83-90, San Diego (1991).

P. Ning and J. Bloomenthal, “An Evaluation of Implicit Surface Tilers”, IEEE Computer Graphics & Applications, 13(6), pp. 33-41 (1993).

S.A. Roll, A.C.F. Colchester, P.E. Summers and L.D. Griffin, “Intensity-Based Object Extraction from 3D Medical Images Including a Correction for Partial Volume Errors”, British Machine Vision Conference, E. Hancock (ed.), pp. 205-214, York (1994).

M. Kass, A. Witkin and D. Terzopoulos, “Snakes: Active contour models”, Int. Journal of Comp. Vi- sion, pp. 321-331 (1988).

C. Barillot, B. Gibaud, J. Scarabin and J. Coa- trieux, “3D-Reconstruction of Cerebral Blood Ves- sels”, IEEE Computer Graphics & Applications, 5(6), pp. 13-19 (1985).

K.H. Höhne and R. Bernstein, “Shading 3D Im- ages from CT using Gray Level Gradients”, IEEE Transactions on Medical Imaging, 1(5), pp. 45-47 (1986).

11. M.J. Dürst, “Additional Reference to Marching Cubes”, Computer Graphics, 22(2), pp. 72-73 (1988).

12. H. Muller and M. Stark, “Adaptive Generation of Surfaces in Volume Data”, The Visual Computer, 9, pp. 182-199 (1993).

13. W. Heiden, T. Götze and J. Brickmann, “MC- Algorthimen zur schnellen Generierung von Isoflachen auf der Basis dreidimensionaler Daten- felder”, pp. 112-117 in Visualisierung von Volumen- daten, M. Frühauf and M. Göbel (eds.), Springer-

14. M.v. Kienlin and R. Meija, Spectral Localization with an Optimal Pointspread Function, J. of Mag- netic Resonance, 94, pp. 268-287 (1991).

’ Verlag, Berlin (1992).

© The Eurographics Association 1995