class_docstr: Elastix nonlinear registration interface
  
  Example
  -------
  
  >>> from nipype.interfaces.elastix import Registration
  >>> reg = Registration()
  >>> reg.inputs.fixed_image = 'fixed1.nii'
  >>> reg.inputs.moving_image = 'moving1.nii'
  >>> reg.inputs.parameters = ['elastix.txt']
  >>> reg.cmdline
  'elastix -f fixed1.nii -m moving1.nii -threads 1 -out ./ -p elastix.txt'
class_docstr_tok: ["Elastix","nonlinear","registration","interface","Example","--","--","--","-",">",">",">","from","nipype.interfaces.elastix","import","Registration",">",">",">","reg","=","Registration","(",")",">",">",">","reg.inputs.fixed_image","=","'fixed1.nii'",">",">",">","reg.inputs.moving_image","=","'moving1.nii'",">",">",">","reg.inputs.parameters","=","[","'elastix.txt","'","]",">",">",">","reg.cmdline","'elastix","-f","fixed1.nii","-m","moving1.nii","-threads","1","-out",".\/","-p","elastix.txt","'"]
code: def _list_outputs(self):
      outputs = self._outputs().get()
  
      out_dir = op.abspath(self.inputs.output_path)
  
      regex = re.compile(r"^\((\w+)\s(.+)\)$")
  
      outputs["transform"] = []
      outputs["warped_files"] = []
      outputs["warped_files_flags"] = []
  
      for i, params in enumerate(self.inputs.parameters):
          config = {}
  
          with open(params) as f:
              for line in f.readlines():
                  line = line.strip()
                  if not line.startswith("//") and line:
                      m = regex.search(line)
                      if m:
                          value = self._cast(m.group(2).strip())
                          config[m.group(1).strip()] = value
  
          outputs["transform"].append(
              op.join(out_dir, "TransformParameters.%01d.txt" % i)
          )
  
          warped_file = None
          if config["WriteResultImage"]:
              warped_file = op.join(
                  out_dir,
                  "result.%01d.%s" % (i, config["ResultImageFormat"]),
              )
  
          outputs["warped_files"].append(warped_file)
          outputs["warped_files_flags"].append(
              config["WriteResultImage"]
          )
  
      if outputs["warped_files_flags"][-1]:
          outputs["warped_file"] = outputs["warped_files"][-1]
  
      return outputs
  
imports: import os.path
  import re
  from ...None import logging
  from .base import ElastixBaseInputSpec
  from ..base import CommandLine, TraitedSpec, File, traits, InputMultiPath
label_desc: Use image node_id 1 for calling the Registration obj's underlying member method code with example usage: obj._list_outputs() and returns: outputs