Skip to content

Commit 11d3422

Browse files
committed
added simple version of 3dTsmooth
1 parent 64c7b24 commit 11d3422

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

nipype/interfaces/afni/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
BlurInMask, BlurToFWHM, ClipLevel, DegreeCentrality, Despike, Detrend, ECM,
1414
Fim, Fourier, Hist, LFCD, Maskave, Means, OutlierCount, QualityIndex,
1515
ROIStats, Retroicor, Seg, SkullStrip, TCorr1D, TCorrMap, TCorrelate, TNorm,
16-
TProject, TShift, Volreg, Warp, QwarpPlusMinus, Qwarp)
16+
TProject, TShift, TSmooth, Volreg, Warp, QwarpPlusMinus, Qwarp)
1717
from .svm import (SVMTest, SVMTrain)
1818
from .utils import (
1919
ABoverlap, AFNItoNIFTI, Autobox, Axialize, BrickStat, Bucket, Calc, Cat,

nipype/interfaces/afni/preprocess.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2853,6 +2853,53 @@ def _list_outputs(self):
28532853
return outputs
28542854

28552855

2856+
class TSmoothInputSpec(AFNICommandInputSpec):
2857+
in_file = File(
2858+
desc='input file to 3dTSmooth',
2859+
argstr='%s',
2860+
position=-1,
2861+
mandatory=True,
2862+
exists=True,
2863+
copyfile=False)
2864+
out_file = File(
2865+
name_template='%s_smooth',
2866+
desc='output file from 3dTSmooth',
2867+
argstr='-prefix %s',
2868+
position=1,
2869+
name_source='in_file',
2870+
genfile=True)
2871+
adaptive = traits.Int(
2872+
desc='adaptive',
2873+
argstr='-adaptive %d',
2874+
position=-2,
2875+
mandatory=False)
2876+
2877+
2878+
class TSmooth(AFNICommand):
2879+
"""Smooths each voxel time series in a 3D+time dataset and produces
2880+
as output a new 3D+time dataset (e.g., lowpass filter in time).
2881+
2882+
For complete details, see the `3dBandpass Documentation.
2883+
<https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dTSmooth.html>`_
2884+
2885+
Examples
2886+
========
2887+
2888+
>>> from nipype.interfaces import afni
2889+
>>> from nipype.testing import example_data
2890+
>>> smooth = afni.TSmooth()
2891+
>>> smooth.inputs.in_file = 'functional.nii'
2892+
>>> smooth.inputs.adaptive = 5
2893+
>>> smooth.cmdline
2894+
'3dTsmooth -prefix functional_smooth -adaptive 5 functional.nii'
2895+
>>> res = smooth.run() # doctest: +SKIP
2896+
2897+
"""
2898+
_cmd = '3dTsmooth'
2899+
input_spec = TSmoothInputSpec
2900+
output_spec = AFNICommandOutputSpec
2901+
2902+
28562903
class VolregInputSpec(AFNICommandInputSpec):
28572904
in_file = File(
28582905
desc='input file to 3dvolreg',

0 commit comments

Comments
 (0)