Hello, I have a nonlinear transform which was generated by the CurvedPlanarReformat module. I would like to programmatically find the corresponding point in the original volume space to a point identified in the straightened volume. I can do this in the GUI by creating a fiducial point in the straightened volume and then applying the inverse of the straightening transform to that fiducial node. I want to do the same thing in python. I expected this to just be something like the following:
queryPoint = [5,10,15] # the RAS point coordinate in the straightened volume resultPoint = *3 # preallocate to hold the RAS point in the original volume straighteningTransformNode.TransformPointToWorld(queryPoint, resultPoint)
But when I run this, I always get that resultPoint is equal to queryPoint, even though the straightening transform is definitely not an identity matrix. I haven’t been able to find clear documentation with an example of applying a nonlinear transform to a point (rather than to a node).
It occurs to me as I write this that perhaps the TransformPointToWorld() function is for handling any effects of parent transforms to the given transform, rather than for applying the transform to a point. Since my transform had no parent transform, world coordinate points do not need to be converted to be in the transform’s base coordinate space. So, that would explain why TransformPointToWorld() doesn’t do what I want, but I still don’t see how to actually apply the transform to a point. I’d appreciate any help. Thanks!