Coordinate transformations?

Hello, I am attempting to fully automate the vmtkcenterline function by specifying seed points like this: vmtkcenterlines -seedselector pointlist -sourcepoints 0 0 0 -targetpoints 1 1 1 2 2 2. To find the source and target points I have a function that utilizes gradient data and the mask as nifti files, it then finds the end points. I have checked its functionality by looking at the output points on the mask file using itk snap. Unfortunately, I have found that after segmentation and level sets, and smoothing my .vtp file has a different coordinate system. For reference the endpoints from the .nii file are: (131.15801614763552, 80.82237600922723, 17)
(47.65384615384615, 137.34615384615384, 644)
(97.26470588235294, 75.5672268907563, 678)
and the .vtp file are (roughly):
(159, 55, -113)
(129, 75, 105)
(147, 54, 117)
How are the coordinates transformed using the vmtk pipeline? Any info on how to convert my scripts .nii endpoints to the .vtp endpoints would be greatly appreciated

Thanks

You can have a look how it got fully automated in 3D Slicer’s Extract Centerline module. See source code here.