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

[WIP][ENH] BIDSify filenames and tables #43

Draft
wants to merge 32 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
89dc4f5
[DATALAD RUNCMD] add mask suffix
Remi-Gau May 19, 2022
38dcbb8
[DATALAD RUNCMD] fix res entity
Remi-Gau May 19, 2022
edaeaaf
[DATALAD RUNCMD] fix desc entity
Remi-Gau May 19, 2022
c06e278
[DATALAD RUNCMD] fix desc entity label
Remi-Gau May 19, 2022
1906868
[DATALAD RUNCMD] fix atlas
Remi-Gau May 19, 2022
d371ce5
[DATALAD RUNCMD] add description corpus call
Remi-Gau May 19, 2022
76cb7b8
[DATALAD RUNCMD] rm prefix corpus call
Remi-Gau May 19, 2022
18239ca
[DATALAD RUNCMD] rm _T1w_ in mask
Remi-Gau May 19, 2022
49159db
[DATALAD RUNCMD] fix desc entities in reference brain
Remi-Gau May 19, 2022
3d4429a
[DATALAD RUNCMD] add atlas entity in reference brain
Remi-Gau May 19, 2022
1f10436
[DATALAD RUNCMD] add atlas entity in reference brain
Remi-Gau May 19, 2022
c07c620
[DATALAD RUNCMD] fix symmetric
Remi-Gau May 19, 2022
155b03d
[DATALAD RUNCMD] add discrete segmentaton to labels
Remi-Gau May 19, 2022
d4d0c2a
add renaming script
Remi-Gau May 19, 2022
61377c7
[DATALAD RUNCMD] add atlas entity to labels
Remi-Gau May 19, 2022
2425e7b
add rudimentary script to validate BIDSiness of filenames
Remi-Gau May 19, 2022
60c6888
add rudimentary script to validate BIDSiness of filenames
Remi-Gau May 19, 2022
125365f
prepare renamin sript
Remi-Gau Jun 23, 2023
ba9f01e
prepare renamin sript
Remi-Gau Jun 23, 2023
41d70af
prepare renamin sript
Remi-Gau Jun 23, 2023
d545fda
[DATALAD RUNCMD] rename files
Remi-Gau Jun 23, 2023
af868fa
rename masks
Remi-Gau Jun 23, 2023
d139ffb
rename ref brains
Remi-Gau Jun 23, 2023
44f1b19
prepare script to clean up json
Remi-Gau Jun 23, 2023
6d05ffa
prepare script to clean up json
Remi-Gau Jun 23, 2023
d757c25
prepare script to clean up json
Remi-Gau Jun 23, 2023
16b3489
prepare script to clean up json
Remi-Gau Jun 23, 2023
9e1ead6
prepare script to clean up json
Remi-Gau Jun 23, 2023
07c268f
[DATALAD RUNCMD] update json
Remi-Gau Jun 23, 2023
ccc0f3d
prepare script to clean up tsv
Remi-Gau Jun 23, 2023
277f79b
prepare script to clean up tsv
Remi-Gau Jun 23, 2023
006d6a1
[DATALAD RUNCMD] update tsv
Remi-Gau Jun 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
31 changes: 31 additions & 0 deletions add_hemisphere_to_tsv.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from pathlib import Path
from rich import print
import pandas as pd
import json

RENAME = True

root_dir = Path(__file__).parent

output_dir = root_dir / "atlases" / "label" / "Human"

tsv_files = output_dir.glob("*.tsv")

for file in tsv_files:
df = pd.read_csv(file, sep="\t")
hemispheres = []
for row in df.iterrows():
label = row[1]["label"]
if label.startswith("L_") or label.startswith("Left_"):
hemispheres.append("left")
elif label.startswith("R_") or label.startswith("Right_"):
hemispheres.append("right")
else:
hemispheres.append("bilateral")

df["hemisphere"] = hemispheres

print(df)

if RENAME:
df.to_csv(file, sep="\t", index=False)
121 changes: 0 additions & 121 deletions atlases/label/Human/Anatomical-labels-csv/AAL.csv

This file was deleted.

Loading