RegionResampler

Synopsis

The RegionResampler macro creates a uniform scalar field that is the same size as the input active area and sets all nodes that lie on the input polyline.

Input Ports

Name Type Description

in_points float[][2] Coordinates of polyline.
in_dims int[2] Dimensions of the active area.

Output Ports

Name Type Description

out_fld Uniform Scalar Field Output uniform mesh and Node Data component.
out_obj DefaultObject Directly renderable output object.

Description

The RegionReampler macro takes the coordinates of a polyline and the dimensions of an active area and creates a uniform scalar field that covers the active area. The output field contains a node data component. The value for each node that lies on the input polyline is set to 1. All other values are set to 0. Essentially this macro converts the vector information contained in the polyline data into bitmap information. The generated uniform field can be used for various purposes. For instance it could be used as an overlay onto the original image segmentation.

Inputs

in_points : float[][2]

Coordinates of polyline along which pixels will be set.

in_dims : int[2]

Dimension of the active area. These dimensions are used to create the output uniform field.

Outputs

out_fld : Uniform Scalar Field

This field output represents the generated image data. It contains a uniform mesh with the same dimensions as the input dimensions and a single scalar node data component. The node data is set or unset depending upon whether it lies on the polyline.

out_obj : DefaultObject

This port is suitable for direct connection to a 2D viewer. It contains the new uniform scalar field.

Example

The RegionResamplerEg example application illustrates now the RegionResampler macro can be used. A image is read and the SuperDraw macro can be used to draw a polyline in window containing the image. The RegionResampler macro is then be used to convert the vector polyline into bitmapped data. This uniform data is shown in the second window.

Files

iac_proj/draw/drawmods.v Creates the DrawMods library containing the low-level modules RegionResamplerCore, LineResamplerCore, SuperDrawCore and the parameter blocks DrawLineParams and LineResamplerParams.

iac_proj/draw/drawmacs.v Creates the DrawMacs library containing the user interface macros SuperDrawUI and LineResamplerUI, the functional macros SuperDrawFunc and LineResampleFunc, and the user macros SuperDraw, LineResampler and RegionResampler.

iac_proj/draw/drawapps.v Creates the DrawApps library containing the example applications SuperDrawEg, LineResamplerEg, and RegionResamplerEg.

Other Notes

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

Author

Mario Valle,
AVS Inc.

Modifications

Anja Bindrich, 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