Guest User

Untitled

a guest
Nov 18th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. from glob import glob
  2. import numpy as np
  3. import json
  4. import datalad
  5.  
  6. files = glob('sub-*/func/*_bold.json')
  7.  
  8. for f in files:
  9. with open(f) as fh:
  10. sidecar = json.load(fh)
  11. sidecar["SliceTiming"] = (np.array(sidecar["SliceTiming"], dtype=float) * 1.e-3).tolist()
  12. datalad.utils.rotree(f, ro=False, chmod_files=True)
  13. with open(f, 'w') as fh:
  14. json.dump(sidecar, fh, indent=4)
  15. datalad.utils.rotree(f, ro=True, chmod_files=True)
Add Comment
Please, Sign In to add comment