Added threshold to mask.