1818
1919from ...utils .filemanip import (load_json , save_json , split_filename )
2020from ..base import (CommandLineInputSpec , CommandLine , Directory , TraitedSpec ,
21- traits , isdefined , File , InputMultiPath , Undefined , Str )
21+ traits , isdefined , File , InputMultiObject , InputMultiPath ,
22+ Undefined , Str )
2223from ...external .due import BibTeX
2324from .base import (AFNICommandBase , AFNICommand , AFNICommandInputSpec ,
2425 AFNICommandOutputSpec , AFNIPythonCommandInputSpec ,
@@ -1546,6 +1547,7 @@ class LocalstatInputSpec(AFNICommandInputSpec):
15461547 traits .Float ,
15471548 traits .Tuple (traits .Float , traits .Float , traits .Float ),
15481549 argstr = '-reduce_grid %s' ,
1550+ xor = ['reduce_restore_grid' , 'reduce_max_vox' ],
15491551 desc = 'Compute output on a grid that is reduced by the specified '
15501552 'factors. If a single value is passed, output is resampled '
15511553 'to the specified isotropic grid. Otherwise, the 3 inputs '
@@ -1558,10 +1560,12 @@ class LocalstatInputSpec(AFNICommandInputSpec):
15581560 traits .Float ,
15591561 traits .Tuple (traits .Float , traits .Float , traits .Float ),
15601562 argstr = '-reduce_restore_grid %s' ,
1563+ xor = ['reduce_max_vox' , 'reduce_grid' ],
15611564 desc = 'Like reduce_grid, but also resample output back to input'
15621565 'grid.' )
15631566 reduce_max_vox = traits .Float (
15641567 argstr = '-reduce_max_vox %s' ,
1568+ xor = ['reduce_restore_grid' , 'reduce_grid' ],
15651569 desc = 'Like reduce_restore_grid, but automatically set Rx Ry Rz so'
15661570 'that the computation grid is at a resolution of nbhd/MAX_VOX'
15671571 'voxels.' )
@@ -1570,7 +1574,8 @@ class LocalstatInputSpec(AFNICommandInputSpec):
15701574 'Li' ,
15711575 'Cu' ,
15721576 'Bk' ,
1573- argstr = 'grid_rmode %s' ,
1577+ argstr = '-grid_rmode %s' ,
1578+ requires = ['reduce_restore_grid' ],
15741579 desc = 'Interpolant to use when resampling the output with the'
15751580 'reduce_restore_grid option. The resampling method string '
15761581 'RESAM should come from the set {\' NN\' , \' Li\' , \' Cu\' , '
@@ -1594,7 +1599,7 @@ class LocalstatInputSpec(AFNICommandInputSpec):
15941599class Localstat (AFNICommand ):
15951600 """3dLocalstat - computes statistics at each voxel,
15961601 based on a local neighborhood of that voxel.
1597-
1602+
15981603 For complete details, see the `3dLocalstat Documentation.
15991604 <https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dLocalstat.html>`_
16001605
@@ -1607,7 +1612,7 @@ class Localstat(AFNICommand):
16071612 >>> localstat.inputs.mask_file = 'label-WM_desc-eroded_roi.nii.gz'
16081613 >>> localstat.inputs.neighborhood = ('SPHERE', 45)
16091614 >>> localstat.inputs.stat = 'mean'
1610- >>> localstat.inputs.nonmask= True
1615+ >>> localstat.inputs.nonmask = True
16111616 >>> localstat.inputs.outputtype = 'NIFTI_GZ'
16121617 >>> localstat.cmdline
16131618 "3dLocalstat -prefix bold_localstat.nii.gz \
@@ -1619,7 +1624,6 @@ class Localstat(AFNICommand):
16191624 >>> wmlocal = localstat.run() # doctest: +SKIP
16201625
16211626 """
1622-
16231627 _cmd = '3dLocalstat'
16241628 input_spec = LocalstatInputSpec
16251629 output_spec = AFNICommandOutputSpec
@@ -2398,6 +2402,7 @@ class ReHo(AFNICommandBase):
23982402 -nneigh 27 \
23992403 -in_rois power264.nii.gz"
24002404 >>> rh = reho.run() # doctest: +SKIP
2405+
24012406 """
24022407 _cmd = '3dReHo'
24032408 input_spec = ReHoInputSpec
0 commit comments