Skip to content

ENH+FIX: Add 3dTproject AFNI interface, Fix OneDToolPy, Add -noFDR flag to 3dDeconvolve #2426

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 11 commits into from
Feb 13, 2018
4 changes: 1 addition & 3 deletions nipype/interfaces/afni/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class DeconvolveInputSpec(AFNICommandInputSpec):
'instead of the bucket dataset, if possible.',
argstr='-cbucket %s')
out_file = File(desc='output statistics file', argstr='-bucket %s')
jobs = traits.Int(
num_threads = traits.Int(
desc='run the program with provided number of sub-processes',
argstr='-jobs %d')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to set this to nohash=True, unless there's reason to think the number of threads affects the output.

fout = traits.Bool(
Expand Down Expand Up @@ -278,8 +278,6 @@ def _parse_inputs(self, skip=None):
self.inputs.num_glt = len(self.inputs.gltsym)
if not isdefined(self.inputs.out_file):
self.inputs.out_file = 'Decon.nii'
if isdefined(self.inputs.jobs):
self.inputs.num_threads = self.inputs.jobs

return super(Deconvolve, self)._parse_inputs(skip)

Expand Down
15 changes: 8 additions & 7 deletions nipype/interfaces/afni/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -2425,7 +2425,8 @@ class TProjectInputSpec(AFNICommandInputSpec):
* This is a file of 1s and 0s, indicating which
time points are to be included (1) and which are
to be excluded (0).""",
argstr="-censor %s")
argstr="-censor %s",
exists=True)
censortr = traits.List(
traits.Str(),
desc="""list of strings that specify time indexes
Expand Down Expand Up @@ -2489,7 +2490,7 @@ class TProjectInputSpec(AFNICommandInputSpec):
ort = File(
desc="""Remove each column in file
++ Each column will have its mean removed.""",
exist=True,
exists=True,
argstr="-ort %s")
polort = traits.Int(
desc="""Remove polynomials up to and including degree pp.
Expand All @@ -2505,15 +2506,15 @@ class TProjectInputSpec(AFNICommandInputSpec):
bandpass = traits.Tuple(
traits.Float, traits.Float,
desc="""Remove all frequencies EXCEPT those in the range""",
argstr='-bandpass %f %f')
argstr='-bandpass %g %g')
stopband = traits.Tuple(
traits.Float, traits.Float,
desc="""Remove all frequencies in the range""",
argstr='-stopband %f %f')
argstr='-stopband %g %g')
TR = traits.Float(
desc="""Use time step dd for the frequency calculations,
rather than the value stored in the dataset header.""",
argstr='-TR %f')
argstr='-TR %g')
mask = File(
exist=True,
desc="""Only operate on voxels nonzero in the mset dataset.
Expand All @@ -2530,7 +2531,7 @@ class TProjectInputSpec(AFNICommandInputSpec):
width (FWHM) of fff millimeters.
++ Spatial blurring (if done) is after the time
series filtering.""",
argstr='-blur %f')
argstr='-blur %g')
norm = traits.Bool(
desc="""Normalize each output time series to have sum of
squares = 1. This is the LAST operation.""",
Expand Down Expand Up @@ -2562,7 +2563,7 @@ class TProject(AFNICommand):
>>> tproject.inputs.automask = True
>>> tproject.inputs.out_file = 'projected.nii.gz'
>>> tproject.cmdline
'3dTproject -input functional.nii -automask -bandpass 0.006670 99999.000000 -polort 3 -prefix projected.nii.gz'
'3dTproject -input functional.nii -automask -bandpass 0.00667 99999 -polort 3 -prefix projected.nii.gz'
>>> res = tproject.run() # doctest: +SKIP

"""
Expand Down
6 changes: 1 addition & 5 deletions nipype/interfaces/afni/tests/test_auto_Deconvolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ def test_Deconvolve_inputs():
sep=' ',
),
input1D=dict(argstr='-input1D %s', ),
jobs=dict(argstr='-jobs %d', ),
legendre=dict(argstr='-legendre', ),
local_times=dict(
argstr='-local_times',
Expand All @@ -70,10 +69,7 @@ def test_Deconvolve_inputs():
argstr='-num_stimts %d',
position=-6,
),
num_threads=dict(
nohash=True,
usedefault=True,
),
num_threads=dict(argstr='-jobs %d', ),
ortvec=dict(argstr='-ortvec %s %s', ),
out_file=dict(argstr='-bucket %s', ),
outputtype=dict(),
Expand Down
13 changes: 5 additions & 8 deletions nipype/interfaces/afni/tests/test_auto_TProject.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

def test_TProject_inputs():
input_map = dict(
TR=dict(argstr='-TR %f', ),
TR=dict(argstr='-TR %g', ),
args=dict(argstr='%s', ),
automask=dict(
argstr='-automask',
xor=['mask'],
),
bandpass=dict(argstr='-bandpass %f %f', ),
blur=dict(argstr='-blur %f', ),
bandpass=dict(argstr='-bandpass %g %g', ),
blur=dict(argstr='-blur %g', ),
cenmode=dict(argstr='-cenmode %s', ),
censor=dict(argstr='-censor %s', ),
censortr=dict(argstr='-CENSORTR %s', ),
Expand Down Expand Up @@ -42,10 +42,7 @@ def test_TProject_inputs():
nohash=True,
usedefault=True,
),
ort=dict(
argstr='-ort %s',
exist=True,
),
ort=dict(argstr='-ort %s', ),
out_file=dict(
argstr='-prefix %s',
name_source='in_file',
Expand All @@ -54,7 +51,7 @@ def test_TProject_inputs():
),
outputtype=dict(),
polort=dict(argstr='-polort %d', ),
stopband=dict(argstr='-stopband %f %f', ),
stopband=dict(argstr='-stopband %g %g', ),
terminal_output=dict(
deprecated='1.0.0',
nohash=True,
Expand Down