I have the same problem, the parameter “mask” in “meanstddev” does not seem to work. How did you solve this problem? Thanks for your answer!!!