![]() |
![]() |
![]() |
![]() |
DVthreshold
Synopsis
remove data below and/or above min/max threshold level by setting to NULL
module DVthreshold { /* sets NULL data for all values below
and/or above min/max threshold level(s) */
Node_Data+Iparam &in { /* input field */
nnodes+req;
};
int+Iparam check_vector; /* which component
will be compared against min_value and max_value */
int+Iparam check_comp; /* which subcomponent
of check_vector will be compared */
int+Iparam thresh_vector; /* which component
of the input field to threshold */
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 */
/* Output always has a single node data component */
Node_Data+Oparam out; /* output field */
method+notify_val+notify_inst upd_threshold<status=1>
= "DVthreshold_update";
};Description
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. DVthreshold's procedure is: 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.
Input
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.
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.
Output
Example
Libraries.Main.Filters.threshold
File
modules/thresh.cUtility DVM macrosDVMthresh_param, Threshold
See also
![]() |
![]() |
![]() |
![]() |