def applyMeanThreshold(mat, sigma=0):
	"""
		Apply mean threhsold to the matrix. Optionally, one can move the threshold up or down @sigma standard deviations. The threshold excludes mean.
	"""
	result = mat * (mat > mat.mean() + sigma*mat.std())
	return result