highspeed-bids-events.py 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. # ======================================================================
  4. # SCRIPT INFORMATION:
  5. # ======================================================================
  6. # SCRIPT: CREATE JSON FILES DESCRIBING COLUMNS IN THE EVENTS.TSV FILES
  7. # PROJECT: HIGHSPEED
  8. # WRITTEN BY LENNART WITTKUHN, 2019
  9. # CONTACT: WITTKUHN AT MPIB HYPHEN BERLIN DOT MPG DOT DE
  10. # MAX PLANCK RESEARCH GROUP NEUROCODE
  11. # MAX PLANCK INSTITUTE FOR HUMAN DEVELOPMENT
  12. # MAX PLANCK UCL CENTRE FOR COMPUTATIONAL PSYCHIATRY AND AGEING RESEARCH
  13. # LENTZEALLEE 94, 14195 BERLIN, GERMANY
  14. # ======================================================================
  15. # IMPORT RELEVANT PACKAGES
  16. # ======================================================================
  17. import json
  18. import glob
  19. from os.path import join as opj
  20. path_out = opj('/Users','wittkuhn','Desktop','test.json')
  21. data = {
  22. "onset": {
  23. "LongName": "Run-wise event onset in seconds",
  24. "Description": "The time in seconds from the first scanner trigger of the respective run",
  25. "Units": "seconds"
  26. },
  27. "subject": {
  28. "LongName": "Unique subject identifier",
  29. "Description": "A unique identifier for each person who is a subject in the study",
  30. },
  31. "duration": {
  32. "LongName": "Event duration in seconds",
  33. "Description": "The duration of each trial in seconds",
  34. "Units": "seconds"
  35. },
  36. "session": {
  37. "Description": "A unique identifier for each person who is a subject in the study",
  38. "LongName": "Unique subject identifier",
  39. "Levels": {
  40. "1": "Session 1 of the experiment",
  41. "2": "Session 2 of the experiment"
  42. }
  43. },
  44. "run_session": {
  45. "Description": "A unique identifier for each person who is a subject in the study",
  46. "LongName": "Unique subject identifier",
  47. "Levels": {
  48. "1": "Session 1 of the experiment",
  49. "2": "Session 2 of the experiment"
  50. }
  51. }
  52. with open(path_out, 'w') as outfile:
  53. json.dump(data, outfile, indent=4, sort_keys=True)