Input slice.
Lower threshold value.
Higher threshold value.
Optional pre-allocated slice buffer for output.
Note: Input and pre-allocated buffer slice, should be of same structure (i.e. have same strides). If prealloc buffer is not given, and is allocated anew, input slice memory must be contiguous.
Clip slice values by a given threshold value.
If any slice element has value in range between lower and upper threshold value, its output value is set to upper clipping value, otherwise to 0. If output value type is a floating point, upper clipping value is 1.0, otherwise its the maximal value for that type (e.g. for ubyte its 255, for float and double its 1.0).
If lower threshold bound is of the same value as higher, then values are clipped from given value to 0.
Thresholding is supported for 1D, 2D and 3D slices.