Extracting Original Voxel Space Transformation Matrix from Model Output
Hi,
Thank you for publishing this wonderful work.
I am having difficulties extracting the original voxel space transformation matrix from the model. I need this matrix to warp volume-associated surface data using FreeSurfer.
From my understanding, the model expects inputs approximately in RAS space, handled by torchio.toCanonical, and then aligns keypoints in normalized space. This suggests the final output matrix is in normalized space, not the original voxel space.
Could you please guide me on how to obtain the 4x4 affine and rigid matrices in the original voxel space of my inputs?
Thank you very much for your help.
The easiest solution is probably to rescale the keypoints up to the voxel space. I.e. rescale [-1, 1] -> [0, 255], or whatever your voxel dimensions are. Then, align the keypoints with your desired keypoint aligner and extract the transformation matrix.
If you get a solution and can create a pull request, I would really appreciate it!