Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from glob import glob
- import numpy as np
- import json
- import datalad
- files = glob('sub-*/func/*_bold.json')
- for f in files:
- with open(f) as fh:
- sidecar = json.load(fh)
- sidecar["SliceTiming"] = (np.array(sidecar["SliceTiming"], dtype=float) * 1.e-3).tolist()
- datalad.utils.rotree(f, ro=False, chmod_files=True)
- with open(f, 'w') as fh:
- json.dump(sidecar, fh, indent=4)
- datalad.utils.rotree(f, ro=True, chmod_files=True)
Add Comment
Please, Sign In to add comment