Skip to content

Commit d964d65

Browse files
aschaeferaschaefer
authored andcommitted
addition of 3dretroicor interface, very basic version
1 parent 4d6f4c3 commit d964d65

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

nipype/interfaces/afni/preprocess.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1810,3 +1810,53 @@ def _gen_filename(self, name):
18101810
if name == 'out_file' and (not isdefined(self.inputs.out_file)):
18111811
return Undefined
18121812
return super(Autobox, self)._gen_filename(name)
1813+
1814+
class RetroicorInputSpec(AFNICommandInputSpec):
1815+
in_file = File(desc='input file to 3dretroicor',
1816+
argstr='%s',
1817+
position=-1,
1818+
mandatory=True,
1819+
exists=True)
1820+
out_file = File(desc='output image file name', argstr='-prefix %s', mandatory=True, position=1)
1821+
card = File(desc='1D cardiac data file for cardiac correction',
1822+
argstr='-card %s',
1823+
position=-2)
1824+
resp = File(desc='1D respiratory waveform data for correction',
1825+
argstr='-resp %s',
1826+
position=-3)
1827+
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)',
1828+
argstr='-threshold %d',
1829+
position=-4)
1830+
order = traits.Int(desc='The order of the correction (2 is typical)',
1831+
argstr='-order %s',
1832+
position=-5)
1833+
1834+
cardphase = File(desc='Filename for 1D cardiac phase output',
1835+
argstr='-cardphase %s',
1836+
position=-6)
1837+
respphase = File(desc='Filename for 1D resp phase output',
1838+
argstr='-respphase %s',
1839+
position=-7)
1840+
1841+
1842+
class Retroicor(AFNICommand):
1843+
"""Performs Retrospective Image Correction for physiological
1844+
motion effects, using a slightly modified version of the
1845+
RETROICOR algorithm
1846+
1847+
For complete details, see the `3dretroicor Documentation.
1848+
<http://afni.nimh.nih.gov/pub/dist/doc/program_help/3dretroicor.html>`_
1849+
1850+
Examples
1851+
========
1852+
>>> from nipype.interfaces import afni as afni
1853+
>>> ret = afni.Retroicor()
1854+
>>> ret.inputs.in_file = 'functional.nii'
1855+
>>> ret.inputs.card = 'mask.1D'
1856+
>>> ret.inputs.resp = 'resp.1D'
1857+
>>> res = ret.run() # doctest: +SKIP
1858+
"""
1859+
1860+
_cmd = '3dretroicor'
1861+
input_spec = RetroicorInputSpec
1862+
output_spec = AFNICommandOutputSpec

0 commit comments

Comments
 (0)