def sample_point(img, point, order=1):
scale = np.mat(img.get_affine()[0:3, 0:3]).I
offset = np.dot(-scale, img.get_affine()[0:3, 3]).T
s_point = np.dot(scale, point).T + offset[:]
return ndinterp.map_coordinates(img.get_data().squeeze(), s_point, order=order)
评论列表
文章目录