@@ -2684,8 +2684,9 @@ class NetCorrInputSpec(AFNICommandInputSpec):
2684
2684
)
2685
2685
2686
2686
class NetCorrOutputSpec (TraitedSpec ):
2687
- out_matrix = File (desc = "output text file for correlation stats" )
2688
-
2687
+ out_corr_matrix = File (desc = "output correlation matrix between ROIs written to a text file with .netcc suffix" )
2688
+ out_corr_maps = traits .List (File (), desc = "output correlation maps in Pearson and/or Z-scores" )
2689
+
2689
2690
class NetCorr (AFNICommand ):
2690
2691
"""Calculate correlation matrix of a set of ROIs (using mean time series of
2691
2692
each). Several networks may be analyzed simultaneously, one per brick.
@@ -2715,6 +2716,8 @@ class NetCorr(AFNICommand):
2715
2716
output_spec = NetCorrOutputSpec
2716
2717
2717
2718
def _list_outputs (self ):
2719
+ import glob
2720
+
2718
2721
outputs = self .output_spec ().get ()
2719
2722
2720
2723
if not isdefined (self .inputs .out_file ):
@@ -2723,11 +2726,13 @@ def _list_outputs(self):
2723
2726
prefix = self .inputs .out_file
2724
2727
2725
2728
# All outputs should be in the same directory as the prefix
2726
- out_dir = os .path .dirname (os .path .abspath (prefix ))
2729
+ odir = os .path .dirname (os .path .abspath (prefix ))
2730
+ outputs ["out_corr_matrix" ] = glob .glob (os .path .join (odir , "*.netcc" ))[0 ]
2731
+
2732
+ if isdefined (self .inputs .ts_wb_corr ) or isdefined (self .inputs .ts_Z_corr ):
2733
+ corrdir = os .path .join (odir , prefix + "_000_INDIV" )
2734
+ outputs ["out_corr_maps" ] = glob .glob (os .path .join (corrdir , "*.nii.gz" ))
2727
2735
2728
- outputs ["out_matrix" ] = (
2729
- fname_presuffix (prefix , suffix = "_000" , use_ext = False , newpath = out_dir ) + ".netcc"
2730
- )
2731
2736
return outputs
2732
2737
2733
2738
0 commit comments