contour


Synopsis

create an isovolume bounded by two isosurfaces (3D) or isolines (2D)

Input Ports

in_field

Mesh + Node_Data

ui_parent

user interface parent object

 

Parameters

contour component

UIradioBoxLabel

component to contour

map components

UIoptionBoxLabel

components to output

min level

UIslider

 

max level

UIslider

 

 

Output Ports

out_fld

Mesh + Node_Data

out_obj

output renderable object

 

Description

contour creates a field that is the volume bounded by two isosurfaces (if the field is 3D) or two isolines (if the field is 2D).

For example, you could set the min level and max level isosurfaces to densities found just outside a bone. When combined, the isovolume produced would be the bone itself.

The isosurfaces or isolines are colored by the first map component selected. All of the selected map components are in the Node_Data of the output field.

Note: The contour module does not generate vertex normals by default.

Input Ports

in_field

The input is any mesh with Node_Data. A 2D mesh will produce isolines. A 3D mesh produces isosurfaces. At least one of the components must be scalar.

ui_parent

A port to connect to a user interface object that contains the macro's widgets. By default, it is connected to the default user interface object in the application in which the macro is instanced. (This default connection is not drawn.)

arameters

contour component

UIradioBoxLabel to pick which component to isosurface/isoline. The selected component must be scalar or the message "iso: first component is not scalar" is written to stderr. The default is the first (0th) component. If node data labels are present, they are displayed.

map component

UIoptionBoxLabel to pick components that will be written to the output field. In addition, the first selected component will be mapped onto the isosurface/isoline (for example, map pressure value onto a density isosurface). The selection does not have to be scalar. The default is the first (0th) component. If node data labels are present, they are displayed. Where the isosurface/isoline does not exactly intersect a node, the data value is linearly interpolated based on the surface's distance from the adjacent nodes.

min level
max level

UIslider. Float sliders that set the minimum and maximum isosurface/isoline values, between which data is extracted. The default is 0.0. The range is from the minimum data value in the selected contour component to the maximum data value in the selected contour component. The data type of the slider is converted to the data type of the node data before use.

Output Ports

out_fld

The output field is an unstructured Mesh of cell type Tri (3D) or Line (2D) that represents the contour volume. Its Node_Data is the values within the volume. The surface values are interpolated along the isosurface/lines.

out_obj

This is a renderable version of the output field.

Algorithm

contour uses the Marching Cubes algorithm to construct the isosurfaces/isolines. See W. Lorensen and H. Cline, "Marching Cubes: A High Resolution Surface Reconstruction Algorithm." Computer Graphics 21(4) (SIGGRAPH Proceedings, 1987), July, 1987, pp. 163-169.

This algorithm has a known limitation. There are cases where there are two possible paths that the isosurface could take through a cell, and only one is the correct path. If isosurface picks the wrong path, a discontinuity appears as a hole in the surface.

Example

Libraries.Examples.Vizualization.Contour
examples/cont.v
Libraries.Examples.Vizualization.Contour_2D_Unif
examples/cont2uni.v
Libraries.Examples.Vizualization.Cylinder
examples/cyl.v

File

v/modules.v

See also