Update masks.py

Unsure wether x,y order is right for 2D images (unimportant if feature size x = feature size y)