Threshold Filter

Performs a thresholding operation and outputs a mask.

Category

category_mask_selection Mask and Selection

Node

threshold_node

Parameters

Type: what type of thresholding to perform (see below)

Value: the value to threshold against (if a single value threshold is to be used)

First Value: the lower boundary of a range (if a range-based threshold is to be used)

Last Value: the upper boundary of a range (if a range-based threshold is to be used)

Output Type: what to output (Grayscale for a black/white image, Mask for a mask, Class for a a classification result)

Desired Class: the group to use if the threshold applies (only if Output Type is Class)

Rejected Class: the group to use if the threshold does not apply (only if Output Type is Class)

Inputs

Input: the input data

Outputs

Mask/Class/Grayscale: the thresholding result

Effect of the Filter

The filter will apply a given threshold (based on the chosen type) to each channel of the data. The following threshold types are available:

  • Lesser: the threshold applies if a value is smaller than the Value parameter

  • Greater: the threshold applies if a value is larger than the Value parameter

  • Inside: the threshold applies if a value is larger than the First Value parameter and smaller than the Last Value parameter (if the value is equal to one of the boundaries the threshold does not apply)

  • Outside: the threshold applies if a value is smaller than the First Value parameter or it is larger than the Last Value parameter (if the value is equal to one of the boundaries the threshold does not apply)

The Output Type will select what kind of output will be used. For the output types Mask and Class the input data may only have a single channel. For the output type Grayscale the input data may have any number of channels.

For Mask output each pixel will be set to foreground (0) if the threshold applies to pixel’s value, and to background (-1) otherwise.

For Class output each pixel will be set to the Desired Class if the threshold applies to the pixel’s value, and to Rejected Class if it doesn’t.

Grayscale output will be of floating point type, and may have multiple channels. Each channel and pixel will be thresholded independently. If the threshold applies to an individual value, the corresponding output value will be set to 1, otherwise it will be set to 0.

It is useful to combine this filter in conjunction with the Instrument Function Filter in global average mode in order to perform a threshold on the average value of each given pixel and generate a mask from that. That mask may then be used as the input to a Mask-based object Detector Filter or a Mask-based Selection Filter.