Add masking in cython interface