Data Type: Surface ()

Description:

In data objects of type Surface are used to represent non-manifold triangulated surfaces. Such surfaces are required as an intermediate step in generating a tetrahedral patient model from the results of segmentation of a 3D image stack.

Surfaces mainly consist of a list of triangles as well as a list of 3D coordinates. Each triangle is defined by three indices pointing into the list of coordinates. Moreover, triangles are grouped into so-called patches. Conceptually, a patch describes the boundary between two adjacent regions. These two regions, called inner region and outer region, are represented by indices into the surface's material list. Although required for grid generation, the patch structure of a surface does not necessarily define a valid space partitioning. However, any surface must have at least one patch.

Surfaces may also contain additional data, such as edges, boundary contours, or connectivity information. Because these data can be computed online they are usually not written into a file. If the data are not already present but a certain module requests them, they are recomputed automatically. You may notice a small time delay in this case. Recomputation of the connectivity information can be enforced by the Tcl command recompute.

Surfaces may additionally contain level-of-detail information, which can be generated using the Simplification Editor. If such data is present, the surface receives a port Level of Detail, where the desired level can be set.

You may use the Generate Surface module to extract boundary surfaces from a Label Field describing the results of s segmentation. You can visualize surfaces by attaching a Surface View module to it.

There are two editors that can be applied to modify surfaces: the Surface Simplification Editor and the Surface Editor. Use the former once to reduce the number of triangles contained in the surfaces. The latter allows you to perform an intersection test and to modify the surfaces manually.

Commands:

recompute
Recomputes any additional data such as edges, boundary contours, or connectivity information from scratch. If the surface contained patches consisting of unconnected groups of triangles these patches are automatically subdivided into new patches consisting of connected triangles only.

fixOrientation [patch]
Checks if all triangles of a given patch are oriented in the same way. If this is not the case some triangles will be inverted in order to fix the orientation. If no patch number is specified all patches of the surface will be processed in this way.

invertOrientation
Inverts all triangles of the surface.

makeOnePatch
Puts all triangles of the surface into a single patch.

cleanup
Removes any additional data such as edges, boundary contours, or connectivity information from the surface.

getArea <i>
Compute area of all surface patches incident on material i.

getVolume <i>
Compute volume of material i.

getTriangle <i>
Returns vertex indices of triangle i.

setColor <material> <color>
Defines the color of a material used in module Surface View. The material may be specified by either a material name or by a material index. The color may be specified by either an RGB triple in range 0...1 or by a common X11 color name, e.g., red or blue.

setTransparency <material> <t>
Defines the transparency of a material used in module Surface View when draw style is set to transparent. The material may be specified by either a material name or by a material index. The transparency value t must by a floating point number in range 0...1.

add -point <x> <y> <z>
Adds a new point to the surface. The method returns the index of the new point.

add -triangle <p1> <p2> <p3>
Adds a new triangle to the surface and returns its index. The triangle, will be inserted into the first patch of the surface. If no patch exists already, one will be created.

merge <surface2>
Adds surface2 to the surface. A return value of 1 indicates success.

refine
Refines the surface by subdividing all edges. After this operation the surface will contain four times the number of triangles.

refineSubdivideEdges <maxEdgeLength>
Refines the surface by subdividing the edges until all edges are shorter than maxEdgeLength. This method works iteratively and takes always the largest edge. The new point that is added on the edge will be connected to the triangle vertex opposite the divided edge.

getPatchArea
Returns the surface area of a given patch.

assignInsideMaterial <patchID> <ExteriorMaterialID>
Assigns a new inside material to a patch.

assignOutsideMaterial <patchID> <ExteriorMaterialID>
Assigns a new outside material to a patch.

getNumTriangles <patchID>
Returns the nubmer of triangles from a patch. If patch is not available, command returns the number of triangles from the surface.

getTriIdx <patchID> <triangleID>
Returns an index of triangle from a patch.