collapse_field & collapse_field_planes

Synopsis

Collapses a uniform field along a specified axis. Specific planes can be included or excluded from collapsing operation.

Input Ports

Name Type Description

in uniform field data to be collapsed
planes int[] planes to include or exclude

Parameters

Name Type Description UI Control

operation enum type of collapsing operation Radiobox
axis int axis to collapse along Slider
planes int[] planes to include or exclude Slider

Output Ports

Name Type Description

out_field uniform vector field collapsed output field
out_obj GDobject directly renderable output object

Description

The collapse_field and collapse_field_planes macros allow a uniform field to be collapsed along an axis hence generating a new lower dimension field. Parameters are available so that the type of collapsing operation and the planes to include or exclude can be specified. Currently 4 collapsing operations are supported:

  1. Collapse All
    Sum all planes along axis. Ignore any specification of planes.
  2. Slice
    Othroslices along the axis at the first plane specified in the planes array.
  3. Collapse Except
    Sums all planes except those specified in the planes array.
  4. Collapse Only
    Sums only those planes specified in the planes array.

The two user macros supplied primarily differ in the number of planes you are able to specify. collapse_field_planes takes an array of planes as an input and hence it is possible to specify any number of planes. collapse_field only allows a single plane to be specified. Although this does reduce the usefulness of the macro it does allow the plane to be specified through the user interface.

The macros only work with uniform fields. The input field coordinates can have 1, 2 or 3 dimensions. If the input is 3D a 2D output field is produced. If the input is 2D or 1D, a 1D output field is produced. The input field node data can have any vector length. Internally the module converts input data to double type and sums each vector component separately. The output field contains node data of double type.

Inputs

in

Uniform field input containing the data that is to be collapsed. The field should contain a uniform mesh and one component of node data. The uniform mesh should have nspace of 1, 2 or 3. If other node data components are present they will be ignored. The input node data can have any vector length.

planes[]

Integer array containing the planes indices that are to be used in the collapsing operation. Depending upon which operation is chosen these planes will either be included in or excluded from the collapsing summation. Plane indices are numbered from zero.

Parameters

operation

enum operation { choices = {"collapse", "slice", "collapse_except", "collapse_only"}; };

Defines now the input field is collapsed. Currently it is possible to collapse the input field in four different ways:

  1. "collapse"
    Sum all planes along axis. Ignore any specification of planes.
  2. "slice"
    Othroslices along the axis at the first plane specified in the planes array.
  3. "collapse_except"
    Sums all planes except those specified in the planes array.
  4. "collapse_only"
    Sums only those planes specified in the planes array.

These operations are presented in the user interface through a radio box. The collapse_field macro does not present the "collapse_only" option as for a single plane the results are identical to those generated by the "slice" option.

axis

Integer parameter that specifies what axis should be collapsed along. Axes are numbered from zero.

planes[]

Integer array containing the planes indices that are to be used in the collapsing operation. The collapse_field macro connects this parameter to a slider in the user interface. The collapse_field_planes macro connects this parameter to the planes input port.

Outputs

out_field

Output field containing the collapsed data in a uniform vector field. If the input field was 3D this output field will be 2D. If the input field was 2D or 1D this output field will be 1D. The output field will contain the summed node data of the input field. This node data will be of type double and have the same vector length as the input data.

out_obj

The GDobject version of the output, suitable for direct connection to a viewer.

Utility Macros

The CollapseFieldFunc functional macro makes use of the low-level module CollapseFieldCore. Both of the user macros, collapse_field and collapse_field_planes, make use of this functional macro. They also make use of the user interface macros, CollapseUI and CollapsePlanesUI. The CollapseParams parameter block is used by all of these modules to connect themselves together.

Example

Two example applications are provided. Both of these applications read in a uniform 3D field and collapse that field into a 2D slice. The CollapseFieldEg application demonstrates how the collapse_field macro can be used to select a single plane. The CollapseFieldPlanesEg application demonstrates how the collapse_field_planes macro can be used to exclude or include 10 planes in the middle of the field.

Files

iac_proj/collapse/clp_mods.v contains the V definitions of the CollapseFieldCore low-level module and the CollapseParams parameter block.

iac_proj/collapse/clp_macs.v contains the V definitions of the User Interface macros CollapseUI and CollapsePlanesUI, the functional macro CollapseFieldFunc, the user macros collapse_field and collapse_field_planes and the example applications CollapseFieldPlanesEg.

Other Notes

The low-level CollapseMods library containing the module does not specify a process. By default the express process will be used.

Author

Mario Valle
Advanced Visual Systems, Inc.

Modifications

Andrew Dodd
International AVS Centre

Contact

International AVS Centre
Manchester Visualization Centre
Manchester Computing
University of Manchester
Oxford Road
Manchester
United Kingdom
M13 9PL

See Also

IAC module Xray.