I port [Immunoratio plugin](http://jvsmicroscope.uta.fi/immunoratio/) from [ImageJ/Fiji](http://fiji.sc/) to python and need some equivalent functions e.g. for thresholding.

It is not clear how to treat value, returning by all this threshold functions:

    background <= threshold < foreground
    background < threshold <= foreground
    background >= threshold > foreground
    background > threshold >= foreground

So I decided make full explanation and reference to ImageJ and original papers.