I have the mm coordinates of an ROI in scanner space, and I would like to convert them to mm coordinates in the scanner space of a T1 from the same subject but collected on a different day.

Here’s the process I’ve tried that I think should work, but doesn’t

Hmm, not sure exactly what is going wrong, but I have some followup questions:

Have you tried this code from the apply_affine documentation page? This is a simple implementation of the function that works in a 3d case, which seems to be appropriate baed on the shape of your pt vector.

res = np.dot(aff[:3,:3], pts.T) + aff[:3,3:4] transformed_pts = res.T
(this aff = your xfm)

Do you get different results doing it like this?

Can you print what your xfm matrix is?

Could you get/create .nii files for your ROIs, in which case you can use flirt to apply the reg.mat transformation?