remove data below and/or above min/max threshold level by setting to NULL
group DVthreshold {
Node_Data+Iparam &in { /* input field */
nnodes+req;
};
int+Iparam check_vector;
int+Iparam check_comp;
int+Iparam thresh_vector;
int+Iparam below; /* toggle to turn on lower thresholding */
int+Iparam above; /* toggle to turn on upper thresholding */
float+Iparam min_value; /* lower threshold value */
float+Iparam max_value; /* upper threshold value */
float+Iparam null_value; /* value to set when data is out of range */
Node_Data+Oparam out; /* output field */
method+notify_val+notify_inst upd_threshold = "threshold";
} ;
DVthreshold "removes" all values in a field above a max_value, and/or below a min_value by setting them to NULL.
DVthreshold can be used in two ways.
1. 1. It can look at the values in just one component and set them to null_value if they exceed max_value or min_value (thresh_vector = check vector). This is its most common use. Or,
It can look at the values in one scalar subcomponent to see if they exceed max_value or min_value. If they do exceed the threshold bounds, it then sets the corresponding array index value in a second, different component to null_value (thresh_vector not equal check_vector).
This second behavior is useful, for example, if you use one component to flag the visibility of a node (for example, 0 = invisible, 1 = visible) in another component.
The thresh_vector component's Data_Array null_flag is set to 1 ("has null data") and its null_value is set to DVthreshold's null_value input.
If above does not equal 0, then for each node DVthreshold checks the scalar subcomponent referenced by check_vector (which component) and check_comp (which subcomponent of that component) against max_value. If it is greater than max_value, it sets the corresponding node in thresh_vector to null_value.
If thresh_vector and check_vector point to the same component, the effect is simpler. Any value above max_value in that component is set to null_value.
If below does not equal 0, then for each node DVthreshold checks the scalar subcomponent referenced by check_vector (which component) and check_comp (which subcomponent of that component) against min_value. If it is less than min_value, it sets the corresponding node in thresh_vector to null_value.
If thresh_vector and check_vector point to the same component, the effect is simpler. Any value below min_value in that component is set to null_value.
Otherwise, the values are not changed.
The input is a reference to a field with Node_Data of any type.
An integer. Sets which component will be compared against min_value and max_value.
An integer. Sets which subcomponent of check_vector will be compared against min_value and max_value.
An integer. Sets which component of the input field to threshold. The selected component can be scalar or vector.
An integer. When not 0, thresholds data above the max_value.
An integer. When not 0, thresholds data below the min_value.
Floats. Set the min and max values. The float value is converted to the data type of the input field before use.
A float. Establishes what the null_value is. The value specified is converted to the data type of the field before use.
The output is a new object that contains only the thresh_vector, thresholded Node_Data component.
Libraries.Main.Filters.threshold