Skip to content

Commit e8ef396

Browse files
committed
now able to set prefix and file extension automatically NIFTI
1 parent 009cdf8 commit e8ef396

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

nipype/interfaces/afni/preprocess.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,3 +1241,35 @@ def _parse_inputs(self, skip=None):
12411241
"""
12421242
return super(Calc, self)._parse_inputs(
12431243
skip=('start_idx', 'stop_idx', 'other'))
1244+
1245+
1246+
class AFNItoNIFTIInputSpec(AFNICommandInputSpec):
1247+
in_file = File(desc='input file to 3dAFNItoNIFTI',
1248+
argstr='%s',
1249+
position=-1,
1250+
mandatory=True,
1251+
exists=True)
1252+
out_file = File("%s.nii", desc='output image file name',
1253+
argstr='-prefix %s', name_source="in_file", usedefault=True)
1254+
1255+
class AFNItoNIFTI(AFNICommand):
1256+
"""Changes AFNI format files to NIFTI format using 3dAFNItoNIFTI
1257+
1258+
see AFNI Documentation: <http://afni.nimh.nih.gov/pub/dist/doc/program_help/3dAFNItoNIFTI.html>
1259+
Also can take in 2dimensional or 3dimensional data, which then undergoes numpy.squeeze()
1260+
1261+
Examples
1262+
========
1263+
1264+
>>> from nipype.interfaces import afni as afni
1265+
>>> a2n = afni.AFNItoNIFTI()
1266+
>>> a2n.inputs.in_file = 'afni_output.3D'
1267+
>>> a2n.inputs.out_file = 'afni_output.nii'
1268+
>>> a2n.cmdline
1269+
'3dAFNItoNIFTI afni_output.3D'
1270+
1271+
"""
1272+
1273+
_cmd = '3dAFNItoNIFTI'
1274+
input_spec = AFNItoNIFTIInputSpec
1275+
output_spec = AFNICommandOutputSpec

0 commit comments

Comments
 (0)