I have been using the invert button in the Transforms module to invert displacement fields which I can regrettably only derive as a forward transform. Now I am trying to replicate this inversion using ITK or SimpleITK functions, such as InverseDisplacementField, InvertDisplacementField, FixedPointInverseDisplacementField and IterativeInverseDisplacementField. However, I am never able to replicate the results I get through Slicer. If someone could explain which algorithm Slicer uses I would be most grateful.
Thank you for your quick and comprehensive answer. I had been looking into the VTK classes but had some trouble loading the .nrrd files which my code outputs. I will look into this again and report back with the results.
Slicer can load a vector field into a transform node (and inside it as a VTK grid transform) from .nrrd file: in the “Add data…” dialog, choose to load it as a “Transform” (in “Description” column).