threshold


Synopsis

remove data below and/or above min/max threshold level by setting to NULL

Input Ports

in_field

Node_Data

ui_parent

user interface parent object

 

Parameters

check component

UIradioBoxLabel

select component to test

threshold component

UIradioBoxLabel

select component to threshold

Above max_ value

UItoggle

set all above max value to null value

Below min_ value

UItoggle

set all below min value to null value

min check value

UIslider

lower threshold level

max check value

UIslider

upper threshold level

null thresh value

UIslider

value of NULL data

 

Output Ports

out_fld

Node_Data

out_obj

output renderable object

 

Description

threshold transforms the values of the selected field component, effectively "removing" them from the field. You can use threshold in two ways.

It can look at the values in just one component and set them to null_value if they exceed max check value or min check value (threshold component = check component). This is its most common use.

It can look at the values in one scalar component (check component) to see if they exceed max check value or min check value. If they do exceed the threshold bounds, it sets the corresponding array index value in a second, different component (threshold component) to null_value (threshold component not equal check component).

This second behavior is useful if you use one component to flag the visibility of a node (for example, 0 = invisible, 1 = visible) in another component.

threshold's procedure is:

The threshold component's Data_Array null_flag is set to 1 ("has null data") and its null_value is set to threshold's null thresh value.

If Above max_value is on, for each node threshold checks the scalar component referenced by check component against max check value. If it is greater than max check value, it sets the corresponding node in threshold component to null thresh value.

If threshold component and check component point to the same component, the effect is simpler. Any value above max check value in that component is set to null thresh value.

If Below min_value is on, for each node threshold checks the scalar component referenced by check component against min check value. If it is less than min check value, it sets the corresponding node in threshold component to null thresh value.

If threshold component and check component point to the same component, the effect is simpler. Any value below min check value in that component is set to null thresh value.

Otherwise, the values remain unchanged.

Note the difference between threshold and the clamp macro:

threshold sets values outside the range to a specified null value.

clamp sets values outside the range to min value and/or max value.

Input Ports

in_field

The input field need only contain Node_Data of any type. If a mesh is present, it is passed through unchanged to the output field as a reference.

ui_parent

A port to connect to a user interface object that contains the macro's widgets. By default, it is connected to the default user interface object in the application in which the macro is instanced. (This default connection is not drawn.)

Parameters

check component

UIradioBoxLabel. Radio buttons that pick which of the input's components to apply the Above max_value, Below min_value, min check value, max check value tests. In almost all cases, you want check component = threshold component.

If check component is not the same as threshold component, nothing changes in this component in the output. Rather, the out-of-bounds values are set to null in threshold component.

The selected component should be scalar. If it is vector, only the first subcomponent is tested.

The default is the first (0th) component.

threshold component

UIradioBoxLabel. Radio buttons to pick which of the input's components to threshold. The selected component can be scalar or vector. The default is the first (0th) component. If node data labels are present, they are displayed.

Above max_value

UItoggle that, when on, thresholds data above the max value. The default is off.

Below min_value

UItoggle that, when on, thresholds data below the min value. The default is on.

min check value
max check value

UIsliders. Double precision floating point sliders that set the minimum and maximum values. The default is set to the input field component's node data minimum and maximum. The range shown is from the component's node data minimum to its maximum. The double precision value is converted to the data type of the input field before use. Two decimal points of precision are given.

null thresh value

UIslider. A float slider. Establishes what the null_value is. The default is 0.0. The range is the minimum and maximum data values of the selected component. The value specified converts to the data type of the field before use.

Output Ports

out_fld

The output field contains only the selected, threshold component Node_Data component. If a mesh was present, the output field contains a reference to that mesh.

out_obj

If a mesh was present, this is a renderable version of the output field. Otherwise, rendering objects generate an error.

Example

Libraries.Examples.Visualization.Threshold
examples/thresh.v

File

v/modules.v

See also

Related modules