Added condition to automatic variance parameter setting to make sure the ROI is large enough that the variance compuation actually means something.