How to load dense DVFs (from VoxelMorph) to Slicer

Yes, the easiest thing to do would be to examine the results of Elastix and replicate it. Some things will depend on the conventions used by the registration code, such as whether the vectors in the array indicate where the moving voxels go (modeling transform) or where the fixed voxels come from (resampling transform). They are effectively inverses of each other, but the transform is not always well defined. See this post and search for similar for more info. For a modeling transform you would get the geometry from the moving volume, and for a resampling transform it would come from the fixed volume.

Effectively you just need to create the transform node and grid transform and then use slicer.util.arrayFromGridTransform(gridTransform) to get a numpy array. Unlike the dicom example, you should be able to just do a single assignment like gridArray[:] = voxelmorphArray although there may be some shuffling required if the data layout is not the same (unlikely).

The dicom example is a case where the transform has different dimensions than the volume, but if yours is a dense vector field you can just copy geometry from the input volumes. In the end what matters is that the transformation is well defined at every point in space.