Closed angolin22 closed 1 week ago
help(ants.create_ants_transform)
Thanks for your reply! But the result is not right, my code is
matrix = affine_mat[0:3,0:3]
translation = affine_mat[0:3,3:].squeeze()
tx_affine = ants.create_ants_transform("AffineTransform", precision="float", dimension=3, matrix=matrix, translation=translation)
reg_moving = tx_affine.apply_to_image(moving, fixed, 'linear')
In addtion, I don't know these parameters offset , cernter
in this function ants.create_ants_transform()
, can you see what's wrong?
How did you derive the original transform parameters?
I use the point cloud corresponding to CT to generate the transform parameters. I use the fast global registration in the open3d
library. The result of the point cloud is correct, but the CT image is wrong. I guess the order of the transform parameters generated by ants.create_ants_transform
is wrong, so I printed out the transformation parameters and it looks like this, this is not the same order as my original transform parameters.
[ 9.92477000e-01 -8.45505297e-02 8.85471031e-02 8.73986408e-02
9.95757282e-01 -2.87907925e-02 -8.57371464e-02 3.63130979e-02
9.95655835e-01 5.05205956e+01 -5.85686541e+00 -4.96898384e+01]
my original transform parameters
SO May I ask what the parameters of the matrix generated by ants.create_ants_transform
represent?
My guess is that the open3d affine parameters aren't directly portable into the ANTs/ITK transformation framework. I would ask over on the ITK discourse forum if anybody has any experience with what you're wanting to do.
See also #525. It's necessary to set both the matrix and the center of rotation (set via the "fixed parameters")
hello, thanks for your excellent work! I have a problem: I have two 3D CT images, and I know the affine transformation matrix between them. e. g.
[[ 9.92477011e-01 -8.45505280e-02 8.85471061e-02 5.05205949e+01] [ 8.73986445e-02 9.95757283e-01 -2.87907932e-02 -5.85686522e+00] [-8.57371490e-02 3.63130975e-02 9.95655814e-01 -4.96898369e+01] [-0.00000000e+00 -0.00000000e+00 -0.00000000e+00 1.00000000e+00]]
How can I transform CT with antspy? Thanks