How to use Transforms module in Python


I was trying to deform a image and I have my image and deformation vector field in mhd files. I am wondering if there is anyway I could use python to do exactly like the Slicer does in its GUI.

It would be great appreciate if there is any sample code I could learn from.

Here is what GPT-4 with the VoxScript plugin enabled suggests:

The script repository is also a good place to start searching for Transform code.