diff --git a/bin/population_template b/bin/population_template index a79b31e169..b44506ebf3 100755 --- a/bin/population_template +++ b/bin/population_template @@ -565,7 +565,7 @@ def parse_input_files(in_files, mask_files, contrasts, f_agg_weight=None, whites agg_weights = dict((row[0].strip(), row[1].strip()) for row in reader) pref = '^' + re.escape(get_common_prefix(list(agg_weights.keys()))) suff = re.escape(get_common_postfix(list(agg_weights.keys()))) + '$' - agg_weights = {re.sub(suff, '', re.sub(pref, '', key)):agg_weights[key] for key in agg_weights.keys()} + agg_weights = {re.sub(suff, '', re.sub(pref, '', item[0])):item[1] for item in agg_weights.items()} for inp in inputs: if inp.uid not in agg_weights: raise MRtrixError('aggregation weight not found for input "%s"' % inp.uid)