DVcut


Synopsis

create a volume of all cells whose node data is above or below a level value


group DVcut {
Mesh+Node_Data+Iparam &in { /* input field (to be sliced) */
xform+nonotify;
nnodes+req;
};
int+Iparam cut_comp;
int+Iparam map_comp[];
float+Iparam level;
int+Iparam above; /* toggle for specifying which side
of the plane will be removed-- */
Mesh+Node_Data+Oparam out { /* output field */
&xform<weight=-1> => in.xform;
};
method+notify_val+notify_inst upd_cut = "cut";
};

Description

DVcut creates a volume of cells whose node data is above or below a specified level value. It is similar to DVthreshold, except that DVthreshold can only compare the data exactly at nodes, while DVcut creates an isovolume whose surface may be located between nodes. The surface may be between nodes because it is interpolated. For example, if the user specified a level value of 1.5, and one node has a value of 1.0, the adjacent node's value is 2.0, the isovolume's surface will bisect the space between the nodes.

Moreover, DVthreshold edits nodes out by setting them to NULL, while DVcut physically removes the cells from the output Node_Data and Mesh.

For example, you have a 3D uniform field that is a series of MRI scans of a cranium. You give it a level value that equals bone density. DVcut creates an unstructured mesh of all the node datas equal to bone density; effectively a mesh of the skull. If you make above = 0 (turn it off), DV cut outputs an unstructured mesh of all tissue whose node data is less than that of bone.

DVcut uses one scalar component to construct the isovolume, but outputs any combination of components from the input field. So, you may use, say, pressure to create the isovolume, but output pressure, temperature, and density.

Input

&in

The input is a reference to a field with any type of Mesh and Node_Data. Multiple cell sets are allowed.

cut_comp

An integer. Sets which component of the input field to use when constructing the isovolume. This component must be scalar.

map_comp[]

An integer array. Each array value is the number (from 0 up) of a component to extract. For example, for an input field with two components:

(a, b, c, [e, f, g]) --> set map_comp = { 0 , 3 } --> (a, [e, f, g]) in the output field.

Note that this array is not explicitly dimensioned. It is a variable-length array that will have as many values as you assign to it with the = { n, n, n,...n} notation. The supplied AVS/Express modules that use DVcut implicitly set the dimension to 1 by specifying map_comp = {0}, i.e., the user can specify any one component to send to the output field, and the default is the first (0th) component.

level

A float. Set the value to use in constructing the isovolume. level is converted to the data type of the Node_Data before use.

above

An integer. When not equal to 0, values above level are in the output field. When equal to 0, values below or equal to level are in the output field.

Output

out

The output is a new field. Its Mesh is unstructured, containing just the nodes above or below level. It may have mixed cell types and hence multiple cell sets. Its Node_Data contains the components specified by map_comp[nmap_comp] that were above or below level. It also contains a reference to the input field's xform.

Algorithm

The algorithm used to perform the interpolation and construct the isovolume is similar to the Marching Cubes algorithm. However, it uses pre-generated lookup tables to determine the intersection of the isosurface with the cells.

Files

v/dv.v
modules/cut.c

Utility DVM macros

DVMcut_param, Cut

Example

Libraries.Main.Mappers.cut
Libraries.Main.Mappers.isovolume

See also