Applying Transform Matrix in python

Hello,

I have been trying to apply the transform matrix from Slicer in python, however I have had several issues the registrations as it seems like the two scans dont line up. I was wondering if anyone has tried this before and been successful.

Thanks!