def get_regions(roi_path): f = open(roi_path, 'r').read() f = f.split("\n") f = [i.split() for i in f] return f