Allow specification of layer used as source in thresholding