We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 84d6e04 commit 8880a1aCopy full SHA for 8880a1a
nibabel/freesurfer/io.py
@@ -639,13 +639,10 @@ def read_stats_file(file_path):
639
"""
640
with open(file_path, 'r') as f:
641
for line in f:
642
- if re.findall(r'ColHeaders .*', line):
643
- parameters = line.split()
+ if line.startswith('# ColHeaders '):
+ columns = line.split()[2:]
644
break
645
- f.close()
646
- stats = np.loadtxt(file_path, comments='#', dtype=str)
647
- column_names = parameters[2:]
648
- return stats, column_names
+ return np.genfromtxt(f, dtype=None, names=columns, encoding='utf-8')
649
650
651
def read_stats_file_both_hemispheres(file_path: str):
0 commit comments