setThresholdsByRegion function