From a13f325c2734e215a1a62d64bbda9afcd5a62fe3 Mon Sep 17 00:00:00 2001 From: Ross Markello Date: Thu, 22 Jun 2017 17:06:36 -0400 Subject: [PATCH] Deconvolve InputSpec first pass Took a first whack at the 3dDeconvolve input spec. Just implemented 'base case' arguments--will get to other optional things later. --- nipype/interfaces/afni/model.py | 130 +++++++++++++++++++++++++++++++- 1 file changed, 129 insertions(+), 1 deletion(-) diff --git a/nipype/interfaces/afni/model.py b/nipype/interfaces/afni/model.py index 9e9703b877..284eee12ef 100644 --- a/nipype/interfaces/afni/model.py +++ b/nipype/interfaces/afni/model.py @@ -30,11 +30,138 @@ AFNICommandBase, AFNICommand, AFNICommandInputSpec, AFNICommandOutputSpec) class DeconvolveInputSpec(AFNICommandInputSpec): - pass + in_files = InputMultiPath( + File( + exists=True), + desc='fname = filename of 3D+time input dataset ' + ' [more than one filename can be given] ' + ' here, and these datasets will be] ' + ' [auto-catenated in time; if you do this,] ' + ' [\'-concat\' is not needed and is ignored.] ' + '** You can input a 1D time series file here, ' + ' but the time axis should run along the ' + ' ROW direction, not the COLUMN direction as ' + ' in the -input1D option. You can automatically ' + ' transpose a 1D file on input using the \\\' ' + ' operator at the end of the filename, as in ' + ' -input fred.1D\\\' ' + ' * This is the only way to use 3dDeconvolve ' + ' with a multi-column 1D time series file.', + argstr='-input %s', + mandatory=True, + copyfile=False) + mask = File( + desc='filename of 3D mask dataset; ' + 'Only data time series from within the mask ' + 'will be analyzed; results for voxels outside ' + 'the mask will be set to zero.', + argstr='-mask %s', + exists=True) + automask = traits.Bool( + usedefault=True, + argstr='-automask', + desc='Build a mask automatically from input data ' + '(will be slow for long time series datasets)') + censor = File( + desc=' cname = 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). ' + '* Option \'-censor\' can only be used once!', + argstr='-censor %s', + exists=True) + polort = traits.Int( + desc='pnum = degree of polynomial corresponding to the ' + ' null hypothesis [default: pnum = 1]', + argstr='-polort %d') + ortvec = traits.Tuple( + File( + desc='filename', + exists=True), + Str( + desc='label'), + desc='This option lets you input a rectangular array ' + 'of 1 or more baseline vectors from file \'fff\', ' + 'which will get the label \'lll\'. Functionally, ' + 'it is the same as using \'-stim_file\' on each ' + 'column of \'fff\' separately (plus \'-stim_base\'). ' + 'This method is just a faster and simpler way to ' + 'include a lot of baseline regressors in one step. ', + argstr='ortvec %s') + x1d = File( + desc='save out X matrix', + argstr='-x1D %s') + x1d_stop = traits.Bool( + desc='stop running after writing .xmat.1D file', + argstr='-x1D_stop') + bucket = File( + desc='output statistics file', + argstr='-bucket %s') + jobs = traits.Int( + desc='run the program with given number of sub-processes', + argstr='-jobs %d') + stim_times_subtract = traits.Float( + desc='This option means to subtract \'SS\' seconds from each time ' + 'encountered in any \'-stim_times*\' option. The purpose of this ' + 'option is to make it simple to adjust timing files for the ' + 'removal of images from the start of each imaging run.', + argstr='-stim_times_subtract %f') + num_stimts = traits.Int( + desc='number of stimulus timing files', + argstr='-num_stimts %d') + num_glt = traits.Int( + desc='number of general linear tests (i.e., contrasts)', + argstr='-num_glt %d') + global_times = traits.Bool( + desc='use global timing for stimulus timing files', + argstr='-global_times', + xor=['local_times']) + local_times = traits.Bool( + desc='use local timing for stimulus timing files', + argstr='-local_times', + xor=['global_times']) + fout = traits.Bool( + desc='output F-statistic for each stimulus', + argstr='-fout') + rout = traits.Bool( + desc='output the R^2 statistic for each stimulus', + argstr='-rout') + tout = traits.Bool( + desc='output the T-statistic for each stimulus', + argstr='-tout') + vout = traits.Bool( + desc='output the sample variance (MSE) for each stimulus', + argstr='-vout') + stim_times = traits.List( + traits.Tuple(traits.Int(desc='k-th response model'), + File(desc='stimulus timing file',exists=True), + Str(desc='model')), + desc='Generate the k-th response model from a set of stimulus times' + ' given in file \'tname\'.', + argstr='-stim_times %d %s %s') + stim_label = traits.List( + traits.Tuple(traits.Int(desc='k-th input stimulus'), + Str(desc='stimulus label')), + desc='label for kth input stimulus', + argstr='-stim_label %d %s', + requires=['stim_times']) + gltsym = traits.List( + Str(desc='symbolic general linear test'), + desc='general linear tests (i.e., contrasts) using symbolic ' + 'conventions', + argstr='-gltsym %s') + glt_labels = traits.List( + traits.Tuple(traits.Int(desc='k-th general linear test'), + Str(desc='GLT label')), + desc='general linear test (i.e., contrast) labels', + argstr='-glt_label %d %s', + requires=['glt_sym']) + class DeconvolveOutputSpec(TraitedSpec): pass + class Deconvolve(AFNICommand): """Performs OLS regression given a 4D neuroimage file and stimulus timings @@ -47,3 +174,4 @@ class Deconvolve(AFNICommand): >>> from nipype.interfaces import afni >>> deconvolve = afni.Deconvolve() """ + pass