Skip to content

Commit 674bfae

Browse files
author
stymy
committed
added eval, fixed tcat, added means
1 parent c75e4ae commit 674bfae

File tree

2 files changed

+45
-2
lines changed

2 files changed

+45
-2
lines changed

nipype/interfaces/afni/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
Fourier, Allineate, Maskave, SkullStrip, TCat, Fim,
1313
BlurInMask, Autobox, TCorrMap, Bandpass, Retroicor,
1414
TCorrelate, TCorr1D, BrickStat, ROIStats, AutoTcorrelate,
15-
AFNItoNIFTI, Eval)
15+
AFNItoNIFTI, Eval, Means)
1616
from .svm import (SVMTest, SVMTrain)

nipype/interfaces/afni/preprocess.py

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1206,7 +1206,7 @@ class TCatInputSpec(AFNICommandInputSpec):
12061206
mandatory=True,
12071207
copyfile=False)
12081208
out_file = File(name_template="%s_tcat", desc='output image file name',
1209-
argstr='-prefix %s', name_source="in_file")
1209+
argstr='-prefix %s', name_source="in_files")
12101210
rlt = traits.Str(desc='options', argstr='-rlt%s', position=1)
12111211

12121212

@@ -1993,3 +1993,46 @@ def _parse_inputs(self, skip=None):
19931993
"""
19941994
return super(Eval, self)._parse_inputs(
19951995
skip=('start_idx', 'stop_idx', 'out1D', 'other'))
1996+
1997+
class MeansInputSpec(AFNICommandInputSpec):
1998+
in_file_a = File(desc='input file to 3dMean',
1999+
argstr='%s',
2000+
position=0,
2001+
mandatory=True,
2002+
exists=True)
2003+
in_file_b = File(desc='another input file to 3dMean',
2004+
argstr='%s',
2005+
position=1,
2006+
exists=True)
2007+
out_file = File(name_template="%s_mean", desc='output image file name',
2008+
argstr='-prefix %s', name_source="in_file_a")
2009+
scale = traits.Str(desc='scaling of output', argstr='-%sscale')
2010+
non_zero = traits.Bool(desc='use only non-zero values', argstr='-non_zero')
2011+
std_dev = traits.Bool(desc='calculate std dev', argstr='-stdev')
2012+
sqr = traits.Bool(desc='mean square instead of value', argstr='-sqr')
2013+
summ = traits.Bool(desc='take sum, (not average)', argstr='-sum')
2014+
count = traits.Bool(desc='compute count of non-zero voxels', argstr='-count')
2015+
mask_inter = traits.Bool(desc='create intersection mask', argstr='-mask_inter')
2016+
mask_union = traits.Bool(desc='create union mask', argstr='-mask_union')
2017+
2018+
class Means(AFNICommand):
2019+
"""Takes the voxel-by-voxel mean of all input datasets using 3dMean
2020+
2021+
see AFNI Documentation: <http://afni.nimh.nih.gov/pub/dist/doc/program_help/3dMean.html>
2022+
2023+
Examples
2024+
========
2025+
2026+
>>> from nipype.interfaces import afni as afni
2027+
>>> means = afni.Means()
2028+
>>> means.inputs.in_file_a = 'dset.nii'
2029+
>>> means.inputs.in_file_b = 'dset2.nii'
2030+
>>> means.inputs.out_file = 'output.nii'
2031+
>>> means.cmdline
2032+
'3dMean -prefix output.nii dset.nii'
2033+
2034+
"""
2035+
2036+
_cmd = '3dMean'
2037+
input_spec = MeansInputSpec
2038+
output_spec = AFNICommandOutputSpec

0 commit comments

Comments
 (0)