allow to keep Mask.Flags and curvep_mask ; mask is the only that used as input