Skip to content

Commit 4e5d8ec

Browse files
authored
Merge pull request #2114 from 62442katieb/expand-afni-utils
ENH: Add 1dCat, 3dNwarpApply, and add options to 3dBrickStat
2 parents 5c6e7af + a724b13 commit 4e5d8ec

23 files changed

+998
-8
lines changed

nipype/interfaces/afni/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
Seg, SkullStrip, TCorr1D, TCorrMap, TCorrelate,
1818
TShift, Volreg, Warp, QwarpPlusMinus, Qwarp)
1919
from .svm import (SVMTest, SVMTrain)
20-
from .utils import (AFNItoNIFTI, Autobox,Axialize, BrickStat, Calc, Copy, Edge3,
21-
Eval, FWHMx,
22-
MaskTool, Merge, Notes, Refit, Resample, TCat, TStat, To3D,
23-
Unifize, ZCutUp, GCOR,Zcat, Zeropad)
20+
from .utils import (AFNItoNIFTI, Autobox, Axialize, BrickStat, Calc, Cat, Copy,
21+
Edge3, Eval, FWHMx, MaskTool, Merge, Notes, NwarpApply,
22+
Refit, Resample, TCat, TStat, To3D, Unifize, ZCutUp, GCOR,
23+
Zcat, Zeropad)
2424
from .model import (Deconvolve, Remlfit)

nipype/interfaces/afni/model.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,6 @@ class RemlfitInputSpec(AFNICommandInputSpec):
360360
'option. Each column in the specified file(s) will be appended '
361361
'to the matrix. File(s) must have at least as many rows as the '
362362
'matrix does.',
363-
exists=True,
364363
copyfile=False,
365364
sep=" ",
366365
argstr='-addbase %s')
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
2+
from __future__ import unicode_literals
3+
from ..utils import Axialize
4+
5+
6+
def test_Axialize_inputs():
7+
input_map = dict(args=dict(argstr='%s',
8+
),
9+
axial=dict(argstr='-axial',
10+
xor=['coronal', 'sagittal'],
11+
),
12+
coronal=dict(argstr='-coronal',
13+
xor=['sagittal', 'axial'],
14+
),
15+
environ=dict(nohash=True,
16+
usedefault=True,
17+
),
18+
ignore_exception=dict(nohash=True,
19+
usedefault=True,
20+
),
21+
in_file=dict(argstr='%s',
22+
copyfile=False,
23+
mandatory=True,
24+
position=-2,
25+
),
26+
orientation=dict(argstr='-orient %s',
27+
),
28+
out_file=dict(argstr='-prefix %s',
29+
name_source='in_file',
30+
name_template='%s_axialize',
31+
),
32+
outputtype=dict(),
33+
sagittal=dict(argstr='-sagittal',
34+
xor=['coronal', 'axial'],
35+
),
36+
terminal_output=dict(nohash=True,
37+
),
38+
verb=dict(argstr='-verb',
39+
),
40+
)
41+
inputs = Axialize.input_spec()
42+
43+
for key, metadata in list(input_map.items()):
44+
for metakey, value in list(metadata.items()):
45+
assert getattr(inputs.traits()[key], metakey) == value
46+
47+
48+
def test_Axialize_outputs():
49+
output_map = dict(out_file=dict(),
50+
)
51+
outputs = Axialize.output_spec()
52+
53+
for key, metadata in list(output_map.items()):
54+
for metakey, value in list(metadata.items()):
55+
assert getattr(outputs.traits()[key], metakey) == value

