![]() |
![]() ![]() |
One use of the DrawLine2D module is for probing and measuring images. The output of the DrawLine2D module, two XY positions, can be used in a number of different ways:
to measure the distance from the start to end point
to extract the values of the image at the end points of the line
to extract the values of the image of the points that are under the line
Instance ImageMeasure into the empty NE workspace.
This example is found in Libraries.Examples.Graphics_Display. Upon being instanced, the example renders a slice from wind.fld in the viewer's window.
We are now ready to probe values in the slice.
Select Editors->Modules to make the modules user interface panel visible. Select DrawLine2D from the Modules option menu. This causes the user interface for the DrawLine2D module to appear.
Begin probing the view by drawing a line.
The mouse operations that control the line drawing are:
|
|
The DrawLine2D module draws a line from the start position to the end position As long as the right button is held down the a line is drawn from the start position to the current end position. When the right button is released, the line is converted into a field.
The start and end points of the line are then displayed in the user interface for the DrawLine2D module. By default, the module updates the XY position immediately when the right button is released.
The slice of wind.fld has dimensions of 25 by 32. Notice that when the line is inside the extents of the slice, the values displayed in the DrawLine2D user interface for X and Y are in that range.
In the ModuleStack workspace, look at the slice values.
Open the node_data array. It should look like "node_data[1]".
Scroll up to find the node_data array. It should have two arrows on it to indicate that it is an array. Press the right arrow once to access the first (and only) entry of the array.
Open the values array. It should look like "values[2][1]".
Resize DVinterpolate_data so you can easily see both entries in the array.
The entries in the array are in order the scalar value at the start point and the scalar value at the end point. In this case, the scalars are of type float.
Delete the ImageMeasure application.
![]() |
![]() ![]() |