@@ -32,14 +32,18 @@ class SignalExtractionInputSpec(BaseInterfaceInputSpec):
32
32
desc = 'Human-readable labels for each segment '
33
33
'in the label file, in order. The length of '
34
34
'class_labels must be equal to the number of '
35
- 'segments (background excluded)' )
35
+ 'segments (background excluded). This list '
36
+ 'corresponds to the class labels in label_file '
37
+ 'in ascending order' )
36
38
out_file = File ('signals.tsv' , usedefault = True , exists = False ,
37
39
mandatory = False , desc = 'The name of the file to output to. '
38
40
'signals.tsv by default' )
39
41
stat = traits .Enum (('mean' ,), mandatory = False , default = 'mean' ,
40
42
usedefault = True ,
41
43
desc = 'The stat you wish to calculate on each segment. '
42
44
'The default is finding the mean' )
45
+ detrend = traits .Bool (False , usedefault = True , mandatory = False ,
46
+ desc = 'If True, perform detrending using nilearn.' )
43
47
44
48
class SignalExtractionOutputSpec (TraitedSpec ):
45
49
out_file = File (exists = True , desc = 'tsv file containing the computed '
@@ -64,8 +68,11 @@ class SignalExtraction(BaseInterface):
64
68
65
69
def _run_interface (self , runtime ):
66
70
ins = self .inputs
71
+
67
72
if ins .stat == 'mean' : # always true for now
68
- nlmasker = nl .NiftiLabelsMasker (ins .label_file ).fit ()
73
+ nlmasker = nl .NiftiLabelsMasker (ins .label_file ,
74
+ detrend = ins .detrend )
75
+ nlmasker .fit ()
69
76
region_signals = nlmasker .transform_single_imgs (ins .in_file )
70
77
71
78
num_labels_found = region_signals .shape [1 ]
0 commit comments