Skip to content

Commit c17758a

Browse files
committed
Added -newgrid option to Warp interface in AFNI (3dWarp wrapper)
1 parent df3d67a commit c17758a

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

nipype/interfaces/afni/preprocess.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,9 @@ class WarpInputSpec(AFNICommandInputSpec):
233233
argstr="-gridset %s",
234234
exists=True)
235235

236+
newgrid = traits.Float(desc="specify grid of this size (mm)",
237+
argstr="-newgrid %f")
238+
236239
zpad = traits.Int(desc="pad input dataset with N planes" +
237240
" of zero on all sides.",
238241
argstr="-zpad %d")
@@ -254,7 +257,13 @@ class Warp(AFNICommand):
254257
>>> warp.inputs.out_file = "trans.nii.gz"
255258
>>> warp.cmdline
256259
'3dWarp -deoblique -prefix trans.nii.gz structural.nii'
257-
>>> res = warp.run() # doctest: +SKIP
260+
261+
>>> warp_2 = afni.Warp()
262+
>>> warp_2.inputs.in_file = 'structural.nii'
263+
>>> warp_2.inputs.newgrid = 1.0
264+
>>> warp_2.inputs.out_file = "trans.nii.gz"
265+
>>> warp_2.cmdline
266+
'3dWarp -newgrid 1.000000 -prefix trans.nii.gz structural.nii'
258267
259268
"""
260269

nipype/interfaces/afni/tests/test_auto_Warp.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ def test_Warp_inputs():
2626
),
2727
mni2tta=dict(argstr='-mni2tta',
2828
),
29+
newgrid=dict(argstr='-newgrid %f',
30+
),
2931
out_file=dict(argstr='-prefix %s',
3032
name_source='in_file',
3133
name_template='%s_warp',

0 commit comments

Comments
 (0)