Before revision:  Adopting a reasonable approximation to the exact quaternion-data minimization problem, we find a novel closed form "quaternion RMSD" (QRMSD) solution for the optimal rotation from a quaternion data set to a reference set. We observe that composites of the RMSD and QRMSD measures, combined with problem-dependent parameters including scaling factors to make their incommensurate dimensions compatible, could be suitable for certain matching tasks .
After revision:  Adopting a reasonable approximation to the exact quaternion-data minimization problem, we find a novel closed form "quaternion RMSD" (QRMSD) solution for the optimal rotation from a tutorial on quaternion frames, a related quaternion technique for extracting quaternions from rotation matrices, and a review of quaternion rotation-averaging methods relevant to the orientation-frame alignment problem. Supplementary Material covers extensions of quaternion methods to the 4D problem .