the best suggested solution so far was presented here: Is it the right way to create mask for phase unwrapping?