The non-linear transformations are defined as T(x) = x + d(x) where d(x) is a displacement field. 

That's true, I just took the "safe" choice during development in case at some point I put a "break" when filling the arrays, but now I can check where the np.zeros() are actually needed