I work in the medical field. Sometime we receives MR images that have been acquired along the same direction, however when looking up the direction cosine matrix, the values are slightly different (up to a certain precision). The scanner only stores the first 6 values of the matrix, the last 3 values are computed using a cross product from the first 2 vectors. Those two direction cosines define the first row and the first column with respect to the patient.
What is the correct metric space (equivalent to euclidean distance?) to compare two different direction cosine matrix ?
import numpy as np a1,b1=np.array([0.997704,0.0677201,6.10347E-5]),np.array([-0.0673549,0.992439,-0.102604]) a2,b2=np.array([0.997704,0.0677201,6.10347E-5]),np.array([-0.067355,0.992439,-0.102604]) a3,b3=np.array([0.997704,0.0677202,6.10347E-5]),np.array([-0.0673549,0.992439,-0.102604])
With a lot of hand waving, comparing the dot product of the normal give a sense of how close direction cosine matrix are:
>>> c1 = np.cross(a1,b1) >>> c2 = np.cross(a2,b2) >>> c3 = np.cross(a3,b3) >>> np.dot(c1,c2) 0.9999987261098883 >>> np.dot(c2,c3) 0.9999987328817403