我正在从文件中读取 ITK 转换。我无法弄清楚直接从转换中获取翻译或矩阵的 API。
t = sitk.ReadTransform('sample_transform.h5')
print(t)
这是打印的结果:
itk::simple::Transform
VersorRigid3DTransform (0x55c3e22f5de0)
RTTI typeinfo: itk::VersorRigid3DTransform<double>
Reference Count: 1
Modified Time: 802
Debug: Off
Object Name:
Observers:
none
Matrix:
0.999862 0.016289 0.00333268
-0.0161218 0.998848 -0.0451944
-0.00406501 0.0451344 0.998973
Offset: [-1.3857, 0.238944, 0.984074]
Center: [36.1356, 6.81771, -27.0756]
Translation: [-1.36988, 0.872183, 1.17271]
Inverse:
0.999862 -0.0161218 -0.00406501
0.016289 0.998848 0.0451344
0.00333268 -0.0451944 0.998973
Singular: 0
Versor: [ 0.0225887, 0.00184996, -0.00810505, 0.99971 ]
是否有直接获取矩阵和翻译的功能?
看起来可以从 t.GetParameters() 的最后三个项目中检索翻译:
print(t.GetParameters())
会给:
(0.02258874140769294,
0.0018499585651891462,
-0.00810504740162434,
-1.3698806341361933,
0.8721829896773953,
1.1727120470384382)