Skip to content

Commit e98bd95

Browse files
author
Shoshana Berleant
committed
Add more informative error msg
1 parent 6448ee8 commit e98bd95

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

nipype/interfaces/nilearn.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ def _process_inputs(self):
113113
maskers.append(nl.NiftiMapsMasker(label_data))
114114

115115
# check label list size
116+
if not np.isclose(int(n_labels), n_labels):
117+
raise ValueError('The label files {} contain invalid value {}. Check input.'
118+
.format(self.inputs.label_files, n_labels))
119+
116120
if len(self.inputs.class_labels) != n_labels:
117121
raise ValueError('The length of class_labels {} does not '
118122
'match the number of regions {} found in '

0 commit comments

Comments
 (0)