OPT: several minor changes + 1 major change: remove the computation of PD only in a box mask (to reduce computational time) because of potential bugs without warning in function sct_create_mask