IsoObjectLabel

Synopsis

A mapper macro that adds text labels to isolines. It processes the output from the isoline module and generates a DataObject that can be directly displayed.

Input Ports

Name Type Description

in_fld Field input data from isoline module

Parameters

Name Type Description UI Control

Active int Whether module updates. -
ContourFrequency int Number of contours to skip. UIslider
NodeFrequency int Number of nodes to skip. UIslider
LineIndependent int Generating labels not depending on the number of isolines. UItoggle
NumberOfLabels int Number of Labels if LineIndependent is ticked. UIslider
Format string formating specification -
Decimals int number of decimal points. UIslider

Output Ports

Name Type Description

out_fld Field locations and values of labels
out_text string[] text of labels
out_obj DataObject directly renderable output object

Description

The IsoObjectLabel macro generates and displays text annotation labels for isoline visualizations. It connects to the field output of the isoline module and generates Field data and an array of string values. The macro also generates a DataObject which can be viewed directly. In most cases it will only be necessary to use the generated DataObject. However if you wish to use the raw outputs the Field data contains the position and numerical values of the labels while the string array contains the actual label text at each point. The number of labels output and number of decimal points displayed can both be controlled through a user interface. Internally a text_glyph module is used to actually create the viewable DataObject. The text_glyph user interface is presented in the user interface so that the text display can be controlled.

The module combines the IAC projects Isolabel and Isolabel2. Both of these projects have advantages and disadvantages and the functionality of both projects is available in the IsoObjectLabel project. The label placement algorithm in the Isolabel2 project is significantly more advanced than in the Isolabel project. The isoline project outputs the contours it generates as a mesh with a Line cell-set. The IsoObjectLabelCore module uses the algorithm from the Isolabel2 project to reconstruct the generated contours from this Line mesh and to generate at least one isolabel on each contour. This ensures that each contour is labeled and that the isolabel positions are relatively consistent and sensible. As the positions are consistent these isolabels are suitable for animation.

The disadvantage of this approach is that the isoline module does not always output each contour as a continuous series of lines. If the input data is noisy then the isoline module is likely to output each contour as a series of smaller line segments. While using the Isolabel2 algorithm the IsoObjectLabelCore module interprets each of these line segments as a separate contour. As one label is generated per line segment this can lead to large numbers of labels being generated. One solution to this problem is to use the ContourFrequency parameter. This parameter allows the module to skip a certain proportion of line segments, hence reducing the number of labels generated. Moreover the Isolabel2 algorithm only works with Line type data, such as that output by the isoline module.

Alternatively the algorithm from the Isolabel project can be used by the IsoObjectLabelCore module. The original Isolabel project does not reconstruct contour lines and therefore does not suffer from this problem. It also is able to work with input data that has cell-sets other than Line. To use the algorithm from the Isolabel project the parameter LineIndependent must be greater than zero. In this case ContourFrequency parameter and the NodeFrequency parameter have no effect as they are only needed for the Isolabel2 algorithm.

Inputs

in_fld

Field data which should be used by the module to generate the text labels. The Field should consist of a Line Mesh and Node Data. Only the first set of Node data is used and that Node data must be scalar.

Parameters

Active

Integer parameter that specifies whether the module should update. If the parameter is set to zero no updates take place. Conversely if the parameter is not set to zero updates take place as normal.

NodeFrequency

Integer parameter that specifies how frequently labels should be generated. The parameter specifies the stride that should be taken between each node that is labelled. Therefore a NodeFrequency of 1 implies that a label should be generated for every node.

ContourFrequency

Integer parameter that specifies how frequently labels should be generated for a contour. The parameter specifies the stride that should be taken between each contour that is processed. Therefore a ContourFrequency of 1 implies that labels should be generated for every contour.

LineIndependent

Integer parameter that specifies which algorithm is used to generate labels. If the parameter is zero labels are generated for each contour. If it is greater than zero as many labels are generated as determined by the parameter NumberOfLabels and the parameters NodeFrequency and Contout Frequency are not used.

NumberOfLabels

Integer parameter that specifies how how labels should be generated if the parameter LineIndependent is greater than zero.

Format

String parameter that is used to specify the C style formatting specification. This sets how the Node data values should be converted into text. Normally it should not be necessary to alter this parameter and hence there is no user interface.

Decimals

Integer parameter that is used to specify the number of decimal points that each text labels should have. Internally this parameter is used to generate the Format parameter that is actually used in the conversion of numerical values to text strings.

Outputs

out_fld

Field data containing the locations and numerical values of each text label. The field data contains a Point mesh that contains the locations of each label and a single set of node data that contains the node data values at each label position. If the input mesh contains any transformation data this is copied across to the output mesh.

out_text[]

String array containing the actual label text that should be displayed.

out_obj

The directly renderable output of the isolabel macro. This contains a DataObject object that can be rendered by the standard data viewers. The output object contains the generated text labels placed at the appropriate positions. The output object is generated internally by a text_glyph module. If more control of the display is required the other outputs can be used. Alternatively the Functional macro could be used directly.

Utility Macros

The User Macro IsoObjectLabel combines the Functional Macro IsoObjectLabelFunc with the UI Macro IsolabelUI and the standard module text_glyph. The User macro also makes use of the common parameter block IsoObjectLabelParams to tie the Functional Macro and UI macro together.

Example

Three example applications are provided, IsoObjectLabelEg1, IsoObjectLabelEg2 and IsoObjectLabelEg3. These applications generate text labels for 2D and 3D isoline plots. They show how the numbers of generated labels can be controlled for data-sets of various sizes and types.

Files

iac_proj/isobjlbl/islblmac.v Creates the IsoObjectLabelMacs library containing the Functional macro IsoObjectLabelFunc, the UI macro IsoObjectLabelUI and the User macro IsoObjectLabel.

iac_proj/isobjlbl/islblapp.v Creates the IsoObjectLabelApps library containing the example applications IsoObjectLabelEg1, IsoObjectLabelEg2 and IsoObjectLabelEg3.

Other Notes

Please refer to AVS documentation for more information on the isoline and text_glyph modules. This macro does not use the AG kit, and should not be confused with AGContour which also contains isoline labels.

The IsoObjectLabelMacs library inherits its process. As this library contains no procedural code, the process is not important. The modules in the low-level IsoObjectLabelMods library execute under the process specified in that library, not the process defined in the high-level library.

Authors

Dr Federico Gamba
Advanced Visual Systems, Inc.

Andrew Dodd
International AVS Centre

Simone Herrmann
Manchester Visualization Centre

Contact

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

See Also