Skip to content

Commit 700ecce

Browse files
author
Shoshana Berleant
committed
add detrend param, doc
1 parent fffd9b5 commit 700ecce

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

nipype/algorithms/stats.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,18 @@ class SignalExtractionInputSpec(BaseInterfaceInputSpec):
3232
desc='Human-readable labels for each segment '
3333
'in the label file, in order. The length of '
3434
'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')
3638
out_file = File('signals.tsv', usedefault=True, exists=False,
3739
mandatory=False, desc='The name of the file to output to. '
3840
'signals.tsv by default')
3941
stat = traits.Enum(('mean',), mandatory=False, default='mean',
4042
usedefault=True,
4143
desc='The stat you wish to calculate on each segment. '
4244
'The default is finding the mean')
45+
detrend = traits.Bool(False, usedefault=True, mandatory=False,
46+
desc='If True, perform detrending using nilearn.')
4347

4448
class SignalExtractionOutputSpec(TraitedSpec):
4549
out_file = File(exists=True, desc='tsv file containing the computed '
@@ -64,8 +68,11 @@ class SignalExtraction(BaseInterface):
6468

6569
def _run_interface(self, runtime):
6670
ins = self.inputs
71+
6772
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()
6976
region_signals = nlmasker.transform_single_imgs(ins.in_file)
7077

7178
num_labels_found = region_signals.shape[1]

0 commit comments

Comments
 (0)