Skip to content

ENH: Add 1dCat, 3dNwarpApply, and add options to 3dBrickStat #2114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions nipype/interfaces/afni/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
Seg, SkullStrip, TCorr1D, TCorrMap, TCorrelate,
TShift, Volreg, Warp, QwarpPlusMinus, Qwarp)
from .svm import (SVMTest, SVMTrain)
from .utils import (AFNItoNIFTI, Autobox,Axialize, BrickStat, Calc, Copy, Edge3,
Eval, FWHMx,
MaskTool, Merge, Notes, Refit, Resample, TCat, TStat, To3D,
Unifize, ZCutUp, GCOR,Zcat, Zeropad)
from .utils import (AFNItoNIFTI, Autobox, Axialize, BrickStat, Calc, Cat, Copy,
Edge3, Eval, FWHMx, MaskTool, Merge, Notes, NwarpApply,
Refit, Resample, TCat, TStat, To3D, Unifize, ZCutUp, GCOR,
Zcat, Zeropad)
from .model import (Deconvolve, Remlfit)
1 change: 0 additions & 1 deletion nipype/interfaces/afni/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,6 @@ class RemlfitInputSpec(AFNICommandInputSpec):
'option. Each column in the specified file(s) will be appended '
'to the matrix. File(s) must have at least as many rows as the '
'matrix does.',
exists=True,
copyfile=False,
sep=" ",
argstr='-addbase %s')
Expand Down
55 changes: 55 additions & 0 deletions nipype/interfaces/afni/tests/test_auto_Axialize.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..utils import Axialize


def test_Axialize_inputs():
input_map = dict(args=dict(argstr='%s',
),
axial=dict(argstr='-axial',
xor=['coronal', 'sagittal'],
),
coronal=dict(argstr='-coronal',
xor=['sagittal', 'axial'],
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
usedefault=True,
),
in_file=dict(argstr='%s',
copyfile=False,
mandatory=True,
position=-2,
),
orientation=dict(argstr='-orient %s',
),
out_file=dict(argstr='-prefix %s',
name_source='in_file',
name_template='%s_axialize',
),
outputtype=dict(),
sagittal=dict(argstr='-sagittal',
xor=['coronal', 'axial'],
),
terminal_output=dict(nohash=True,
),
verb=dict(argstr='-verb',
),
)
inputs = Axialize.input_spec()

for key, metadata in list(input_map.items()):
for metakey, value in list(metadata.items()):
assert getattr(inputs.traits()[key], metakey) == value


def test_Axialize_outputs():
output_map = dict(out_file=dict(),
)
outputs = Axialize.output_spec()

for key, metadata in list(output_map.items()):
for metakey, value in list(metadata.items()):
assert getattr(outputs.traits()[key], metakey) == value
12 changes: 12 additions & 0 deletions nipype/interfaces/afni/tests/test_auto_BrickStat.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,23 @@ def test_BrickStat_inputs():
mask=dict(argstr='-mask %s',
position=2,
),
max=dict(argstr='-max',
),
mean=dict(argstr='-mean',
),
min=dict(argstr='-min',
position=1,
),
percentile=dict(argstr='-percentile %.3f %.3f %.3f',
),
slow=dict(argstr='-slow',
),
sum=dict(argstr='-sum',
),
terminal_output=dict(nohash=True,
),
var=dict(argstr='-var',
),
)
inputs = BrickStat.input_spec()

Expand Down
66 changes: 66 additions & 0 deletions nipype/interfaces/afni/tests/test_auto_Cat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..utils import Cat


def test_Cat_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
usedefault=True,
),
in_files=dict(argstr='%s',
mandatory=True,
position=-2,
),
keepfree=dict(argstr='-nonfixed',
),
omitconst=dict(argstr='-nonconst',
),
out_cint=dict(xor=['out_format', 'out_nice', 'out_double', 'out_fint', 'out_int'],
),
out_double=dict(argstr='-d',
xor=['out_format', 'out_nice', 'out_int', 'out_fint', 'out_cint'],
),
out_file=dict(argstr='> %s',
mandatory=True,
position=-1,
),
out_fint=dict(argstr='-f',
xor=['out_format', 'out_nice', 'out_double', 'out_int', 'out_cint'],
),
out_format=dict(argstr='-form %s',
xor=['out_int', 'out_nice', 'out_double', 'out_fint', 'out_cint'],
),
out_int=dict(argstr='-i',
xor=['out_format', 'out_nice', 'out_double', 'out_fint', 'out_cint'],
),
out_nice=dict(argstr='-n',
xor=['out_format', 'out_int', 'out_double', 'out_fint', 'out_cint'],
),
outputtype=dict(),
sel=dict(argstr='-sel %s',
),
stack=dict(argstr='-stack',
),
terminal_output=dict(nohash=True,
),
)
inputs = Cat.input_spec()

for key, metadata in list(input_map.items()):
for metakey, value in list(metadata.items()):
assert getattr(inputs.traits()[key], metakey) == value


def test_Cat_outputs():
output_map = dict(out_file=dict(),
)
outputs = Cat.output_spec()

for key, metadata in list(output_map.items()):
for metakey, value in list(metadata.items()):
assert getattr(outputs.traits()[key], metakey) == value
58 changes: 58 additions & 0 deletions nipype/interfaces/afni/tests/test_auto_NwarpApply.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..utils import NwarpApply


