Fixed the use of the modified image, the base image is not to be used
any more.
Added a second value to the thresholding operation. It now works
in the same way than ImageJ threshold.