We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Mrtrix3 `dwi2response` - bad algorithm argument position
### Summary

Th Mrtrix3 `dwi2response` CL wrapper generates the following runtime error:
```shell
dwi2response:
mrinfo: [ERROR] no diffusion encoding information found in image "<DWI_FILE>"
dwi2response: [ERROR] Script requires diffusion gradient table: either in image header, or using -grad / -fslgrad option
```
It turns out that the command generated by `nipype` does not respect (my version of) the Mrtrix3 CL format.

### Actual behavior

Generated command (not runnable):
```shell
dwi2response -fslgrad <BVEC_FILE> <BVAL_FILE> -mask <MASK_FILE> tournier <WM_FILE>
```

### Expected behavior

Runnable command:
```shell
dwi2response tournier -fslgrad <BVEC_FILE> <BVAL_FILE> -mask <MASK_FILE> <WM_FILE>
```

### Environment

- `MRtrix 3.0_RC2-117-gf098f097    dwi2response     bin version: 3.0_RC2-117-gf098f097`
- `Python 2.7.12`
- `nipype v1.0.0`
 

### Quick and dirty solution

I'm really not sure how clean it is, but it worked for me; in the `ResponseSDInputSpec` class, I changed `position=-6` to `position=1` in the `algorithm` traits.



