I wish to transform coordinates (z,y,x) in one volume with two consecutive affine matrice. I also have a volume transformed with the same two affine matrices. However, I realized the transformed points do not appear in the position I expected. I wonder what is wrong with my code.
I wish to transform coordinates (z,y,x) in one volume with two consecutive affine matrice. I also have a volume transformed with the same two affine matrices. However, I realized the transformed points do not appear in the position I expected. I wonder what is wrong with my code.
Here is the code for computing the affine matrix.
Here is the code for tranforming the volume.
Here is the code for transforming the coordinates:
Here is the results. The expected points should appear in the following location:
Yet it now appears like this: