Skip to content

Commit bb6cf16

Browse files
committed
Interface for AFNI's 3dBlurToFWHM
1 parent 15a2bee commit bb6cf16

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

nipype/interfaces/afni/preprocess.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,37 @@
2121
from ...external.six import string_types
2222
from ...utils.filemanip import (load_json, save_json, split_filename)
2323

24+
class BlurToFWHMInputSpec(AFNICommandInputSpec):
25+
in_file = File(desc='The dataset that will be smoothed', argstr='-input %s', mandatory=True, exists=True)
26+
27+
automask = traits.Bool(desc='Create an automask from the input dataset.', argstr='-automask', exists=True)
28+
fwhm = traits.Float(desc='Blur until the 3D FWHM reaches this value (in mm)', argstr='-FWHM %f')
29+
fwhmxy = traits.Float(desc='Blur until the 2D (x,y)-plane FWHM reaches this value (in mm)', argstr='-FWHMxy %f')
30+
blurmaster = File(desc='The dataset whose smoothness controls the process.', argstr='-blurmaster %s', exists=True)
31+
mask = File(desc='Mask dataset, if desired. Voxels NOT in mask will be set to zero in output.', argstr='-blurmaster %s', exists=True)
32+
33+
34+
class BlurToFWHM(AFNICommand):
35+
"""Blurs a 'master' dataset until it reaches a specified FWHM smoothness (approximately).
36+
37+
For complete details, see the `to3d Documentation
38+
<https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dBlurToFWHM.html>`_
39+
40+
Examples
41+
========
42+
43+
>>> from nipype.interfaces import afni
44+
>>> blur = afni.BlurToFWHM()
45+
>>> blur.inputs.in_file = 'epi.nii'
46+
>>> blur.inputs.fwhm = 2.5
47+
>>> blur.cmdline #doctest: +ELLIPSIS
48+
'3dBlurToFWHM -FWHM 2.500000 -input .../nipype/nipype/testing/data/epi.nii -prefix epi_afni'
49+
50+
"""
51+
52+
_cmd = '3dBlurToFWHM'
53+
input_spec = BlurToFWHMInputSpec
54+
output_spec = AFNICommandOutputSpec
2455

2556
class To3DInputSpec(AFNICommandInputSpec):
2657
out_file = File(name_template="%s", desc='output image file name',

0 commit comments

Comments
 (0)