Input slice.
Threshold value - any value lower than this will be set to 0, and higher to 1.
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.
Convenience function for thresholding, where lower and upper bound values are the same.
Calls threshold(slice, thresh, thresh, prealloc)