Adding doctests of thresholding
Adding 2d tests