ENH: Add python code for ThresholdAnImage

Change-Id: I2500e5eb013da45655a070e982e967a8cea16c36
Merge "ENH: Add python code for ThresholdAnImage"