Python and Matlab version of MaskGeneration for 3D lbp.