Skip to content

Commit 19bf36a

Browse files
aschaeferaschaefer
authored andcommitted
2 parents 518233d + 8a63255 commit 19bf36a

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed

nipype/interfaces/afni/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
ZCutUp, Calc, TShift, Warp, Detrend, Despike, Copy,
1313
Fourier, Allineate, Maskave, SkullStrip, TCat, Fim,
1414
TCorrelate, BrickStat, ROIStats, AutoTcorrelate,
15-
BlurInMask, Autobox, TCorrMap, Bandpass)
15+
BlurInMask, Autobox, TCorrMap, Bandpass, Retroicor)

nipype/interfaces/afni/preprocess.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1762,3 +1762,53 @@ def _gen_filename(self, name):
17621762
if name == 'out_file' and (not isdefined(self.inputs.out_file)):
17631763
return Undefined
17641764
return super(Autobox, self)._gen_filename(name)
1765+
1766+
class RetroicorInputSpec(AFNICommandInputSpec):
1767+
in_file = File(desc='input file to 3dretroicor',
1768+
argstr='%s',
1769+
position=-1,
1770+
mandatory=True,
1771+
exists=True)
1772+
out_file = File(desc='output image file name', argstr='-prefix %s', mandatory=True, position=1)
1773+
card = File(desc='1D cardiac data file for cardiac correction',
1774+
argstr='-card %s',
1775+
position=-2)
1776+
resp = File(desc='1D respiratory waveform data for correction',
1777+
argstr='-resp %s',
1778+
position=-3)
1779+
threshold = traits.Int(desc='Threshold for detection of R-wave peaks in input (Make sure it is above the background noise level, Try 3/4 or 4/5 times range plus minimum)',
1780+
argstr='-threshold %d',
1781+
position=-4)
1782+
order = traits.Int(desc='The order of the correction (2 is typical)',
1783+
argstr='-order %s',
1784+
position=-5)
1785+
1786+
cardphase = File(desc='Filename for 1D cardiac phase output',
1787+
argstr='-cardphase %s',
1788+
position=-6)
1789+
respphase = File(desc='Filename for 1D resp phase output',
1790+
argstr='-respphase %s',
1791+
position=-7)
1792+
1793+
1794+
class Retroicor(AFNICommand):
1795+
"""Performs Retrospective Image Correction for physiological
1796+
motion effects, using a slightly modified version of the
1797+
RETROICOR algorithm
1798+
1799+
For complete details, see the `3dretroicor Documentation.
1800+
<http://afni.nimh.nih.gov/pub/dist/doc/program_help/3dretroicor.html>`_
1801+
1802+
Examples
1803+
========
1804+
>>> from nipype.interfaces import afni as afni
1805+
>>> ret = afni.Retroicor()
1806+
>>> ret.inputs.in_file = 'functional.nii'
1807+
>>> ret.inputs.card = 'mask.1D'
1808+
>>> ret.inputs.resp = 'resp.1D'
1809+
>>> res = ret.run() # doctest: +SKIP
1810+
"""
1811+
1812+
_cmd = '3dretroicor'
1813+
input_spec = RetroicorInputSpec
1814+
output_spec = AFNICommandOutputSpec

0 commit comments

Comments
 (0)