def test_NwarpApply_inputs():
input_map = dict(ainterp=dict(argstr='-ainterp %s',
),
args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
usedefault=True,
),
in_file=dict(argstr='-source %s',
mandatory=True,
),
interp=dict(argstr='-interp %s',
),
inv_warp=dict(argstr='-iwarp',
),
master=dict(argstr='-master %s',
),
out_file=dict(argstr='-prefix %s',
name_source='in_file',
name_template='%s_Nwarp',
),
quiet=dict(argstr='-quiet',
xor=['verb'],
),
short=dict(argstr='-short',
),
terminal_output=dict(nohash=True,
),
verb=dict(argstr='-verb',
xor=['quiet'],
),
warp=dict(argstr='-nwarp %s',
mandatory=True,
),
)
inputs = NwarpApply.input_spec()

for key, metadata in list(input_map.items()):
for metakey, value in list(metadata.items()):
assert getattr(inputs.traits()[key], metakey) == value


def test_NwarpApply_outputs():
output_map = dict(out_file=dict(),
)
outputs = NwarpApply.output_spec()

for key, metadata in list(output_map.items()):
for metakey, value in list(metadata.items()):
assert getattr(outputs.traits()[key], metakey) == value
158 changes: 158 additions & 0 deletions nipype/interfaces/afni/tests/test_auto_Qwarp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..preprocess import Qwarp


def test_Qwarp_inputs():
input_map = dict(Qfinal=dict(argstr='-Qfinal',
),
Qonly=dict(argstr='-Qonly',
),
allsave=dict(argstr='-allsave',
xor=['nopadWARP', 'duplo', 'plusminus'],
),
args=dict(argstr='%s',
),
ballopt=dict(argstr='-ballopt',
xor=['workhard', 'boxopt'],
),
base_file=dict(argstr='-base %s',
copyfile=False,
mandatory=True,
),
baxopt=dict(argstr='-boxopt',
xor=['workhard', 'ballopt'],
),
blur=dict(argstr='-blur %s',
),
duplo=dict(argstr='-duplo',
xor=['gridlist', 'maxlev', 'inilev', 'iniwarp', 'plusminus', 'allsave'],
),
emask=dict(argstr='-emask %s',
copyfile=False,
),
environ=dict(nohash=True,
usedefault=True,
),
expad=dict(argstr='-expad %d',
xor=['nopadWARP'],
),
gridlist=dict(argstr='-gridlist %s',
copyfile=False,
xor=['duplo', 'plusminus'],
),
hel=dict(argstr='-hel',
xor=['nmi', 'mi', 'lpc', 'lpa', 'pear'],
),
ignore_exception=dict(nohash=True,
usedefault=True,
),
in_file=dict(argstr='-source %s',
copyfile=False,
mandatory=True,
),
inilev=dict(argstr='-inlev %d',
xor=['duplo'],
),
iniwarp=dict(argstr='-iniwarp %s',
xor=['duplo'],
),
iwarp=dict(argstr='-iwarp',
xor=['plusminus'],
),
lpa=dict(argstr='-lpa',
xor=['nmi', 'mi', 'lpc', 'hel', 'pear'],
),
lpc=dict(argstr='-lpc',
position=-2,
xor=['nmi', 'mi', 'hel', 'lpa', 'pear'],
),
maxlev=dict(argstr='-maxlev %d',
position=-1,
xor=['duplo'],
),
mi=dict(argstr='-mi',
xor=['mi', 'hel', 'lpc', 'lpa', 'pear'],
),
minpatch=dict(argstr='-minpatch %d',
),
nmi=dict(argstr='-nmi',
xor=['nmi', 'hel', 'lpc', 'lpa', 'pear'],
),
noXdis=dict(argstr='-noXdis',
),
noYdis=dict(argstr='-noYdis',
),
noZdis=dict(argstr='-noZdis',
),
noneg=dict(argstr='-noneg',
),
nopad=dict(argstr='-nopad',
),
nopadWARP=dict(argstr='-nopadWARP',
xor=['allsave', 'expad'],
),
nopenalty=dict(argstr='-nopenalty',
),
nowarp=dict(argstr='-nowarp',
),
noweight=dict(argstr='-noweight',
),
out_file=dict(argstr='-prefix %s',
genfile=True,
name_source=['in_file'],
name_template='%s_QW',
),
out_weight_file=dict(argstr='-wtprefix %s',
),
outputtype=dict(),
overwrite=dict(argstr='-overwrite',
),
pblur=dict(argstr='-pblur %s',
),
pear=dict(argstr='-pear',
),
penfac=dict(argstr='-penfac %f',
),
plusminus=dict(argstr='-plusminus',
xor=['duplo', 'allsave', 'iwarp'],
),
quiet=dict(argstr='-quiet',
xor=['verb'],
),
resample=dict(argstr='-resample',
),
terminal_output=dict(nohash=True,
),
verb=dict(argstr='-verb',
xor=['quiet'],
),
wball=dict(argstr='-wball %s',
),
weight=dict(argstr='-weight %s',
),
wmask=dict(argstr='-wpass %s %f',
),
workhard=dict(argstr='-workhard',
xor=['boxopt', 'ballopt'],
),
)
inputs = Qwarp.input_spec()

for key, metadata in list(input_map.items()):
for metakey, value in list(metadata.items()):
assert getattr(inputs.traits()[key], metakey) == value


def test_Qwarp_outputs():
output_map = dict(base_warp=dict(),
source_warp=dict(),
warped_base=dict(),
warped_source=dict(),
weights=dict(),
)
outputs = Qwarp.output_spec()

for key, metadata in list(output_map.items()):
for metakey, value in list(metadata.items()):
assert getattr(outputs.traits()[key], metakey) == value
1 change: 0 additions & 1 deletion nipype/interfaces/afni/tests/test_auto_Remlfit.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ def test_Remlfit_inputs():
),
addbase=dict(argstr='-addbase %s',
copyfile=False,
exists=True,
sep=' ',
),
args=dict(argstr='%s',
Expand Down
Loading