'Find translation, rotation, scaling based on the three fiducials.'

def fit_scale_fiducials(self):

    src_fid = np.vstack((self.hsp.lpa, self.hsp.nasion, self.hsp.rpa))
    src_fid -= self.hsp.nasion
    tgt_fid = np.vstack((self.mri.lpa, self.mri.nasion, self.mri.rpa))
    tgt_fid -= self.mri.nasion
    x0 = (self.rot_x, self.rot_y, self.rot_z, self.trans_x, self.trans_y, self.trans_z, (1.0 / self.scale_x))
    est = fit_matched_points(src_fid, tgt_fid, rotate=True, translate=True, scale=1, x0=x0, out='params')
    self.scale_x = (1.0 / est[6])
    (self.rot_x, self.rot_y, self.rot_z) = est[:3]
    (self.trans_x, self.trans_y, self.trans_z) = est[3:6]
