From 908e326b4d6c1ae29c57c40c24f9b86b2d727689 Mon Sep 17 00:00:00 2001 From: Matteo Visconti dOC Date: Fri, 2 Feb 2018 16:27:31 -0500 Subject: [PATCH 01/10] ENH: add interface for AFNI 3dTproject --- nipype/interfaces/afni/__init__.py | 2 +- nipype/interfaces/afni/preprocess.py | 164 ++++++++++++++++++ .../afni/tests/test_auto_TProject.py | 74 ++++++++ 3 files changed, 239 insertions(+), 1 deletion(-) create mode 100644 nipype/interfaces/afni/tests/test_auto_TProject.py diff --git a/nipype/interfaces/afni/__init__.py b/nipype/interfaces/afni/__init__.py index 9cb519a2a2..b28e5961f7 100644 --- a/nipype/interfaces/afni/__init__.py +++ b/nipype/interfaces/afni/__init__.py @@ -13,7 +13,7 @@ BlurInMask, BlurToFWHM, ClipLevel, DegreeCentrality, Despike, Detrend, ECM, Fim, Fourier, Hist, LFCD, Maskave, Means, OutlierCount, QualityIndex, ROIStats, Retroicor, Seg, SkullStrip, TCorr1D, TCorrMap, TCorrelate, TNorm, - TShift, Volreg, Warp, QwarpPlusMinus, Qwarp) + TProject, TShift, Volreg, Warp, QwarpPlusMinus, Qwarp) from .svm import (SVMTest, SVMTrain) from .utils import ( ABoverlap, AFNItoNIFTI, Autobox, Axialize, BrickStat, Bucket, Calc, Cat, diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index f8bb57e06d..ee8740619a 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -2406,6 +2406,170 @@ class TNorm(AFNICommand): output_spec = AFNICommandOutputSpec +class TProjectInputSpec(AFNICommandInputSpec): + in_file = File( + desc='input file to 3dTproject', + argstr='%s', + position=1, + mandatory=True, + exists=True, + copyfile=False) + out_file = File( + name_template='%s_tproject', + desc='output image file name', + position=-1, + argstr='-prefix %s', + name_source='in_file') + censor = File( + desc="""filename of censor .1D time series + * 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") + censortr = traits.List( + traits.Str(), + desc="""list of strings that specify time indexes + to be removed from the analysis. Each string is + of one of the following forms: + 37 => remove global time index #37 + 2:37 => remove time index #37 in run #2 + 37..47 => remove global time indexes #37-47 + 37-47 => same as above + 2:37..47 => remove time indexes #37-47 in run #2 + *:0-2 => remove time indexes #0-2 in all runs + +Time indexes within each run start at 0. + +Run indexes start at 1 (just be to confusing). + +N.B.: 2:37,47 means index #37 in run #2 and + global time index 47; it does NOT mean + index #37 in run #2 AND index #47 in run #2.""", + argstr="-CENSORTR %s") + cenmode = traits.Enum( + 'KILL', 'ZERO', 'NTRP', + desc="""specifies how censored time points are treated in + the output dataset: + + mode = ZERO ==> put zero values in their place + ==> output datset is same length as input + + mode = KILL ==> remove those time points + ==> output dataset is shorter than input + + mode = NTRP ==> censored values are replaced by interpolated + neighboring (in time) non-censored values, + BEFORE any projections, and then the + analysis proceeds without actual removal + of any time points -- this feature is to + keep the Spanish Inquisition happy. + * The default mode is KILL !!!""", + argstr='-cenmode %s') + concat = File( + desc="""The catenation file, as in 3dDeconvolve, containing the + TR indexes of the start points for each contiguous run + within the input dataset (the first entry should be 0). + ++ Also as in 3dDeconvolve, if the input dataset is + automatically catenated from a collection of datasets, + then the run start indexes are determined directly, + and '-concat' is not needed (and will be ignored). + ++ Each run must have at least 9 time points AFTER + censoring, or the program will not work! + ++ The only use made of this input is in setting up + the bandpass/stopband regressors. + ++ '-ort' and '-dsort' regressors run through all time + points, as read in. If you want separate projections + in each run, then you must either break these ort files + into appropriate components, OR you must run 3dTproject + for each run separately, using the appropriate pieces + from the ort files via the '{...}' selector for the + 1D files and the '[...]' selector for the datasets.""", + exists=True, + argstr='-concat %s') + noblock = traits.Bool( + desc="""Also as in 3dDeconvolve, if you want the program to treat + an auto-catenated dataset as one long run, use this option. + ++ However, '-noblock' will not affect catenation if you use + the '-concat' option.""", + argstr='-noblock') + ort = File( + desc="""Remove each column in file + ++ Each column will have its mean removed.""", + exist=True, + argstr="-ort %s") + polort = traits.Int( + desc="""Remove polynomials up to and including degree pp. + ++ Default value is 2. + ++ It makes no sense to use a value of pp greater than + 2, if you are bandpassing out the lower frequencies! + ++ For catenated datasets, each run gets a separate set + set of pp+1 Legendre polynomial regressors. + ++ Use of -polort -1 is not advised (if data mean != 0), + even if -ort contains constant terms, as all means are + removed.""", + argstr="-polort %d") + bandpass = traits.Tuple( + traits.Float, traits.Float, + desc="""Remove all frequencies EXCEPT those in the range""", + argstr='-bandpass %f %f') + stopband = traits.Tuple( + traits.Float, traits.Float, + desc="""Remove all frequencies in the range""", + argstr='-stopband %f %f') + TR = traits.Float( + desc="""Use time step dd for the frequency calculations, + rather than the value stored in the dataset header.""", + argstr='-TR %f') + mask = File( + exist=True, + desc="""Only operate on voxels nonzero in the mset dataset. + ++ Voxels outside the mask will be filled with zeros. + ++ If no masking option is given, then all voxels + will be processed.""", + argstr='-mask %s') + automask = traits.Bool( + desc="""Generate a mask automatically""", + xor=['mask'], + argstr='-automask') + blur = traits.Float( + desc="""Blur (inside the mask only) with a filter that has + width (FWHM) of fff millimeters. + ++ Spatial blurring (if done) is after the time + series filtering.""", + argstr='-blur %f') + norm = traits.Bool( + desc="""Normalize each output time series to have sum of + squares = 1. This is the LAST operation.""", + argstr='-norm') + + +class TProject(AFNICommand): + """ + This program projects (detrends) out various 'nuisance' time series from + each voxel in the input dataset. Note that all the projections are done + via linear regression, including the frequency-based options such + as '-passband'. In this way, you can bandpass time-censored data, and at + the same time, remove other time series of no interest + (e.g., physiological estimates, motion parameters). + Shifts voxel time series from input so that seperate slices are aligned to + the same temporal origin. + + For complete details, see the `3dTproject Documentation. + `_ + + Examples + ======== + + >>> from nipype.interfaces import afni + >>> tproject = afni.TProject() + >>> tproject.inputs.in_file = 'functional.nii' + >>> tproject.inputs.bandpass = (0.00667, 99999) + >>> tproject.inputs.polort = 3 + >>> tproject.inputs.automask = True + >>> tproject.inputs.out_file = 'projected.nii.gz' + >>> tproject.cmdline + '3dTproject functional.nii -automask -bandpass 0.006670 99999.000000 -polort 3 -prefix projected.nii.gz' + >>> res = tproject.run() # doctest: +SKIP + + """ + _cmd = '3dTproject' + input_spec = TProjectInputSpec + output_spec = AFNICommandOutputSpec + class TShiftInputSpec(AFNICommandInputSpec): in_file = File( desc='input file to 3dTShift', diff --git a/nipype/interfaces/afni/tests/test_auto_TProject.py b/nipype/interfaces/afni/tests/test_auto_TProject.py new file mode 100644 index 0000000000..6736e5e8e3 --- /dev/null +++ b/nipype/interfaces/afni/tests/test_auto_TProject.py @@ -0,0 +1,74 @@ +# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT +from __future__ import unicode_literals +from ..preprocess import TProject + + +def test_TProject_inputs(): + input_map = dict( + TR=dict(argstr='-TR %f', ), + args=dict(argstr='%s', ), + automask=dict( + argstr='-automask', + xor=['mask'], + ), + bandpass=dict(argstr='-bandpass %f %f', ), + blur=dict(argstr='-blur %f', ), + cenmode=dict(argstr='-cenmode %s', ), + censor=dict(argstr='-censor %s', ), + censortr=dict(argstr='-CENSORTR %s', ), + concat=dict(argstr='-concat %s', ), + environ=dict( + nohash=True, + usedefault=True, + ), + ignore_exception=dict( + deprecated='1.0.0', + nohash=True, + usedefault=True, + ), + in_file=dict( + argstr='%s', + copyfile=False, + mandatory=True, + position=1, + ), + mask=dict( + argstr='-mask %s', + exist=True, + ), + noblock=dict(argstr='-noblock', ), + norm=dict(argstr='-norm', ), + num_threads=dict( + nohash=True, + usedefault=True, + ), + ort=dict( + argstr='-ort %s', + exist=True, + ), + out_file=dict( + argstr='-prefix %s', + name_source='in_file', + name_template='%s_tproject', + position=-1, + ), + outputtype=dict(), + polort=dict(argstr='-polort %d', ), + stopband=dict(argstr='-stopband %f %f', ), + terminal_output=dict( + deprecated='1.0.0', + nohash=True, + ), + ) + inputs = TProject.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_TProject_outputs(): + output_map = dict(out_file=dict(), ) + outputs = TProject.output_spec() + + for key, metadata in list(output_map.items()): + for metakey, value in list(metadata.items()): + assert getattr(outputs.traits()[key], metakey) == value From 49af6237542817a9472c312a6abd7252ae0581f6 Mon Sep 17 00:00:00 2001 From: Matteo Visconti dOC Date: Sat, 3 Feb 2018 09:25:49 -0500 Subject: [PATCH 02/10] Fix input argstr --- nipype/interfaces/afni/preprocess.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index ee8740619a..6dc04bc5a0 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -2409,7 +2409,7 @@ class TNorm(AFNICommand): class TProjectInputSpec(AFNICommandInputSpec): in_file = File( desc='input file to 3dTproject', - argstr='%s', + argstr='-input %s', position=1, mandatory=True, exists=True, From 75b66bae7453142534d3d814524818ce9e8f2266 Mon Sep 17 00:00:00 2001 From: Matteo Visconti dOC Date: Sat, 3 Feb 2018 12:01:46 -0500 Subject: [PATCH 03/10] FIX: fix out_file when censor_motion is passed in OneDToolPy --- nipype/interfaces/afni/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nipype/interfaces/afni/utils.py b/nipype/interfaces/afni/utils.py index 188ba158c0..3691cb561f 100644 --- a/nipype/interfaces/afni/utils.py +++ b/nipype/interfaces/afni/utils.py @@ -1815,7 +1815,7 @@ def _list_outputs(self): os.getcwd(), self.inputs.show_cormat_warnings) if isdefined(self.inputs.censor_motion): outputs['out_file'] = os.path.join(os.getcwd(), - self.inputs.censor_motion[1]) + self.inputs.censor_motion[1] + '_censor.1D') return outputs From fd1037ee1d92bf0db5faffe367bace6daaae9548 Mon Sep 17 00:00:00 2001 From: Matteo Visconti dOC Date: Sat, 3 Feb 2018 12:05:55 -0500 Subject: [PATCH 04/10] Add auto test for TProject, pepify out_file for OneDTool --- nipype/interfaces/afni/tests/test_auto_TProject.py | 2 +- nipype/interfaces/afni/utils.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/nipype/interfaces/afni/tests/test_auto_TProject.py b/nipype/interfaces/afni/tests/test_auto_TProject.py index 6736e5e8e3..2fec4896d5 100644 --- a/nipype/interfaces/afni/tests/test_auto_TProject.py +++ b/nipype/interfaces/afni/tests/test_auto_TProject.py @@ -27,7 +27,7 @@ def test_TProject_inputs(): usedefault=True, ), in_file=dict( - argstr='%s', + argstr='-input %s', copyfile=False, mandatory=True, position=1, diff --git a/nipype/interfaces/afni/utils.py b/nipype/interfaces/afni/utils.py index 3691cb561f..05910c06b3 100644 --- a/nipype/interfaces/afni/utils.py +++ b/nipype/interfaces/afni/utils.py @@ -1815,7 +1815,8 @@ def _list_outputs(self): os.getcwd(), self.inputs.show_cormat_warnings) if isdefined(self.inputs.censor_motion): outputs['out_file'] = os.path.join(os.getcwd(), - self.inputs.censor_motion[1] + '_censor.1D') + self.inputs.censor_motion[1] + + '_censor.1D') return outputs From d3a75264f3b3254e7a8cb8c518d428c6f0d360d8 Mon Sep 17 00:00:00 2001 From: Matteo Visconti dOC Date: Sat, 3 Feb 2018 13:56:05 -0500 Subject: [PATCH 05/10] Fix doctest --- nipype/interfaces/afni/preprocess.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index 6dc04bc5a0..cb92950e7d 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -2562,7 +2562,7 @@ class TProject(AFNICommand): >>> tproject.inputs.automask = True >>> tproject.inputs.out_file = 'projected.nii.gz' >>> tproject.cmdline - '3dTproject functional.nii -automask -bandpass 0.006670 99999.000000 -polort 3 -prefix projected.nii.gz' + '3dTproject -input functional.nii -automask -bandpass 0.006670 99999.000000 -polort 3 -prefix projected.nii.gz' >>> res = tproject.run() # doctest: +SKIP """ From d4658cf08b7216d2248185c2f4a533105573ea2c Mon Sep 17 00:00:00 2001 From: Matteo Visconti dOC Date: Mon, 5 Feb 2018 19:01:06 -0500 Subject: [PATCH 06/10] ENH: add -noFDR option to 3dDeconvolve --- nipype/interfaces/afni/model.py | 4 ++++ nipype/interfaces/afni/tests/test_auto_Deconvolve.py | 1 + 2 files changed, 5 insertions(+) diff --git a/nipype/interfaces/afni/model.py b/nipype/interfaces/afni/model.py index 903d323b4e..f933b6c53d 100644 --- a/nipype/interfaces/afni/model.py +++ b/nipype/interfaces/afni/model.py @@ -165,6 +165,10 @@ class DeconvolveInputSpec(AFNICommandInputSpec): vout = traits.Bool( desc='output the sample variance (MSE) for each stimulus', argstr='-vout') + nofdr = traits.Bool( + desc="Don't compute the statistic-vs-FDR curves for the bucket " + "dataset.", + argstr='-noFDR') global_times = traits.Bool( desc='use global timing for stimulus timing files', argstr='-global_times', diff --git a/nipype/interfaces/afni/tests/test_auto_Deconvolve.py b/nipype/interfaces/afni/tests/test_auto_Deconvolve.py index e456f97818..bf5b0cddd7 100644 --- a/nipype/interfaces/afni/tests/test_auto_Deconvolve.py +++ b/nipype/interfaces/afni/tests/test_auto_Deconvolve.py @@ -59,6 +59,7 @@ def test_Deconvolve_inputs(): noblock=dict(argstr='-noblock', ), nocond=dict(argstr='-nocond', ), nodmbase=dict(argstr='-nodmbase', ), + nofdr=dict(argstr='-noFDR', ), nolegendre=dict(argstr='-nolegendre', ), nosvd=dict(argstr='-nosvd', ), num_glt=dict( From d40a627ab43f9feb29e33d708aba4d077d1fad5a Mon Sep 17 00:00:00 2001 From: Matteo Visconti dOC Date: Tue, 6 Feb 2018 16:57:00 -0500 Subject: [PATCH 07/10] ENH: set correct number of jobs/threads for 3dDeconvolve --- nipype/interfaces/afni/model.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nipype/interfaces/afni/model.py b/nipype/interfaces/afni/model.py index f933b6c53d..c3f6b64737 100644 --- a/nipype/interfaces/afni/model.py +++ b/nipype/interfaces/afni/model.py @@ -278,6 +278,8 @@ 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) From 9d96f4e7917e11c5d25ed745d2cce8211e487633 Mon Sep 17 00:00:00 2001 From: Matteo Visconti dOC Date: Wed, 7 Feb 2018 14:03:57 -0500 Subject: [PATCH 08/10] REF: jobs -> num_threads in 3dDeconvolve for consistency --- nipype/interfaces/afni/model.py | 4 +--- nipype/interfaces/afni/tests/test_auto_Deconvolve.py | 6 +----- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/nipype/interfaces/afni/model.py b/nipype/interfaces/afni/model.py index c3f6b64737..6fbe749b9a 100644 --- a/nipype/interfaces/afni/model.py +++ b/nipype/interfaces/afni/model.py @@ -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') fout = traits.Bool( @@ -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) diff --git a/nipype/interfaces/afni/tests/test_auto_Deconvolve.py b/nipype/interfaces/afni/tests/test_auto_Deconvolve.py index bf5b0cddd7..b2455f76f3 100644 --- a/nipype/interfaces/afni/tests/test_auto_Deconvolve.py +++ b/nipype/interfaces/afni/tests/test_auto_Deconvolve.py @@ -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', @@ -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(), From b7ea93310cd4f2f8f8a7fdf4d13aadf452f72f3a Mon Sep 17 00:00:00 2001 From: Matteo Visconti dOC Date: Wed, 7 Feb 2018 14:15:43 -0500 Subject: [PATCH 09/10] Fixes to 3dTProject args --- nipype/interfaces/afni/preprocess.py | 15 ++++++++------- .../interfaces/afni/tests/test_auto_TProject.py | 13 +++++-------- 2 files changed, 13 insertions(+), 15 deletions(-) diff --git a/nipype/interfaces/afni/preprocess.py b/nipype/interfaces/afni/preprocess.py index cb92950e7d..560daa231c 100644 --- a/nipype/interfaces/afni/preprocess.py +++ b/nipype/interfaces/afni/preprocess.py @@ -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 @@ -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. @@ -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. @@ -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.""", @@ -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 """ diff --git a/nipype/interfaces/afni/tests/test_auto_TProject.py b/nipype/interfaces/afni/tests/test_auto_TProject.py index 2fec4896d5..25a47142b9 100644 --- a/nipype/interfaces/afni/tests/test_auto_TProject.py +++ b/nipype/interfaces/afni/tests/test_auto_TProject.py @@ -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', ), @@ -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', @@ -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, From ae7dc34ebb065a369be9fba2aeaed28d92c4c22c Mon Sep 17 00:00:00 2001 From: Matteo Visconti dOC Date: Wed, 7 Feb 2018 15:07:12 -0500 Subject: [PATCH 10/10] Set nohash for num_threads in 3dDeconvolve --- nipype/interfaces/afni/model.py | 3 ++- nipype/interfaces/afni/tests/test_auto_Deconvolve.py | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/nipype/interfaces/afni/model.py b/nipype/interfaces/afni/model.py index 6fbe749b9a..38ddf09520 100644 --- a/nipype/interfaces/afni/model.py +++ b/nipype/interfaces/afni/model.py @@ -155,7 +155,8 @@ class DeconvolveInputSpec(AFNICommandInputSpec): out_file = File(desc='output statistics file', argstr='-bucket %s') num_threads = traits.Int( desc='run the program with provided number of sub-processes', - argstr='-jobs %d') + argstr='-jobs %d', + nohash=True) fout = traits.Bool( desc='output F-statistic for each stimulus', argstr='-fout') rout = traits.Bool( diff --git a/nipype/interfaces/afni/tests/test_auto_Deconvolve.py b/nipype/interfaces/afni/tests/test_auto_Deconvolve.py index b2455f76f3..86f1fee093 100644 --- a/nipype/interfaces/afni/tests/test_auto_Deconvolve.py +++ b/nipype/interfaces/afni/tests/test_auto_Deconvolve.py @@ -69,7 +69,10 @@ def test_Deconvolve_inputs(): argstr='-num_stimts %d', position=-6, ), - num_threads=dict(argstr='-jobs %d', ), + num_threads=dict( + argstr='-jobs %d', + nohash=True, + ), ortvec=dict(argstr='-ortvec %s %s', ), out_file=dict(argstr='-bucket %s', ), outputtype=dict(),