Added pixel by pixel thresholds in extract