Skip to content

Commit

Permalink
prepare script
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi-Gau committed Aug 24, 2023
1 parent c557d1f commit 81ccc8a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ds000001-fmriprep/code/update_res_in_json.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""Add resolution metadata if json filename contains the res entity."""
import json
from pathlib import Path
from rich import print

root = Path(__file__).parent.parent

files_to_update = root.glob("sub-*/*/sub*res-2*.json")

for event in files_to_update:
with open(event) as f:
metadata = json.load(f)
metadata["Resolution"] = "2mm, isotropic"
with open(event, "w") as f:
json.dump(metadata, f, indent=2)

0 comments on commit 81ccc8a

Please sign in to comment.