@@ -512,13 +512,6 @@ class CentralityInputSpec(AFNICommandInputSpec):
512
512
inherits the out_file parameter from AFNICommandOutputSpec base class
513
513
"""
514
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
515
mask = File (desc = 'mask file to mask input data' ,
523
516
argstr = "-mask %s" ,
524
517
exists = True )
@@ -547,37 +540,22 @@ class DegreeCentralityInputSpec(CentralityInputSpec):
547
540
exists = True ,
548
541
copyfile = False )
549
542
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
543
sparsity = traits .Float (desc = 'only take the top percent of connections' ,
558
544
argstr = '-sparsity %f' )
559
545
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' )
546
+ oned_file = traits .Str (desc = 'output filepath to text dump of correlation matrix' ,
547
+ argstr = '-out1D %s' , mandatory = False )
570
548
571
549
572
550
class DegreeCentralityOutputSpec (AFNICommandOutputSpec ):
573
551
"""
574
552
inherits the out_file parameter from AFNICommandOutputSpec base class
575
553
"""
576
554
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' )
555
+ oned_file = File (desc = 'The text output of the similarity matrix computed' \
556
+ 'after thresholding with one-dimensional and ' \
557
+ 'ijk voxel indices, correlations, image extents, ' \
558
+ 'and affine matrix' )
581
559
582
560
583
561
class DegreeCentrality (AFNICommand ):
@@ -604,6 +582,56 @@ class DegreeCentrality(AFNICommand):
604
582
input_spec = DegreeCentralityInputSpec
605
583
output_spec = DegreeCentralityOutputSpec
606
584
585
+ # Re-define generated inputs
586
+ def _list_outputs (self ):
587
+ # Import packages
588
+ import os
589
+
590
+ # Update outputs dictionary if oned file is defined
591
+ outputs = super (DegreeCentrality , self )._list_outputs ()
592
+ if self .inputs .oned_file :
593
+ outputs ['oned_file' ] = os .path .abspath (self .inputs .oned_file )
594
+
595
+ return outputs
596
+
597
+
598
+ class LFCDInputSpec (CentralityInputSpec ):
599
+ """
600
+ inherits the out_file parameter from AFNICommandOutputSpec base class
601
+ """
602
+
603
+ in_file = File (desc = 'input file to 3dLFCD' ,
604
+ argstr = '%s' ,
605
+ position = - 1 ,
606
+ mandatory = True ,
607
+ exists = True ,
608
+ copyfile = False )
609
+
610
+
611
+ class LFCD (AFNICommand ):
612
+ """Performs degree centrality on a dataset using a given maskfile
613
+ via 3dLFCD
614
+
615
+ For complete details, see the `3dLFCD Documentation.
616
+ <http://afni.nimh.nih.gov/pub/dist/doc/program_help/3dLFCD.html>
617
+
618
+ Examples
619
+ ========
620
+
621
+ >>> from nipype.interfaces import afni as afni
622
+ >>> lfcd = afni.LFCD()
623
+ >>> lfcd.inputs.in_file = 'func_preproc.nii'
624
+ >>> lfcd.inputs.mask = 'mask.nii'
625
+ >>> lfcd.inputs.threshold = .8 # keep all connections with corr >= 0.8
626
+ >>> lfcd.cmdline
627
+ '3dLFCD -threshold 0.8 -mask mask.nii func_preproc.nii'
628
+ >>> res = lfcd.run() # doctest: +SKIP
629
+ """
630
+
631
+ _cmd = '3dLFCD'
632
+ input_spec = LFCDInputSpec
633
+ output_spec = AFNICommandOutputSpec
634
+
607
635
608
636
class AutomaskInputSpec (AFNICommandInputSpec ):
609
637
in_file = File (desc = 'input file to 3dAutomask' ,
0 commit comments