Skip to content

Commit 4bfae3f

Browse files
committed
Dcm2nii and related tests
1 parent ffcb76b commit 4bfae3f

File tree

2 files changed

+40
-13
lines changed

2 files changed

+40
-13
lines changed

nipype/interfaces/dcm2nii.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Dcm2niiInputSpec(CommandLineInputSpec):
2121
copyfile=False, mandatory=True)
2222
anonymize = traits.Bool(True, argstr='-a', usedefault=True, position=0)
2323
config_file = File(exists=True, argstr="-b %s", genfile=True, position=1)
24-
collapse_folders = traits.Bool(True, argstr='-c', usedefault=True, position=2)
24+
collapse_folders = traits.Bool(True, argstr='-c', usedefault=True, position=2)
2525
date_in_filename = traits.Bool(True, argstr='-d', usedefault=True, position=3)
2626
events_in_filename = traits.Bool(True, argstr='-e', usedefault=True, position=4)
2727
source_in_filename = traits.Bool(False, argstr='-f', usedefault=True, position=5)
@@ -56,7 +56,7 @@ class Dcm2nii(CommandLine):
5656
>>> converter.inputs.gzip_output = True
5757
>>> converter.inputs.output_dir = '.'
5858
>>> converter.cmdline #doctest: +ELLIPSIS
59-
'dcm2nii -g y -n y -i n -o . -b config.ini functional_1.dcm'
59+
'dcm2nii -a y -b config.ini -c y -d y -e y -f n -g y -i n -n y -o . -p y -v y -x n functional_1.dcm'
6060
>>> converter.run() # doctest: +SKIP
6161
"""
6262

@@ -69,7 +69,7 @@ def _format_arg(self, opt, spec, val):
6969
if opt in ['anonymize', 'collapse_folders', 'date_in_filename', 'events_in_filename',
7070
'source_in_filename','gzip_output', 'id_in_filename','nii_output',
7171
'protocol_in_filename','reorient','spm_analyze','convert_all_pars',
72-
'reorient_and_crop']:
72+
'reorient_and_crop']:
7373
spec = deepcopy(spec)
7474
if val:
7575
spec.argstr += ' y'

nipype/interfaces/tests/test_auto_Dcm2nii.py

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,50 +4,77 @@
44

55
def test_Dcm2nii_inputs():
66
input_map = dict(anonymize=dict(argstr='-a',
7-
position=2,
7+
position=0,
8+
usedefault=True,
89
),
910
args=dict(argstr='%s',
10-
position=9,
11+
position=15,
12+
),
13+
collapse_folders=dict(argstr='-c',
14+
position=2,
15+
usedefault=True,
1116
),
1217
config_file=dict(argstr='-b %s',
1318
genfile=True,
14-
position=7,
19+
position=1,
1520
),
1621
convert_all_pars=dict(argstr='-v',
17-
position=8,
22+
position=13,
23+
usedefault=True,
24+
),
25+
date_in_filename=dict(argstr='-d',
26+
position=3,
27+
usedefault=True,
1828
),
1929
environ=dict(nohash=True,
2030
usedefault=True,
2131
),
32+
events_in_filename=dict(argstr='-e',
33+
position=4,
34+
usedefault=True,
35+
),
2236
gzip_output=dict(argstr='-g',
23-
position=0,
37+
position=6,
2438
usedefault=True,
2539
),
2640
id_in_filename=dict(argstr='-i',
27-
position=3,
41+
position=7,
2842
usedefault=True,
2943
),
3044
ignore_exception=dict(nohash=True,
3145
usedefault=True,
3246
),
3347
nii_output=dict(argstr='-n',
34-
position=1,
48+
position=8,
3549
usedefault=True,
3650
),
3751
output_dir=dict(argstr='-o %s',
3852
genfile=True,
39-
position=6,
53+
position=9,
54+
),
55+
protocol_in_filename=dict(argstr='-p',
56+
position=10,
57+
usedefault=True,
4058
),
4159
reorient=dict(argstr='-r',
42-
position=4,
60+
position=11,
4361
),
4462
reorient_and_crop=dict(argstr='-x',
63+
position=14,
64+
usedefault=True,
65+
),
66+
source_in_filename=dict(argstr='-f',
4567
position=5,
68+
usedefault=True,
4669
),
4770
source_names=dict(argstr='%s',
4871
copyfile=False,
4972
mandatory=True,
50-
position=10,
73+
position=16,
74+
),
75+
spm_analyze=dict(argstr='-s',
76+
position=12,
77+
xor=['nii_output'],
5178
),
5279
terminal_output=dict(mandatory=True,
5380
nohash=True,

0 commit comments

Comments
 (0)