def lanczos(coords, shape, window=3, **kwargs):
    def lanczos(x):
        out = np.zeros_like(x)
        sel = np.abs(x)<window
        selx = x[sel]
        out[sel] = np.sin(np.pi * selx) * np.sin(np.pi * selx / window) * (window / (np.pi**2 * selx**2))
        return out

    return distance_func(lanczos, coords, shape, **kwargs)
dataset/ETHPy150Open gallantlab/pycortex/cortex/mapper/samplers.py/lanczos/original