code: def save_qa_metric(fname, xopt, fopt):
      """Save Quality Assurance metrics.
  
      Parameters
      ----------
      fname: string
          File name to save the metric values.
      xopt: numpy array
          The metric containing the
          optimal parameters for
          image registration.
      fopt: int
          The distance between the registered images.
  
      """
      np.savetxt(fname, xopt, header="Optimal Parameter metric")
      with open(fname, "a") as f:
          f.write("# Distance after registration\n")
          f.write(str(fopt))
  
imports: from packaging.version import Version
  import nibabel
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: save_qa_metric(fname, xopt, fopt) without return types