18
18
19
19
from ...utils .filemanip import (load_json , save_json , split_filename )
20
20
from ..base import (CommandLineInputSpec , CommandLine , Directory , TraitedSpec ,
21
- traits , isdefined , File , InputMultiPath , Undefined , Str )
21
+ traits , isdefined , File , InputMultiObject , InputMultiPath ,
22
+ Undefined , Str )
22
23
from ...external .due import BibTeX
23
24
from .base import (AFNICommandBase , AFNICommand , AFNICommandInputSpec ,
24
25
AFNICommandOutputSpec , AFNIPythonCommandInputSpec ,
@@ -1546,6 +1547,7 @@ class LocalstatInputSpec(AFNICommandInputSpec):
1546
1547
traits .Float ,
1547
1548
traits .Tuple (traits .Float , traits .Float , traits .Float ),
1548
1549
argstr = '-reduce_grid %s' ,
1550
+ xor = ['reduce_restore_grid' , 'reduce_max_vox' ],
1549
1551
desc = 'Compute output on a grid that is reduced by the specified '
1550
1552
'factors. If a single value is passed, output is resampled '
1551
1553
'to the specified isotropic grid. Otherwise, the 3 inputs '
@@ -1558,10 +1560,12 @@ class LocalstatInputSpec(AFNICommandInputSpec):
1558
1560
traits .Float ,
1559
1561
traits .Tuple (traits .Float , traits .Float , traits .Float ),
1560
1562
argstr = '-reduce_restore_grid %s' ,
1563
+ xor = ['reduce_max_vox' , 'reduce_grid' ],
1561
1564
desc = 'Like reduce_grid, but also resample output back to input'
1562
1565
'grid.' )
1563
1566
reduce_max_vox = traits .Float (
1564
1567
argstr = '-reduce_max_vox %s' ,
1568
+ xor = ['reduce_restore_grid' , 'reduce_grid' ],
1565
1569
desc = 'Like reduce_restore_grid, but automatically set Rx Ry Rz so'
1566
1570
'that the computation grid is at a resolution of nbhd/MAX_VOX'
1567
1571
'voxels.' )
@@ -1570,7 +1574,8 @@ class LocalstatInputSpec(AFNICommandInputSpec):
1570
1574
'Li' ,
1571
1575
'Cu' ,
1572
1576
'Bk' ,
1573
- argstr = 'grid_rmode %s' ,
1577
+ argstr = '-grid_rmode %s' ,
1578
+ requires = ['reduce_restore_grid' ],
1574
1579
desc = 'Interpolant to use when resampling the output with the'
1575
1580
'reduce_restore_grid option. The resampling method string '
1576
1581
'RESAM should come from the set {\' NN\' , \' Li\' , \' Cu\' , '
@@ -1594,7 +1599,7 @@ class LocalstatInputSpec(AFNICommandInputSpec):
1594
1599
class Localstat (AFNICommand ):
1595
1600
"""3dLocalstat - computes statistics at each voxel,
1596
1601
based on a local neighborhood of that voxel.
1597
-
1602
+
1598
1603
For complete details, see the `3dLocalstat Documentation.
1599
1604
<https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dLocalstat.html>`_
1600
1605
@@ -1607,7 +1612,7 @@ class Localstat(AFNICommand):
1607
1612
>>> localstat.inputs.mask_file = 'label-WM_desc-eroded_roi.nii.gz'
1608
1613
>>> localstat.inputs.neighborhood = ('SPHERE', 45)
1609
1614
>>> localstat.inputs.stat = 'mean'
1610
- >>> localstat.inputs.nonmask= True
1615
+ >>> localstat.inputs.nonmask = True
1611
1616
>>> localstat.inputs.outputtype = 'NIFTI_GZ'
1612
1617
>>> localstat.cmdline
1613
1618
"3dLocalstat -prefix bold_localstat.nii.gz \
@@ -1619,7 +1624,6 @@ class Localstat(AFNICommand):
1619
1624
>>> wmlocal = localstat.run() # doctest: +SKIP
1620
1625
1621
1626
"""
1622
-
1623
1627
_cmd = '3dLocalstat'
1624
1628
input_spec = LocalstatInputSpec
1625
1629
output_spec = AFNICommandOutputSpec
@@ -2398,6 +2402,7 @@ class ReHo(AFNICommandBase):
2398
2402
-nneigh 27 \
2399
2403
-in_rois power264.nii.gz"
2400
2404
>>> rh = reho.run() # doctest: +SKIP
2405
+
2401
2406
"""
2402
2407
_cmd = '3dReHo'
2403
2408
input_spec = ReHoInputSpec
0 commit comments