Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] fix typos in Harvard Oxford atlas labels #4035

Merged
merged 3 commits into from
Oct 13, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion nilearn/datasets/atlas.py
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,14 @@ def _get_atlas_data_and_labels(
f"Duplicate index {new_idx} for labels "
f"'{names[new_idx]}', and '{label.text}'"
)
names[new_idx] = label.text

# fix typos in Harvard Oxford labels
if atlas_source == "HarvardOxford":
label.text = label.text.replace("Ventrical", "Ventricle")
label.text = label.text.replace("Operculum", "Opercular")

names[new_idx] = label.text.strip()

# The label indices should range from 0 to nlabel + 1
assert list(names.keys()) == list(range(n + 2))
names = [item[1] for item in sorted(names.items())]
Expand Down