Applying transform node to volume node hierarchy


I’m trying to change the transform hierarchy of my scene.
When I load my MHA file as a Sequence Meta File it gives me a volume node and a transform node:
I would like to apply the transform node to my volume node:

Here is my code, could someone please tell me what’s wrong with it or what’s missing ? I can load the file but adding the transform to the volume is not working.
Thank you very much!

GetNthDataNode gives you a reference to the data node in the internal scene. Instead, you need to get the proxy transform node and volume node by calling GetProxyNode.