class_docstr: Uses SPM (spm_coreg) to calculate the transform mapping
  moving to target. Saves Transform in mat (matlab binary file)
  Also saves inverse transform
  
  Examples
  --------
  
  >>> import nipype.interfaces.spm.utils as spmu
  >>> coreg = spmu.CalcCoregAffine(matlab_cmd='matlab-spm8')
  >>> coreg.inputs.target = 'structural.nii'
  >>> coreg.inputs.moving = 'functional.nii'
  >>> coreg.inputs.mat = 'func_to_struct.mat'
  >>> coreg.run() # doctest: +SKIP
  
  .. note::
  
   * the output file mat is saves as a matlab binary file
   * calculating the transforms does NOT change either input image
     it does not **move** the moving image, only calculates the transform
     that can be used to move it
class_docstr_tok: ["Uses","SPM","(","spm_coreg",")","to","calculate","the","transform","mapping","moving","to","target",".","Saves","Transform","in","mat","(","matlab","binary","file",")","Also","saves","inverse","transform","Examples","--","--","--","--",">",">",">","import","nipype.interfaces.spm.utils","as","spmu",">",">",">","coreg","=","spmu.CalcCoregAffine","(","matlab_cmd='matlab-spm8","'",")",">",">",">","coreg.inputs.target","=","'structural.nii'",">",">",">","coreg.inputs.moving","=","'functional.nii'",">",">",">","coreg.inputs.mat","=","'func_to_struct.mat'",">",">",">","coreg.run","(",")","#","doctest",":","+SKIP","..","note",":",":","*","the","output","file","mat","is","saves","as","a","matlab","binary","file","*","calculating","the","transforms","does","NOT","change","either","input","image","it","does","not","*","*","move","*","*","the","moving","image",",","only","calculates","the","transform","that","can","be","used","to","move","it"]
docstr: makes name for matfile if doesn exist
docstr_tok: ["makes","name","for","matfile","if","doesn","exist"]
code: def _make_mat_file(self):
      """makes name for matfile if doesn exist"""
      pth, mv, _ = split_filename(self.inputs.moving)
      _, tgt, _ = split_filename(self.inputs.target)
      mat = os.path.join(pth, f"{mv}_to_{tgt}.mat")
      return mat
  
imports: import os
  import numpy
  from ...utils.filemanip import split_filename, fname_presuffix, ensure_list, simplify_list
  from ..base import TraitedSpec, isdefined, File, traits, OutputMultiPath, InputMultiPath
  from .base import SPMCommandInputSpec, SPMCommand, scans_for_fnames, scans_for_fname
label_desc: Use image node_id 2 for calling the CalcCoregAffine obj's underlying member method code with example usage: obj._make_mat_file() and returns: mat