nipype/interfaces/afni/tests/test_auto_BrickStat.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,23 @@ def test_BrickStat_inputs():
1919
mask=dict(argstr='-mask %s',
2020
position=2,
2121
),
22+
max=dict(argstr='-max',
23+
),
24+
mean=dict(argstr='-mean',
25+
),
2226
min=dict(argstr='-min',
2327
position=1,
2428
),
29+
percentile=dict(argstr='-percentile %.3f %.3f %.3f',
30+
),
31+
slow=dict(argstr='-slow',
32+
),
33+
sum=dict(argstr='-sum',
34+
),
2535
terminal_output=dict(nohash=True,
2636
),
37+
var=dict(argstr='-var',
38+
),
2739
)
2840
inputs = BrickStat.input_spec()
2941

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
2+
from __future__ import unicode_literals
3+
from ..utils import Cat
4+
5+
6+
def test_Cat_inputs():
7+
input_map = dict(args=dict(argstr='%s',
8+
),
9+
environ=dict(nohash=True,
10+
usedefault=True,
11+
),
12+
ignore_exception=dict(nohash=True,
13+
usedefault=True,
14+
),
15+
in_files=dict(argstr='%s',
16+
mandatory=True,
17+
position=-2,
18+
),
19+
keepfree=dict(argstr='-nonfixed',
20+
),
21+
omitconst=dict(argstr='-nonconst',
22+
),
23+
out_cint=dict(xor=['out_format', 'out_nice', 'out_double', 'out_fint', 'out_int'],
24+
),
25+
out_double=dict(argstr='-d',
26+
xor=['out_format', 'out_nice', 'out_int', 'out_fint', 'out_cint'],
27+
),
28+
out_file=dict(argstr='> %s',
29+
mandatory=True,
30+
position=-1,
31+
),
32+
out_fint=dict(argstr='-f',
33+
xor=['out_format', 'out_nice', 'out_double', 'out_int', 'out_cint'],
34+
),
35+
out_format=dict(argstr='-form %s',
36+
xor=['out_int', 'out_nice', 'out_double', 'out_fint', 'out_cint'],
37+
),
38+
out_int=dict(argstr='-i',
39+
xor=['out_format', 'out_nice', 'out_double', 'out_fint', 'out_cint'],
40+
),
41+
out_nice=dict(argstr='-n',
42+
xor=['out_format', 'out_int', 'out_double', 'out_fint', 'out_cint'],
43+
),
44+
outputtype=dict(),
45+
sel=dict(argstr='-sel %s',
46+
),
47+
stack=dict(argstr='-stack',
48+
),
49+
terminal_output=dict(nohash=True,
50+
),
51+
)
52+
inputs = Cat.input_spec()
53+
54+
for key, metadata in list(input_map.items()):
55+
for metakey, value in list(metadata.items()):
56+
assert getattr(inputs.traits()[key], metakey) == value
57+
58+
59+
def test_Cat_outputs():
60+
output_map = dict(out_file=dict(),
61+
)
62+
outputs = Cat.output_spec()
63+
64+
for key, metadata in list(output_map.items()):
65+
for metakey, value in list(metadata.items()):
66+
assert getattr(outputs.traits()[key], metakey) == value
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
2+
from __future__ import unicode_literals
3+
from ..utils import NwarpApply
4+
5+
6+
def test_NwarpApply_inputs():
7+
input_map = dict(ainterp=dict(argstr='-ainterp %s',
8+
),
9+
args=dict(argstr='%s',
10+
),
11+
environ=dict(nohash=True,
12+
usedefault=True,
13+
),
14+
ignore_exception=dict(nohash=True,
15+
usedefault=True,
16+
),
17+
in_file=dict(argstr='-source %s',
18+
mandatory=True,
19+
),
20+
interp=dict(argstr='-interp %s',
21+
),
22+
inv_warp=dict(argstr='-iwarp',
23+
),
24+
master=dict(argstr='-master %s',
25+
),
26+
out_file=dict(argstr='-prefix %s',
27+
name_source='in_file',
28+
name_template='%s_Nwarp',
29+
),
30+
quiet=dict(argstr='-quiet',
31+
xor=['verb'],
32+
),
33+
short=dict(argstr='-short',
34+
),
35+
terminal_output=dict(nohash=True,
36+
),
37+
verb=dict(argstr='-verb',
38+
xor=['quiet'],
39+
),
40+
warp=dict(argstr='-nwarp %s',
41+
mandatory=True,
42+
),
43+
)
44+
inputs = NwarpApply.input_spec()
45+
46+
for key, metadata in list(input_map.items()):
47+
for metakey, value in list(metadata.items()):
48+
assert getattr(inputs.traits()[key], metakey) == value
49+
50+
51+
def test_NwarpApply_outputs():
52+
output_map = dict(out_file=dict(),
53+
)
54+
outputs = NwarpApply.output_spec()
55+
56+
for key, metadata in list(output_map.items()):
57+
for metakey, value in list(metadata.items()):
58+
assert getattr(outputs.traits()[key], metakey) == value
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
2+
from __future__ import unicode_literals
3+
from ..preprocess import Qwarp
4+
5+
6+
def test_Qwarp_inputs():
7+
input_map = dict(Qfinal=dict(argstr='-Qfinal',
8+
),
9+
Qonly=dict(argstr='-Qonly',
10+
),
11+
allsave=dict(argstr='-allsave',
12+
xor=['nopadWARP', 'duplo', 'plusminus'],
13+
),
14+
args=dict(argstr='%s',
15+
),
16+
ballopt=dict(argstr='-ballopt',
17+
xor=['workhard', 'boxopt'],
18+
),
19+
base_file=dict(argstr='-base %s',
20+
copyfile=False,
21+
mandatory=True,
22+
),
23+
baxopt=dict(argstr='-boxopt',
24+
xor=['workhard', 'ballopt'],
25+
),
26+
blur=dict(argstr='-blur %s',
27+
),
28+
duplo=dict(argstr='-duplo',
29+
xor=['gridlist', 'maxlev', 'inilev', 'iniwarp', 'plusminus', 'allsave'],
30+
),
31+
emask=dict(argstr='-emask %s',
32+
copyfile=False,
33+
),
34+
environ=dict(nohash=True,
35+
usedefault=True,
36+
),
37+
expad=dict(argstr='-expad %d',
38+
xor=['nopadWARP'],
39+
),
40+
gridlist=dict(argstr='-gridlist %s',
41+
copyfile=False,
42+
xor=['duplo', 'plusminus'],
43+
),
44+
hel=dict(argstr='-hel',
45+
xor=['nmi', 'mi', 'lpc', 'lpa', 'pear'],
46+
),
47+
ignore_exception=dict(nohash=True,
48+
usedefault=True,
49+
),
50+
in_file=dict(argstr='-source %s',
51+
copyfile=False,
52+
mandatory=True,
53+
),
54+
inilev=dict(argstr='-inlev %d',
55+
xor=['duplo'],
56+
),
57+
iniwarp=dict(argstr='-iniwarp %s',
58+
xor=['duplo'],
59+
),
60+
iwarp=dict(argstr='-iwarp',
61+
xor=['plusminus'],
62+
),
63+
lpa=dict(argstr='-lpa',
64+
xor=['nmi', 'mi', 'lpc', 'hel', 'pear'],
65+
),
66+
lpc=dict(argstr='-lpc',
67+
position=-2,
68+
xor=['nmi', 'mi', 'hel', 'lpa', 'pear'],
69+
),
70+
maxlev=dict(argstr='-maxlev %d',
71+
position=-1,
72+
xor=['duplo'],
73+
),
74+
mi=dict(argstr='-mi',
75+
xor=['mi', 'hel', 'lpc', 'lpa', 'pear'],
76+
),
77+
minpatch=dict(argstr='-minpatch %d',
78+
),
79+
nmi=dict(argstr='-nmi',
80+
xor=['nmi', 'hel', 'lpc', 'lpa', 'pear'],
81+
),
82+
noXdis=dict(argstr='-noXdis',
83+
),
84+
noYdis=dict(argstr='-noYdis',
85+
),
86+
noZdis=dict(argstr='-noZdis',
87+
),
88+
noneg=dict(argstr='-noneg',
89+
),
90+
nopad=dict(argstr='-nopad',
91+
),
92+
nopadWARP=dict(argstr='-nopadWARP',
93+
xor=['allsave', 'expad'],
94+
),
95+
nopenalty=dict(argstr='-nopenalty',
96+
),
97+
nowarp=dict(argstr='-nowarp',
98+
),
99+
noweight=dict(argstr='-noweight',
100+
),
101+
out_file=dict(argstr='-prefix %s',
102+
genfile=True,
103+
name_source=['in_file'],
104+
name_template='%s_QW',
105+
),
106+
out_weight_file=dict(argstr='-wtprefix %s',
107+
),
108+
outputtype=dict(),
109+
overwrite=dict(argstr='-overwrite',
110+
),
111+
pblur=dict(argstr='-pblur %s',
112+
),
113+
pear=dict(argstr='-pear',
114+
),
115+
penfac=dict(argstr='-penfac %f',
116+
),
117+
plusminus=dict(argstr='-plusminus',
118+
xor=['duplo', 'allsave', 'iwarp'],
119+
),
120+
quiet=dict(argstr='-quiet',
121+
xor=['verb'],
122+
),
123+
resample=dict(argstr='-resample',
124+
),
125+
terminal_output=dict(nohash=True,
126+
),
127+
verb=dict(argstr='-verb',
128+
xor=['quiet'],
129+
),
130+
wball=dict(argstr='-wball %s',
131+
),
132+
weight=dict(argstr='-weight %s',
133+
),
134+
wmask=dict(argstr='-wpass %s %f',
135+
),
136+
workhard=dict(argstr='-workhard',
137+
xor=['boxopt', 'ballopt'],
138+
),
139+
)
140+
inputs = Qwarp.input_spec()
141+
142+
for key, metadata in list(input_map.items()):
143+
for metakey, value in list(metadata.items()):
144+
assert getattr(inputs.traits()[key], metakey) == value
145+
146+
147+
def test_Qwarp_outputs():
148+
output_map = dict(base_warp=dict(),
149+
source_warp=dict(),
150+
warped_base=dict(),
151+
warped_source=dict(),
152+
weights=dict(),
153+
)
154+
outputs = Qwarp.output_spec()
155+
156+
for key, metadata in list(output_map.items()):
157+
for metakey, value in list(metadata.items()):
158+
assert getattr(outputs.traits()[key], metakey) == value

nipype/interfaces/afni/tests/test_auto_Remlfit.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ def test_Remlfit_inputs():
88
),
99
addbase=dict(argstr='-addbase %s',
1010
copyfile=False,
11-
exists=True,
1211
sep=' ',
1312
),
1413
args=dict(argstr='%s',

0 commit comments

Comments
 (0)