Skip to content

Commit 37fd56c

Browse files
author
David Ellis
committed
FIX: Fixes source subject for BAMaps thresh.
1 parent c0cf40f commit 37fd56c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

nipype/workflows/smri/freesurfer/ba_maps.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ def create_ba_maps_wf(name="Brodmann_Area_Maps", th3=True, exvivo=True,
6565
white='surf/{0}.white'.format(hemisphere))
6666

6767
out_files = list()
68+
source_fields = ['sphere_reg', 'white']
6869
if threshold:
6970
for label in labels:
7071
if label == 'perirhinal' and not entorhinal:
@@ -76,7 +77,8 @@ def create_ba_maps_wf(name="Brodmann_Area_Maps", th3=True, exvivo=True,
7677
out_file = '{0}.{1}.thresh.label'.format(hemisphere, label)
7778
out_files.append(out_file)
7879
field_template[label] = 'label/' + out_file
79-
node_name = 'BA_Maps_' + hemisphere + '_Tresh'
80+
source_fields.append(label)
81+
node_name = 'BA_Maps_' + hemisphere + '_Thresh'
8082
else:
8183
for label in labels:
8284
if exvivo:
@@ -86,17 +88,17 @@ def create_ba_maps_wf(name="Brodmann_Area_Maps", th3=True, exvivo=True,
8688

8789
out_files.append(out_file)
8890
field_template[label] = 'label/' + out_file
91+
source_fields.append(label)
8992
node_name = 'BA_Maps_' + hemisphere
9093

91-
source_fields = labels + ['sphere_reg', 'white']
9294
source_subject = pe.Node(DataGrabber(outfields=source_fields),
9395
name=node_name + "_srcsubject")
9496
source_subject.inputs.template = '*'
9597
source_subject.inputs.sort_filelist = False
9698
source_subject.inputs.field_template = field_template
9799
ba_WF.connect([(inputspec, source_subject, [('src_subject_dir', 'base_directory')])])
98100

99-
merge_labels = pe.Node(Merge(len(labels)),
101+
merge_labels = pe.Node(Merge(len(out_files)),
100102
name=node_name + "_Merge")
101103
for i,label in enumerate(labels):
102104
ba_WF.connect([(source_subject, merge_labels, [(label, 'in{0}'.format(i+1))])])

0 commit comments

Comments
 (0)