--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `nipype/interfaces/mrtrix3/preprocess.py`
Content:
```
1 # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
2 # vi: set ft=python sts=4 ts=4 sw=4 et:
3 # -*- coding: utf-8 -*-
4 """
5     Change directory to provide relative paths for doctests
6     >>> import os
7     >>> filepath = os.path.dirname(os.path.realpath(__file__ ))
8     >>> datadir = os.path.realpath(os.path.join(filepath,
9     ...                            '../../testing/data'))
10     >>> os.chdir(datadir)
11 
12 """
13 from __future__ import (print_function, division, unicode_literals,
14                         absolute_import)
15 
16 import os.path as op
17 
18 from ..base import (CommandLineInputSpec, CommandLine, traits, TraitedSpec,
19                     File, isdefined, Undefined)
20 from .base import MRTrix3BaseInputSpec, MRTrix3Base
21 
22 
23 class ResponseSDInputSpec(MRTrix3BaseInputSpec):
24     algorithm = traits.Enum(
25         'msmt_5tt',
26         'dhollander',
27         'tournier',
28         'tax',
29         argstr='%s',
30         position=-6,
31         mandatory=True,
32         desc='response estimation algorithm (multi-tissue)')
33     in_file = File(
34         exists=True,
35         argstr='%s',
36         position=-5,
37         mandatory=True,
38         desc='input DWI image')
39     mtt_file = File(argstr='%s', position=-4, desc='input 5tt image')
40     wm_file = File(
41         'wm.txt',
42         argstr='%s',
43         position=-3,
44         usedefault=True,
45         desc='output WM response text file')
46     gm_file = File(
47         argstr='%s', position=-2, desc='output GM response text file')
48     csf_file = File(
49         argstr='%s', position=-1, desc='output CSF response text file')
50     in_mask = File(
51         exists=True, argstr='-mask %s', desc='provide initial mask image')
52     max_sh = traits.Int(
53         8,
54         argstr='-lmax %d',
55         desc='maximum harmonic degree of response function')
56 
57 
58 class ResponseSDOutputSpec(TraitedSpec):
59     wm_file = File(argstr='%s', desc='output WM response text file')
60     gm_file = File(argstr='%s', desc='output GM response text file')
61     csf_file = File(argstr='%s', desc='output CSF response text file')
62 
63 
64 class ResponseSD(MRTrix3Base):
65     """
66     Estimate response function(s) for spherical deconvolution using the specified algorithm.
67 
68     Example
69     -------
70 
71     >>> import nipype.interfaces.mrtrix3 as mrt
72     >>> resp = mrt.ResponseSD()
73     >>> resp.inputs.in_file = 'dwi.mif'
74     >>> resp.inputs.algorithm = 'tournier'
75     >>> resp.inputs.grad_fsl = ('bvecs', 'bvals')
76     >>> resp.cmdline                               # doctest: +ELLIPSIS
77     'dwi2response -fslgrad bvecs bvals tournier dwi.mif wm.txt'
78     >>> resp.run()                                 # doctest: +SKIP
79     """
80 
81     _cmd = 'dwi2response'
82     input_spec = ResponseSDInputSpec
83     output_spec = ResponseSDOutputSpec
84 
85     def _list_outputs(self):
86         outputs = self.output_spec().get()
87         outputs['wm_file'] = op.abspath(self.inputs.wm_file)
88         if self.inputs.gm_file != Undefined:
89             outputs['gm_file'] = op.abspath(self.inputs.gm_file)
90         if self.inputs.csf_file != Undefined:
91             outputs['csf_file'] = op.abspath(self.inputs.csf_file)
92         return outputs
93 
94 
95 class ACTPrepareFSLInputSpec(CommandLineInputSpec):
96     in_file = File(
97         exists=True,
98         argstr='%s',
99         mandatory=True,
100         position=-2,
101         desc='input anatomical image')
102 
103     out_file = File(
104         'act_5tt.mif',
105         argstr='%s',
106         mandatory=True,
107         position=-1,
108         usedefault=True,
109         desc='output file after processing')
110 
111 
112 class ACTPrepareFSLOutputSpec(TraitedSpec):
113     out_file = File(exists=True, desc='the output response file')
114 
115 
116 class ACTPrepareFSL(CommandLine):
117     """
118     Generate anatomical information necessary for Anatomically
119     Constrained Tractography (ACT).
120 
121     Example
122     -------
123 
124     >>> import nipype.interfaces.mrtrix3 as mrt
125     >>> prep = mrt.ACTPrepareFSL()
126     >>> prep.inputs.in_file = 'T1.nii.gz'
127     >>> prep.cmdline                               # doctest: +ELLIPSIS
128     'act_anat_prepare_fsl T1.nii.gz act_5tt.mif'
129     >>> prep.run()                                 # doctest: +SKIP
130     """
131 
132     _cmd = 'act_anat_prepare_fsl'
133     input_spec = ACTPrepareFSLInputSpec
134     output_spec = ACTPrepareFSLOutputSpec
135 
136     def _list_outputs(self):
137         outputs = self.output_spec().get()
138         outputs['out_file'] = op.abspath(self.inputs.out_file)
139         return outputs
140 
141 
142 class ReplaceFSwithFIRSTInputSpec(CommandLineInputSpec):
143     in_file = File(
144         exists=True,
145         argstr='%s',
146         mandatory=True,
147         position=-4,
148         desc='input anatomical image')
149     in_t1w = File(
150         exists=True,
151         argstr='%s',
152         mandatory=True,
153         position=-3,
154         desc='input T1 image')
155     in_config = File(
156         exists=True,
157         argstr='%s',
158         position=-2,
159         desc='connectome configuration file')
160 
161     out_file = File(
162         'aparc+first.mif',
163         argstr='%s',
164         mandatory=True,
165         position=-1,
166         usedefault=True,
167         desc='output file after processing')
168 
169 
170 class ReplaceFSwithFIRSTOutputSpec(TraitedSpec):
171     out_file = File(exists=True, desc='the output response file')
172 
173 
174 class ReplaceFSwithFIRST(CommandLine):
175     """
176     Replace deep gray matter structures segmented with FSL FIRST in a
177     FreeSurfer parcellation.
178 
179     Example
180     -------
181 
182     >>> import nipype.interfaces.mrtrix3 as mrt
183     >>> prep = mrt.ReplaceFSwithFIRST()
184     >>> prep.inputs.in_file = 'aparc+aseg.nii'
185     >>> prep.inputs.in_t1w = 'T1.nii.gz'
186     >>> prep.inputs.in_config = 'mrtrix3_labelconfig.txt'
187     >>> prep.cmdline                               # doctest: +ELLIPSIS
188     'fs_parc_replace_sgm_first aparc+aseg.nii T1.nii.gz \
189 mrtrix3_labelconfig.txt aparc+first.mif'
190     >>> prep.run()                                 # doctest: +SKIP
191     """
192 
193     _cmd = 'fs_parc_replace_sgm_first'
194     input_spec = ReplaceFSwithFIRSTInputSpec
195     output_spec = ReplaceFSwithFIRSTOutputSpec
196 
197     def _list_outputs(self):
198         outputs = self.output_spec().get()
199         outputs['out_file'] = op.abspath(self.inputs.out_file)
200         return outputs
201
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/nipype/interfaces/mrtrix3/preprocess.py b/nipype/interfaces/mrtrix3/preprocess.py
--- a/nipype/interfaces/mrtrix3/preprocess.py
+++ b/nipype/interfaces/mrtrix3/preprocess.py
@@ -27,7 +27,7 @@
         'tournier',
         'tax',
         argstr='%s',
-        position=-6,
+        position=1,
         mandatory=True,
         desc='response estimation algorithm (multi-tissue)')
     in_file = File(
@@ -74,7 +74,7 @@
     >>> resp.inputs.algorithm = 'tournier'
     >>> resp.inputs.grad_fsl = ('bvecs', 'bvals')
     >>> resp.cmdline                               # doctest: +ELLIPSIS
-    'dwi2response -fslgrad bvecs bvals tournier dwi.mif wm.txt'
+    'dwi2response tournier -fslgrad bvecs bvals dwi.mif wm.txt'
     >>> resp.run()                                 # doctest: +SKIP
     """

{"golden_diff": "diff --git a/nipype/interfaces/mrtrix3/preprocess.py b/nipype/interfaces/mrtrix3/preprocess.py\n--- a/nipype/interfaces/mrtrix3/preprocess.py\n+++ b/nipype/interfaces/mrtrix3/preprocess.py\n@@ -27,7 +27,7 @@\n         'tournier',\n         'tax',\n         argstr='%s',\n-        position=-6,\n+        position=1,\n         mandatory=True,\n         desc='response estimation algorithm (multi-tissue)')\n     in_file = File(\n@@ -74,7 +74,7 @@\n     >>> resp.inputs.algorithm = 'tournier'\n     >>> resp.inputs.grad_fsl = ('bvecs', 'bvals')\n     >>> resp.cmdline                               # doctest: +ELLIPSIS\n-    'dwi2response -fslgrad bvecs bvals tournier dwi.mif wm.txt'\n+    'dwi2response tournier -fslgrad bvecs bvals dwi.mif wm.txt'\n     >>> resp.run()                                 # doctest: +SKIP\n     \"\"\"\n", "issue": "Mrtrix3 `dwi2response` - bad algorithm argument position\n### Summary\r\n\r\nTh Mrtrix3 `dwi2response` CL wrapper generates the following runtime error:\r\n```shell\r\ndwi2response:\r\nmrinfo: [ERROR] no diffusion encoding information found in image \"<DWI_FILE>\"\r\ndwi2response: [ERROR] Script requires diffusion gradient table: either in image header, or using -grad / -fslgrad option\r\n```\r\nIt turns out that the command generated by `nipype` does not respect (my version of) the Mrtrix3 CL format.\r\n\r\n### Actual behavior\r\n\r\nGenerated command (not runnable):\r\n```shell\r\ndwi2response -fslgrad <BVEC_FILE> <BVAL_FILE> -mask <MASK_FILE> tournier <WM_FILE>\r\n```\r\n\r\n### Expected behavior\r\n\r\nRunnable command:\r\n```shell\r\ndwi2response tournier -fslgrad <BVEC_FILE> <BVAL_FILE> -mask <MASK_FILE> <WM_FILE>\r\n```\r\n\r\n### Environment\r\n\r\n- `MRtrix 3.0_RC2-117-gf098f097    dwi2response     bin version: 3.0_RC2-117-gf098f097`\r\n- `Python 2.7.12`\r\n- `nipype v1.0.0`\r\n \r\n\r\n### Quick and dirty solution\r\n\r\nI'm really not sure how clean it is, but it worked for me; in the `ResponseSDInputSpec` class, I changed `position=-6` to `position=1` in the `algorithm` traits.\r\n\r\n\n", "before_files": [{"content": "# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-\n# vi: set ft=python sts=4 ts=4 sw=4 et:\n# -*- coding: utf-8 -*-\n\"\"\"\n    Change directory to provide relative paths for doctests\n    >>> import os\n    >>> filepath = os.path.dirname(os.path.realpath(__file__ ))\n    >>> datadir = os.path.realpath(os.path.join(filepath,\n    ...                            '../../testing/data'))\n    >>> os.chdir(datadir)\n\n\"\"\"\nfrom __future__ import (print_function, division, unicode_literals,\n                        absolute_import)\n\nimport os.path as op\n\nfrom ..base import (CommandLineInputSpec, CommandLine, traits, TraitedSpec,\n                    File, isdefined, Undefined)\nfrom .base import MRTrix3BaseInputSpec, MRTrix3Base\n\n\nclass ResponseSDInputSpec(MRTrix3BaseInputSpec):\n    algorithm = traits.Enum(\n        'msmt_5tt',\n        'dhollander',\n        'tournier',\n        'tax',\n        argstr='%s',\n        position=-6,\n        mandatory=True,\n        desc='response estimation algorithm (multi-tissue)')\n    in_file = File(\n        exists=True,\n        argstr='%s',\n        position=-5,\n        mandatory=True,\n        desc='input DWI image')\n    mtt_file = File(argstr='%s', position=-4, desc='input 5tt image')\n    wm_file = File(\n        'wm.txt',\n        argstr='%s',\n        position=-3,\n        usedefault=True,\n        desc='output WM response text file')\n    gm_file = File(\n        argstr='%s', position=-2, desc='output GM response text file')\n    csf_file = File(\n        argstr='%s', position=-1, desc='output CSF response text file')\n    in_mask = File(\n        exists=True, argstr='-mask %s', desc='provide initial mask image')\n    max_sh = traits.Int(\n        8,\n        argstr='-lmax %d',\n        desc='maximum harmonic degree of response function')\n\n\nclass ResponseSDOutputSpec(TraitedSpec):\n    wm_file = File(argstr='%s', desc='output WM response text file')\n    gm_file = File(argstr='%s', desc='output GM response text file')\n    csf_file = File(argstr='%s', desc='output CSF response text file')\n\n\nclass ResponseSD(MRTrix3Base):\n    \"\"\"\n    Estimate response function(s) for spherical deconvolution using the specified algorithm.\n\n    Example\n    -------\n\n    >>> import nipype.interfaces.mrtrix3 as mrt\n    >>> resp = mrt.ResponseSD()\n    >>> resp.inputs.in_file = 'dwi.mif'\n    >>> resp.inputs.algorithm = 'tournier'\n    >>> resp.inputs.grad_fsl = ('bvecs', 'bvals')\n    >>> resp.cmdline                               # doctest: +ELLIPSIS\n    'dwi2response -fslgrad bvecs bvals tournier dwi.mif wm.txt'\n    >>> resp.run()                                 # doctest: +SKIP\n    \"\"\"\n\n    _cmd = 'dwi2response'\n    input_spec = ResponseSDInputSpec\n    output_spec = ResponseSDOutputSpec\n\n    def _list_outputs(self):\n        outputs = self.output_spec().get()\n        outputs['wm_file'] = op.abspath(self.inputs.wm_file)\n        if self.inputs.gm_file != Undefined:\n            outputs['gm_file'] = op.abspath(self.inputs.gm_file)\n        if self.inputs.csf_file != Undefined:\n            outputs['csf_file'] = op.abspath(self.inputs.csf_file)\n        return outputs\n\n\nclass ACTPrepareFSLInputSpec(CommandLineInputSpec):\n    in_file = File(\n        exists=True,\n        argstr='%s',\n        mandatory=True,\n        position=-2,\n        desc='input anatomical image')\n\n    out_file = File(\n        'act_5tt.mif',\n        argstr='%s',\n        mandatory=True,\n        position=-1,\n        usedefault=True,\n        desc='output file after processing')\n\n\nclass ACTPrepareFSLOutputSpec(TraitedSpec):\n    out_file = File(exists=True, desc='the output response file')\n\n\nclass ACTPrepareFSL(CommandLine):\n    \"\"\"\n    Generate anatomical information necessary for Anatomically\n    Constrained Tractography (ACT).\n\n    Example\n    -------\n\n    >>> import nipype.interfaces.mrtrix3 as mrt\n    >>> prep = mrt.ACTPrepareFSL()\n    >>> prep.inputs.in_file = 'T1.nii.gz'\n    >>> prep.cmdline                               # doctest: +ELLIPSIS\n    'act_anat_prepare_fsl T1.nii.gz act_5tt.mif'\n    >>> prep.run()                                 # doctest: +SKIP\n    \"\"\"\n\n    _cmd = 'act_anat_prepare_fsl'\n    input_spec = ACTPrepareFSLInputSpec\n    output_spec = ACTPrepareFSLOutputSpec\n\n    def _list_outputs(self):\n        outputs = self.output_spec().get()\n        outputs['out_file'] = op.abspath(self.inputs.out_file)\n        return outputs\n\n\nclass ReplaceFSwithFIRSTInputSpec(CommandLineInputSpec):\n    in_file = File(\n        exists=True,\n        argstr='%s',\n        mandatory=True,\n        position=-4,\n        desc='input anatomical image')\n    in_t1w = File(\n        exists=True,\n        argstr='%s',\n        mandatory=True,\n        position=-3,\n        desc='input T1 image')\n    in_config = File(\n        exists=True,\n        argstr='%s',\n        position=-2,\n        desc='connectome configuration file')\n\n    out_file = File(\n        'aparc+first.mif',\n        argstr='%s',\n        mandatory=True,\n        position=-1,\n        usedefault=True,\n        desc='output file after processing')\n\n\nclass ReplaceFSwithFIRSTOutputSpec(TraitedSpec):\n    out_file = File(exists=True, desc='the output response file')\n\n\nclass ReplaceFSwithFIRST(CommandLine):\n    \"\"\"\n    Replace deep gray matter structures segmented with FSL FIRST in a\n    FreeSurfer parcellation.\n\n    Example\n    -------\n\n    >>> import nipype.interfaces.mrtrix3 as mrt\n    >>> prep = mrt.ReplaceFSwithFIRST()\n    >>> prep.inputs.in_file = 'aparc+aseg.nii'\n    >>> prep.inputs.in_t1w = 'T1.nii.gz'\n    >>> prep.inputs.in_config = 'mrtrix3_labelconfig.txt'\n    >>> prep.cmdline                               # doctest: +ELLIPSIS\n    'fs_parc_replace_sgm_first aparc+aseg.nii T1.nii.gz \\\nmrtrix3_labelconfig.txt aparc+first.mif'\n    >>> prep.run()                                 # doctest: +SKIP\n    \"\"\"\n\n    _cmd = 'fs_parc_replace_sgm_first'\n    input_spec = ReplaceFSwithFIRSTInputSpec\n    output_spec = ReplaceFSwithFIRSTOutputSpec\n\n    def _list_outputs(self):\n        outputs = self.output_spec().get()\n        outputs['out_file'] = op.abspath(self.inputs.out_file)\n        return outputs\n", "path": "nipype/interfaces/mrtrix3/preprocess.py"}], "after_files": [{"content": "# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-\n# vi: set ft=python sts=4 ts=4 sw=4 et:\n# -*- coding: utf-8 -*-\n\"\"\"\n    Change directory to provide relative paths for doctests\n    >>> import os\n    >>> filepath = os.path.dirname(os.path.realpath(__file__ ))\n    >>> datadir = os.path.realpath(os.path.join(filepath,\n    ...                            '../../testing/data'))\n    >>> os.chdir(datadir)\n\n\"\"\"\nfrom __future__ import (print_function, division, unicode_literals,\n                        absolute_import)\n\nimport os.path as op\n\nfrom ..base import (CommandLineInputSpec, CommandLine, traits, TraitedSpec,\n                    File, isdefined, Undefined)\nfrom .base import MRTrix3BaseInputSpec, MRTrix3Base\n\n\nclass ResponseSDInputSpec(MRTrix3BaseInputSpec):\n    algorithm = traits.Enum(\n        'msmt_5tt',\n        'dhollander',\n        'tournier',\n        'tax',\n        argstr='%s',\n        position=1,\n        mandatory=True,\n        desc='response estimation algorithm (multi-tissue)')\n    in_file = File(\n        exists=True,\n        argstr='%s',\n        position=-5,\n        mandatory=True,\n        desc='input DWI image')\n    mtt_file = File(argstr='%s', position=-4, desc='input 5tt image')\n    wm_file = File(\n        'wm.txt',\n        argstr='%s',\n        position=-3,\n        usedefault=True,\n        desc='output WM response text file')\n    gm_file = File(\n        argstr='%s', position=-2, desc='output GM response text file')\n    csf_file = File(\n        argstr='%s', position=-1, desc='output CSF response text file')\n    in_mask = File(\n        exists=True, argstr='-mask %s', desc='provide initial mask image')\n    max_sh = traits.Int(\n        8,\n        argstr='-lmax %d',\n        desc='maximum harmonic degree of response function')\n\n\nclass ResponseSDOutputSpec(TraitedSpec):\n    wm_file = File(argstr='%s', desc='output WM response text file')\n    gm_file = File(argstr='%s', desc='output GM response text file')\n    csf_file = File(argstr='%s', desc='output CSF response text file')\n\n\nclass ResponseSD(MRTrix3Base):\n    \"\"\"\n    Estimate response function(s) for spherical deconvolution using the specified algorithm.\n\n    Example\n    -------\n\n    >>> import nipype.interfaces.mrtrix3 as mrt\n    >>> resp = mrt.ResponseSD()\n    >>> resp.inputs.in_file = 'dwi.mif'\n    >>> resp.inputs.algorithm = 'tournier'\n    >>> resp.inputs.grad_fsl = ('bvecs', 'bvals')\n    >>> resp.cmdline                               # doctest: +ELLIPSIS\n    'dwi2response tournier -fslgrad bvecs bvals dwi.mif wm.txt'\n    >>> resp.run()                                 # doctest: +SKIP\n    \"\"\"\n\n    _cmd = 'dwi2response'\n    input_spec = ResponseSDInputSpec\n    output_spec = ResponseSDOutputSpec\n\n    def _list_outputs(self):\n        outputs = self.output_spec().get()\n        outputs['wm_file'] = op.abspath(self.inputs.wm_file)\n        if self.inputs.gm_file != Undefined:\n            outputs['gm_file'] = op.abspath(self.inputs.gm_file)\n        if self.inputs.csf_file != Undefined:\n            outputs['csf_file'] = op.abspath(self.inputs.csf_file)\n        return outputs\n\n\nclass ACTPrepareFSLInputSpec(CommandLineInputSpec):\n    in_file = File(\n        exists=True,\n        argstr='%s',\n        mandatory=True,\n        position=-2,\n        desc='input anatomical image')\n\n    out_file = File(\n        'act_5tt.mif',\n        argstr='%s',\n        mandatory=True,\n        position=-1,\n        usedefault=True,\n        desc='output file after processing')\n\n\nclass ACTPrepareFSLOutputSpec(TraitedSpec):\n    out_file = File(exists=True, desc='the output response file')\n\n\nclass ACTPrepareFSL(CommandLine):\n    \"\"\"\n    Generate anatomical information necessary for Anatomically\n    Constrained Tractography (ACT).\n\n    Example\n    -------\n\n    >>> import nipype.interfaces.mrtrix3 as mrt\n    >>> prep = mrt.ACTPrepareFSL()\n    >>> prep.inputs.in_file = 'T1.nii.gz'\n    >>> prep.cmdline                               # doctest: +ELLIPSIS\n    'act_anat_prepare_fsl T1.nii.gz act_5tt.mif'\n    >>> prep.run()                                 # doctest: +SKIP\n    \"\"\"\n\n    _cmd = 'act_anat_prepare_fsl'\n    input_spec = ACTPrepareFSLInputSpec\n    output_spec = ACTPrepareFSLOutputSpec\n\n    def _list_outputs(self):\n        outputs = self.output_spec().get()\n        outputs['out_file'] = op.abspath(self.inputs.out_file)\n        return outputs\n\n\nclass ReplaceFSwithFIRSTInputSpec(CommandLineInputSpec):\n    in_file = File(\n        exists=True,\n        argstr='%s',\n        mandatory=True,\n        position=-4,\n        desc='input anatomical image')\n    in_t1w = File(\n        exists=True,\n        argstr='%s',\n        mandatory=True,\n        position=-3,\n        desc='input T1 image')\n    in_config = File(\n        exists=True,\n        argstr='%s',\n        position=-2,\n        desc='connectome configuration file')\n\n    out_file = File(\n        'aparc+first.mif',\n        argstr='%s',\n        mandatory=True,\n        position=-1,\n        usedefault=True,\n        desc='output file after processing')\n\n\nclass ReplaceFSwithFIRSTOutputSpec(TraitedSpec):\n    out_file = File(exists=True, desc='the output response file')\n\n\nclass ReplaceFSwithFIRST(CommandLine):\n    \"\"\"\n    Replace deep gray matter structures segmented with FSL FIRST in a\n    FreeSurfer parcellation.\n\n    Example\n    -------\n\n    >>> import nipype.interfaces.mrtrix3 as mrt\n    >>> prep = mrt.ReplaceFSwithFIRST()\n    >>> prep.inputs.in_file = 'aparc+aseg.nii'\n    >>> prep.inputs.in_t1w = 'T1.nii.gz'\n    >>> prep.inputs.in_config = 'mrtrix3_labelconfig.txt'\n    >>> prep.cmdline                               # doctest: +ELLIPSIS\n    'fs_parc_replace_sgm_first aparc+aseg.nii T1.nii.gz \\\nmrtrix3_labelconfig.txt aparc+first.mif'\n    >>> prep.run()                                 # doctest: +SKIP\n    \"\"\"\n\n    _cmd = 'fs_parc_replace_sgm_first'\n    input_spec = ReplaceFSwithFIRSTInputSpec\n    output_spec = ReplaceFSwithFIRSTOutputSpec\n\n    def _list_outputs(self):\n        outputs = self.output_spec().get()\n        outputs['out_file'] = op.abspath(self.inputs.out_file)\n        return outputs\n", "path": "nipype/interfaces/mrtrix3/preprocess.py"}]}