theshold
Synopsis
remove data below and/or above min/max threshold level by setting to NULL
Input Port
Parameters
Output Port
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.
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
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.
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
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.
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.
min check value
max check valueUIsliders. 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.
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 Port
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.
If a mesh was present, this is a renderable version of the output field. Otherwise, rendering objects generate an error.
Example
File
See also related modules