class_docstr: Warps a time-series from one space to another
  
  Examples
  --------
  
  >>> from nipype.interfaces.ants import WarpTimeSeriesImageMultiTransform
  >>> wtsimt = WarpTimeSeriesImageMultiTransform()
  >>> wtsimt.inputs.input_image = 'resting.nii'
  >>> wtsimt.inputs.reference_image = 'ants_deformed.nii.gz'
  >>> wtsimt.inputs.transformation_series = ['ants_Warp.nii.gz','ants_Affine.txt']
  >>> wtsimt.cmdline
  'WarpTimeSeriesImageMultiTransform 4 resting.nii resting_wtsimt.nii -R ants_deformed.nii.gz ants_Warp.nii.gz ants_Affine.txt'
  
  >>> wtsimt = WarpTimeSeriesImageMultiTransform()
  >>> wtsimt.inputs.input_image = 'resting.nii'
  >>> wtsimt.inputs.reference_image = 'ants_deformed.nii.gz'
  >>> wtsimt.inputs.transformation_series = ['ants_Warp.nii.gz','ants_Affine.txt']
  >>> wtsimt.inputs.invert_affine = [1] # # this will invert the 1st Affine file: ants_Affine.txt
  >>> wtsimt.cmdline
  'WarpTimeSeriesImageMultiTransform 4 resting.nii resting_wtsimt.nii -R ants_deformed.nii.gz ants_Warp.nii.gz -i ants_Affine.txt'
class_docstr_tok: ["Warps","a","time-series","from","one","space","to","another","Examples","--","--","--","--",">",">",">","from","nipype.interfaces.ants","import","WarpTimeSeriesImageMultiTransform",">",">",">","wtsimt","=","WarpTimeSeriesImageMultiTransform","(",")",">",">",">","wtsimt.inputs.input_image","=","'resting.nii'",">",">",">","wtsimt.inputs.reference_image","=","'ants_deformed.nii.gz'",">",">",">","wtsimt.inputs.transformation_series","=","[","'ants_Warp.nii.gz","'",",","'ants_Affine.txt","'","]",">",">",">","wtsimt.cmdline","'WarpTimeSeriesImageMultiTransform","4","resting.nii","resting_wtsimt.nii","-R","ants_deformed.nii.gz","ants_Warp.nii.gz","ants_Affine.txt'",">",">",">","wtsimt","=","WarpTimeSeriesImageMultiTransform","(",")",">",">",">","wtsimt.inputs.input_image","=","'resting.nii'",">",">",">","wtsimt.inputs.reference_image","=","'ants_deformed.nii.gz'",">",">",">","wtsimt.inputs.transformation_series","=","[","'ants_Warp.nii.gz","'",",","'ants_Affine.txt","'","]",">",">",">","wtsimt.inputs.invert_affine","=","[","1","]","#","#","this","will","invert","the","1st","Affine","file",":","ants_Affine.txt",">",">",">","wtsimt.cmdline","'WarpTimeSeriesImageMultiTransform","4","resting.nii","resting_wtsimt.nii","-R","ants_deformed.nii.gz","ants_Warp.nii.gz","-i","ants_Affine.txt","'"]
code: def _format_arg(self, opt, spec, val):
      if opt == "out_postfix":
          _, name, ext = split_filename(
              os.path.abspath(self.inputs.input_image)
          )
          return name + val + ext
      if opt == "transformation_series":
          series = []
          affine_counter = 0
          affine_invert = []
          for transformation in val:
              if "Affine" in transformation and isdefined(
                  self.inputs.invert_affine
              ):
                  affine_counter += 1
                  if affine_counter in self.inputs.invert_affine:
                      series += ["-i"]
                      affine_invert.append(affine_counter)
              series += [transformation]
  
          if isdefined(self.inputs.invert_affine):
              diff_inv = set(self.inputs.invert_affine) - set(
                  affine_invert
              )
              if diff_inv:
                  raise Exceptions(
                      "Review invert_affine, not all indexes from invert_affine were used, "
                      "check the description for the full definition"
                  )
  
          return " ".join(series)
      return super()._format_arg(opt, spec, val)
  
imports: import os
  from .base import ANTSCommand, ANTSCommandInputSpec
  from ..base import TraitedSpec, File, traits, isdefined, InputMultiObject
  from ...utils.filemanip import split_filename
label_desc: Use image node_id 1 for calling the WarpTimeSeriesImageMultiTransform obj's underlying member method code with example usage: obj._format_arg(opt, spec, val) and returns: super, unknown, str