[Thresholding] don't manipulate layers (fixes #883)