threshold

Convenience function for thresholding, where lower and upper bound values are the same.

Calls threshold(slice, thresh, thresh, prealloc)

  1. Slice!(Contiguous, packs, OutputType*) threshold(Slice!(kind, packs, InputType*) input, InputType lowThresh, InputType highThresh, Slice!(Contiguous, packs, OutputType*) prealloc = emptySlice!(packs, OutputType))
  2. Slice!(Contiguous, packs, OutputType*) threshold(Slice!(kind, packs, InputType*) input, InputType thresh, Slice!(Contiguous, packs, OutputType*) prealloc = emptySlice!(packs, OutputType))
    nothrow
    Slice!(Contiguous, packs, OutputType*)
    threshold
    (
    OutputType
    InputType
    SliceKind kind
    size_t[] packs
    )
    (
    Slice!(kind, packs, InputType*) input
    ,
    InputType thresh
    ,
    Slice!(Contiguous, packs, OutputType*) prealloc = emptySlice!(packs, OutputType)
    )

Parameters

input
Type: Slice!(kind, packs, InputType*)

Input slice.

thresh
Type: InputType

Threshold value - any value lower than this will be set to 0, and higher to 1.

prealloc
Type: Slice!(Contiguous, packs, OutputType*)

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.

Meta