@@ -180,6 +180,7 @@ class RefitInputSpec(CommandLineInputSpec):
180180 ' template type, e.g. TLRC, MNI, ORIG' )
181181
182182
183+
183184class Refit (CommandLine ):
184185 """Changes some of the information inside a 3D dataset's header
185186
@@ -506,6 +507,104 @@ class Despike(AFNICommand):
506507 output_spec = AFNICommandOutputSpec
507508
508509
510+ class CentralityInputSpec (AFNICommandInputSpec ):
511+ """
512+ inherits the out_file parameter from AFNICommandOutputSpec base class
513+ """
514+
515+ in_file = File (desc = 'input file to 3dDegreeCentrality' ,
516+ argstr = '%s' ,
517+ position = - 1 ,
518+ mandatory = True ,
519+ exists = True ,
520+ copyfile = False )
521+
522+ mask = File (desc = 'mask file to mask input data' ,
523+ argstr = "-mask %s" ,
524+ exists = True )
525+
526+ thresh = traits .Float (desc = 'threshold to exclude connections where corr <= thresh' ,
527+ argstr = '-thresh %f' )
528+
529+ polort = traits .Int (desc = '' , argstr = '-polort %d' )
530+
531+ autoclip = traits .Bool (desc = 'Clip off low-intensity regions in the dataset' ,
532+ argstr = '-autoclip' )
533+
534+ automask = traits .Bool (desc = 'Mask the dataset to target brain-only voxels' ,
535+ argstr = '-automask' )
536+
537+
538+ class DegreeCentralityInputSpec (CentralityInputSpec ):
539+ """
540+ inherits the out_file parameter from AFNICommandOutputSpec base class
541+ """
542+
543+ in_file = File (desc = 'input file to 3dDegreeCentrality' ,
544+ argstr = '%s' ,
545+ position = - 1 ,
546+ mandatory = True ,
547+ exists = True ,
548+ copyfile = False )
549+
550+ mask = File (desc = 'mask file to mask input data' ,
551+ argstr = "-mask %s" ,
552+ exists = True )
553+
554+ thresh = traits .Float (desc = 'threshold to exclude connections where corr <= thresh' ,
555+ argstr = '-thresh %f' )
556+
557+ sparsity = traits .Float (desc = 'only take the top percent of connections' ,
558+ argstr = '-sparsity %f' )
559+
560+ out_1d = traits .Str (desc = 'output filepath to text dump of correlation matrix' ,
561+ argstr = '-out1D' )
562+
563+ polort = traits .Int (desc = '' , argstr = '-polort %d' )
564+
565+ autoclip = traits .Bool (desc = 'Clip off low-intensity regions in the dataset' ,
566+ argstr = '-autoclip' )
567+
568+ automask = traits .Bool (desc = 'Mask the dataset to target brain-only voxels' ,
569+ argstr = '-automask' )
570+
571+
572+ class DegreeCentralityOutputSpec (AFNICommandOutputSpec ):
573+ """
574+ inherits the out_file parameter from AFNICommandOutputSpec base class
575+ """
576+
577+ one_d_file = File (desc = 'The text output of the similarity matrix computed' \
578+ 'after thresholding with one-dimensional and ' \
579+ 'ijk voxel indices, correlations, image extents, ' \
580+ 'and affine matrix' )
581+
582+
583+ class DegreeCentrality (AFNICommand ):
584+ """Performs degree centrality on a dataset using a given maskfile
585+ via 3dDegreeCentrality
586+
587+ For complete details, see the `3dDegreeCentrality Documentation.
588+ <http://afni.nimh.nih.gov/pub/dist/doc/program_help/3dDegreeCentrality.html>
589+
590+ Examples
591+ ========
592+
593+ >>> from nipype.interfaces import afni as afni
594+ >>> degree = afni.DegreeCentrality()
595+ >>> degree.inputs.in_file = 'func_preproc.nii'
596+ >>> degree.inputs.mask = 'mask.nii'
597+ >>> degree.inputs.sparsity = 1 # keep the top one percent of connections
598+ >>> degree.cmdline
599+ '3dDegreeCentrality -sparsity 1 -mask mask.nii func_preproc.nii'
600+ >>> res = degree.run() # doctest: +SKIP
601+ """
602+
603+ _cmd = '3dDegreeCentrality'
604+ input_spec = DegreeCentralityInputSpec
605+ output_spec = DegreeCentralityOutputSpec
606+
607+
509608class AutomaskInputSpec (AFNICommandInputSpec ):
510609 in_file = File (desc = 'input file to 3dAutomask' ,
511610 argstr = '%s' ,
0 commit comments