Skip to content

Commit 766b30a

Browse files
committed
Introduced a wrapper for 3dTcorr1D.
1 parent ba79cb3 commit 766b30a

File tree

1 file changed

+40
-5
lines changed

1 file changed

+40
-5
lines changed

nipype/interfaces/afni/preprocess.py

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -560,9 +560,9 @@ class VolregInputSpec(AFNICommandInputSpec):
560560
' by \'n\' voxels during rotations',
561561
argstr='-zpad %d',
562562
position=-5)
563-
md1dfile = File(desc='max displacement output file',
564-
argstr='-maxdisp1D %s',
565-
position=-4)
563+
md1d_file = File(name_template='%s_md.1D', desc='max displacement output file',
564+
argstr='-maxdisp1D %s', name_source="in_file",
565+
keep_extension=True, position=-4)
566566
oned_file = File(name_template='%s.1D', desc='1D movement parameters output file',
567567
argstr='-1Dfile %s',
568568
name_source="in_file",
@@ -597,7 +597,7 @@ class Volreg(AFNICommand):
597597
>>> volreg.inputs.zpad = 4
598598
>>> volreg.inputs.outputtype = "NIFTI"
599599
>>> volreg.cmdline #doctest: +ELLIPSIS
600-
'3dvolreg -Fourier -twopass -1Dfile functional.1D -prefix functional_volreg.nii -zpad 4 functional.nii'
600+
'3dvolreg -Fourier -twopass -1Dfile functional.1D -prefix functional_volreg.nii -zpad 4 -maxdisp1D functional_md.1D functional.nii'
601601
>>> res = volreg.run() # doctest: +SKIP
602602
603603
"""
@@ -1309,6 +1309,42 @@ class TCorrelate(AFNICommand):
13091309
output_spec = AFNICommandOutputSpec
13101310

13111311

1312+
class TCorr1DInputSpec(AFNICommandInputSpec):
1313+
xset = File(desc = 'xset to 3dTcorr1D',
1314+
argstr = ' %s',
1315+
position = -2,
1316+
mandatory = True,
1317+
exists = True)
1318+
y_1d = File(desc = 'y1D from 3dTcorr1D',
1319+
argstr = ' %s',
1320+
position = -1,
1321+
mandatory = True,
1322+
exists = True)
1323+
out_file = File(desc = 'output file from 3dTcorr1D',
1324+
argstr = '-prefix %s',
1325+
genfile = True)
1326+
options = traits.Str(desc = 'select options',
1327+
argstr = ' %s')
1328+
suffix = traits.Str(desc="out_file suffix")
1329+
1330+
1331+
class TCorr1DOutputSpec(AFNICommandOutputSpec):
1332+
out_file = File(desc = 'output file containing correlations',
1333+
exists = True)
1334+
1335+
1336+
class TCorr1D(AFNICommand):
1337+
"""Computes the correlation coefficient between each voxel time series
1338+
in the input 3D+time dataset.
1339+
For complete details, see the `3dTcorr1D Documentation.
1340+
<http://afni.nimh.nih.gov/pub/dist/doc/program_help/3dTcorr1D.html>`_
1341+
"""
1342+
1343+
_cmd = '3dTcorr1D'
1344+
input_spec = TCorr1DInputSpec
1345+
output_spec = TCorr1DOutputSpec
1346+
1347+
13121348
class BrickStatInputSpec(AFNICommandInputSpec):
13131349
in_file = File(desc='input file to 3dmaskave',
13141350
argstr='%s',
@@ -1861,4 +1897,3 @@ def _overload_extension(self, value):
18611897

18621898
def _gen_filename(self, name):
18631899
return os.path.abspath(super(AFNItoNIFTI, self)._gen_filename(name))
1864-

0 commit comments

Comments
 (0)