Skip to content

Commit 7647d73

Browse files
committed
add interface to act_anat_prepare_fsl
1 parent 5045a8b commit 7647d73

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed

nipype/interfaces/mrtrix3/preprocess.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,42 @@ def _list_outputs(self):
121121
if isdefined(self.inputs.out_sf):
122122
outputs['out_sf'] = op.abspath(self.inputs.out_sf)
123123
return outputs
124+
125+
126+
class ACTPrepareFSLInputSpec(CommandLineInputSpec):
127+
in_file = File(exists=True, argstr='%s', mandatory=True, position=-2,
128+
desc='input anatomical image')
129+
130+
out_file = File(
131+
'act_5tt.mif', argstr='%s', mandatory=True, position=-1,
132+
usedefault=True, desc='output file after processing')
133+
134+
135+
class ACTPrepareFSLOutputSpec(TraitedSpec):
136+
out_file = File(exists=True, desc='the output response file')
137+
138+
139+
class ACTPrepareFSL(CommandLine):
140+
141+
"""
142+
Performs tractography after selecting the appropriate algorithm
143+
144+
Example
145+
-------
146+
147+
>>> import nipype.interfaces.mrtrix3 as mrt
148+
>>> resp = mrt.ACTPrepareFSL()
149+
>>> resp.inputs.in_file = 'T1.nii.gz'
150+
>>> resp.cmdline # doctest: +ELLIPSIS
151+
'act_anat_prepare_fsl T1.nii.gz act_5tt.mif'
152+
>>> resp.run() # doctest: +SKIP
153+
"""
154+
155+
_cmd = 'act_anat_prepare_fsl'
156+
input_spec = ACTPrepareFSLInputSpec
157+
output_spec = ACTPrepareFSLOutputSpec
158+
159+
def _list_outputs(self):
160+
outputs = self.output_spec().get()
161+
outputs['out_file'] = op.abspath(self.inputs.out_file)
162+
return outputs
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
2+
from nipype.testing import assert_equal
3+
from nipype.interfaces.mrtrix3.preprocess import ACTPrepareFSL
4+
5+
def test_ACTPrepareFSL_inputs():
6+
input_map = dict(args=dict(argstr='%s',
7+
),
8+
environ=dict(nohash=True,
9+
usedefault=True,
10+
),
11+
ignore_exception=dict(nohash=True,
12+
usedefault=True,
13+
),
14+
in_file=dict(argstr='%s',
15+
mandatory=True,
16+
position=-2,
17+
),
18+
out_file=dict(argstr='%s',
19+
mandatory=True,
20+
position=-1,
21+
usedefault=True,
22+
),
23+
terminal_output=dict(nohash=True,
24+
),
25+
)
26+
inputs = ACTPrepareFSL.input_spec()
27+
28+
for key, metadata in input_map.items():
29+
for metakey, value in metadata.items():
30+
yield assert_equal, getattr(inputs.traits()[key], metakey), value
31+
32+
def test_ACTPrepareFSL_outputs():
33+
output_map = dict(out_file=dict(),
34+
)
35+
outputs = ACTPrepareFSL.output_spec()
36+
37+
for key, metadata in output_map.items():
38+
for metakey, value in metadata.items():
39+
yield assert_equal, getattr(outputs.traits()[key], metakey), value
40+

0 commit comments

Comments
 (0)