[
  {
    "path": ".all-contributorsrc",
    "content": "{\n  \"files\": [\n    \"README.md\"\n  ],\n  \"imageSize\": 100,\n  \"commit\": false,\n  \"contributors\": [\n    {\n      \"login\": \"dorahermes\",\n      \"name\": \"Dora Hermes\",\n      \"avatar_url\": \"https://avatars1.githubusercontent.com/u/4977351?v=4\",\n      \"profile\": \"https://github.com/dorahermes\",\n      \"contributions\": [\n        \"code\",\n        \"content\",\n        \"ideas\",\n        \"review\",\n        \"maintenance\",\n        \"doc\"\n      ]\n    },\n    {\n      \"login\": \"chrisgorgo\",\n      \"name\": \"Chris Gorgolewski\",\n      \"avatar_url\": \"https://avatars2.githubusercontent.com/u/238759?v=4\",\n      \"profile\": \"http://chrisgorgolewski.org\",\n      \"contributions\": [\n        \"review\",\n        \"maintenance\",\n        \"bug\"\n      ]\n    },\n    {\n      \"login\": \"choldgraf\",\n      \"name\": \"Chris Holdgraf\",\n      \"avatar_url\": \"https://avatars1.githubusercontent.com/u/1839645?v=4\",\n      \"profile\": \"http://chrisholdgraf.com\",\n      \"contributions\": [\n        \"review\",\n        \"content\",\n        \"maintenance\"\n      ]\n    },\n    {\n      \"login\": \"cofficer\",\n      \"name\": \"Chris Gahnström\",\n      \"avatar_url\": \"https://avatars1.githubusercontent.com/u/12600386?v=4\",\n      \"profile\": \"https://chrisgahnstrom.wordpress.com/\",\n      \"contributions\": [\n        \"code\",\n        \"content\",\n        \"ideas\"\n      ]\n    },\n    {\n      \"login\": \"emdupre\",\n      \"name\": \"Elizabeth DuPre\",\n      \"avatar_url\": \"https://avatars3.githubusercontent.com/u/15017191?v=4\",\n      \"profile\": \"http://emdupre.me\",\n      \"contributions\": [\n        \"review\",\n        \"maintenance\",\n        \"ideas\",\n        \"content\",\n        \"doc\"\n      ]\n    },\n    {\n      \"login\": \"anushkab\",\n      \"name\": \"Utmost Happiness\",\n      \"avatar_url\": \"https://avatars0.githubusercontent.com/u/20943511?v=4\",\n      \"profile\": \"https://github.com/anushkab\",\n      \"contributions\": [\n        \"code\",\n        \"content\",\n        \"ideas\"\n      ]\n    },\n    {\n      \"login\": \"KirstieJane\",\n      \"name\": \"Kirstie Whitaker\",\n      \"avatar_url\": \"https://avatars1.githubusercontent.com/u/3626306?v=4\",\n      \"profile\": \"https://whitakerlab.github.io\",\n      \"contributions\": [\n        \"review\",\n        \"ideas\",\n        \"maintenance\",\n        \"content\",\n        \"doc\",\n        \"bug\"\n      ]\n    },\n    {\n      \"login\": \"Park-Patrick\",\n      \"name\": \"Patrick Park\",\n      \"avatar_url\": \"https://avatars3.githubusercontent.com/u/12662110?v=4\",\n      \"profile\": \"https://github.com/Park-Patrick\",\n      \"contributions\": [\n        \"ideas\",\n        \"content\",\n        \"review\"\n      ]\n    },\n    {\n      \"login\": \"PeerHerholz\",\n      \"name\": \"Peer Herholz\",\n      \"avatar_url\": \"https://avatars0.githubusercontent.com/u/20129524?v=4\",\n      \"profile\": \"http://peerherholz.github.io\",\n      \"contributions\": [\n        \"code\"\n      ]\n    },\n    {\n      \"login\": \"CPernet\",\n      \"name\": \"Cyril Pernet\",\n      \"avatar_url\": \"https://avatars2.githubusercontent.com/u/4772878?v=4\",\n      \"profile\": \"http://www.sbirc.ed.ac.uk/cyril/\",\n      \"contributions\": [\n        \"code\"\n      ]\n    },\n    {\n      \"login\": \"sappelhoff\",\n      \"name\": \"Stefan Appelhoff\",\n      \"avatar_url\": \"https://avatars1.githubusercontent.com/u/9084751?v=4\",\n      \"profile\": \"https://www.stefanappelhoff.com\",\n      \"contributions\": [\n        \"review\",\n        \"code\",\n        \"content\",\n        \"ideas\"\n      ]\n    },\n    {\n      \"login\": \"ilkayisik\",\n      \"name\": \"Ilkay Isik\",\n      \"avatar_url\": \"https://avatars1.githubusercontent.com/u/22478219?v=4\",\n      \"profile\": \"https://ilkayisik.github.io\",\n      \"contributions\": [\n        \"bug\"\n      ]\n    },\n    {\n      \"login\": \"teonbrooks\",\n      \"name\": \"Teon L Brooks\",\n      \"avatar_url\": \"https://avatars1.githubusercontent.com/u/1578674?v=4\",\n      \"profile\": \"https://teonbrooks.com\",\n      \"contributions\": [\n        \"bug\"\n      ]\n    },\n    {\n      \"login\": \"bayab\",\n      \"name\": \"ayab\",\n      \"avatar_url\": \"https://avatars0.githubusercontent.com/u/16117420?v=4\",\n      \"profile\": \"https://github.com/bayab\",\n      \"contributions\": [\n        \"content\"\n      ]\n    },\n    {\n      \"login\": \"Remi-Gau\",\n      \"name\": \"Remi Gau\",\n      \"avatar_url\": \"https://avatars3.githubusercontent.com/u/6961185?v=4\",\n      \"profile\": \"https://remi-gau.github.io/\",\n      \"contributions\": [\n        \"content\"\n      ]\n    },\n    {\n      \"login\": \"JaapVanDerAar\",\n      \"name\": \"Jaap van der Aar\",\n      \"avatar_url\": \"https://avatars3.githubusercontent.com/u/32334327?v=4\",\n      \"profile\": \"https://github.com/JaapVanDerAar\",\n      \"contributions\": [\n        \"code\",\n        \"content\",\n        \"ideas\"\n      ]\n    },\n    {\n      \"login\": \"GiulioCastegnaro\",\n      \"name\": \"Giulio Castegnaro\",\n      \"avatar_url\": \"https://avatars2.githubusercontent.com/u/45361920?v=4\",\n      \"profile\": \"https://github.com/GiulioCastegnaro\",\n      \"contributions\": [\n        \"code\",\n        \"content\",\n        \"ideas\"\n      ]\n    },\n    {\n      \"login\": \"franklin-feingold\",\n      \"name\": \"Franklin Feingold\",\n      \"avatar_url\": \"https://avatars1.githubusercontent.com/u/35307458?v=4\",\n      \"profile\": \"https://github.com/franklin-feingold\",\n      \"contributions\": [\n        \"bug\",\n        \"review\"\n      ]\n    },\n    {\n      \"login\": \"nicholst\",\n      \"name\": \"Thomas Nichols\",\n      \"avatar_url\": \"https://avatars3.githubusercontent.com/u/5155907?v=4\",\n      \"profile\": \"http://www.nisox.org\",\n      \"contributions\": [\n        \"review\"\n      ]\n    },\n    {\n      \"login\": \"pvdemael\",\n      \"name\": \"Pieter Vandemaele\",\n      \"avatar_url\": \"https://avatars1.githubusercontent.com/u/37624277?v=4\",\n      \"profile\": \"https://github.com/pvdemael\",\n      \"contributions\": [\n        \"bug\"\n      ]\n    },\n    {\n      \"login\": \"gllmflndn\",\n      \"name\": \"Guillaume Flandin\",\n      \"avatar_url\": \"https://avatars0.githubusercontent.com/u/5950855?v=4\",\n      \"profile\": \"https://github.com/gllmflndn\",\n      \"contributions\": [\n        \"review\",\n        \"ideas\"\n      ]\n    },\n    {\n      \"login\": \"robertoostenveld\",\n      \"name\": \"Robert Oostenveld\",\n      \"avatar_url\": \"https://avatars1.githubusercontent.com/u/899043?v=4\",\n      \"profile\": \"https://github.com/robertoostenveld\",\n      \"contributions\": [\n        \"bug\",\n        \"review\",\n        \"ideas\"\n      ]\n    },\n    {\n      \"login\": \"HappyFacade\",\n      \"name\": \"Happy\",\n      \"avatar_url\": \"https://avatars0.githubusercontent.com/u/54226355?v=4\",\n      \"profile\": \"https://github.com/HappyFacade\",\n      \"contributions\": [\n        \"content\"\n      ]\n    },\n    {\n      \"login\": \"tpatpa\",\n      \"name\": \"Tal Pal Attia\",\n      \"avatar_url\": \"https://avatars1.githubusercontent.com/u/24300712?v=4\",\n      \"profile\": \"https://www.linkedin.com/in/tal-pal-attia-201373b0/\",\n      \"contributions\": [\n        \"code\"\n      ]\n    },\n    {\n      \"login\": \"VisLab\",\n      \"name\": \"Kay Robbins\",\n      \"avatar_url\": \"https://avatars1.githubusercontent.com/u/1189050?v=4\",\n      \"profile\": \"https://github.com/VisLab\",\n      \"contributions\": [\n        \"ideas\",\n        \"content\"\n      ]\n    },\n    {\n      \"login\": \"eduardklap\",\n      \"name\": \"Eduard Klapwijk\",\n      \"avatar_url\": \"https://avatars1.githubusercontent.com/u/41283173?v=4\",\n      \"profile\": \"https://erasmus-synclab.nl/\",\n      \"contributions\": [\n        \"ideas\"\n      ]\n    },\n    {\n      \"login\": \"DorienHuijser\",\n      \"name\": \"Dorien Huijser\",\n      \"avatar_url\": \"https://avatars1.githubusercontent.com/u/58177697?v=4\",\n      \"profile\": \"https://github.com/DorienHuijser\",\n      \"contributions\": [\n        \"ideas\"\n      ]\n    },\n    {\n      \"login\": \"Arshitha\",\n      \"name\": \"Arshitha Basavaraj\",\n      \"avatar_url\": \"https://avatars1.githubusercontent.com/u/10297203?v=4\",\n      \"profile\": \"http://cmn.nimh.nih.gov/dsst\",\n      \"contributions\": [\n        \"ideas\"\n      ]\n    },\n    {\n      \"login\": \"lnnrtwttkhn\",\n      \"name\": \"Lennart Wittkuhn\",\n      \"avatar_url\": \"https://avatars0.githubusercontent.com/u/42233065?v=4\",\n      \"profile\": \"https://lennartwittkuhn.com\",\n      \"contributions\": [\n        \"ideas\"\n      ]\n    },\n    {\n      \"login\": \"bendhouseart\",\n      \"name\": \"Anthony Galassi\",\n      \"avatar_url\": \"https://avatars.githubusercontent.com/u/28850131?v=4\",\n      \"profile\": \"https://github.com/bendhouseart\",\n      \"contributions\": [\n        \"ideas\",\n        \"code\"\n      ]\n    },\n    {\n      \"login\": \"Athanasiamo\",\n      \"name\": \"Athanasia Monika Mowinckel\",\n      \"avatar_url\": \"https://avatars.githubusercontent.com/u/14014329?v=4\",\n      \"profile\": \"http://DrMowinckels.io\",\n      \"contributions\": [\n        \"ideas\",\n        \"code\"\n      ]\n    },\n    {\n      \"login\": \"yonestar\",\n      \"name\": \"Yoni Ashar\",\n      \"avatar_url\": \"https://avatars.githubusercontent.com/u/4513934?v=4\",\n      \"profile\": \"https://github.com/yonestar\",\n      \"contributions\": [\n        \"ideas\"\n      ]\n    },\n    {\n      \"login\": \"dkp\",\n      \"name\": \"dkp\",\n      \"avatar_url\": \"https://avatars.githubusercontent.com/u/965184?v=4\",\n      \"profile\": \"https://github.com/dkp\",\n      \"contributions\": [\n        \"bug\"\n      ]\n    },\n    {\n      \"login\": \"jdkent\",\n      \"name\": \"James Kent\",\n      \"avatar_url\": \"https://avatars.githubusercontent.com/u/12564882?v=4\",\n      \"profile\": \"https://jdkent.github.io/\",\n      \"contributions\": [\n        \"ideas\"\n      ]\n    },\n    {\n      \"login\": \"cfxb\",\n      \"name\": \"Chris Benjamin\",\n      \"avatar_url\": \"https://avatars.githubusercontent.com/u/39246257?v=4\",\n      \"profile\": \"https://github.com/cfxb\",\n      \"contributions\": [\n        \"doc\"\n      ]\n    },\n    {\n      \"login\": \"Islast\",\n      \"name\": \"Isla\",\n      \"avatar_url\": \"https://avatars.githubusercontent.com/u/23707851?v=4\",\n      \"profile\": \"http://isla.st\",\n      \"contributions\": [\n        \"doc\"\n      ]\n    },\n    {\n      \"login\": \"effigies\",\n      \"name\": \"Chris Markiewicz\",\n      \"avatar_url\": \"https://avatars.githubusercontent.com/u/83442?v=4\",\n      \"profile\": \"https://github.com/effigies\",\n      \"contributions\": [\n        \"doc\"\n      ]\n    },\n    {\n      \"login\": \"ankiitgupta7\",\n      \"name\": \"Ankit Gupta\",\n      \"avatar_url\": \"https://avatars.githubusercontent.com/u/25341569?v=4\",\n      \"profile\": \"https://ankiitgupta7.github.io/\",\n      \"contributions\": [\n        \"doc\"\n      ]\n    },\n    {\n      \"login\": \"alexvonlautz\",\n      \"name\": \"Alex von Lautz\",\n      \"avatar_url\": \"https://avatars.githubusercontent.com/u/44004062?v=4\",\n      \"profile\": \"https://github.com/alexvonlautz\",\n      \"contributions\": [\n        \"doc\"\n      ]\n    },\n    {\n      \"login\": \"AlexandreHutton\",\n      \"name\": \"Alexandre Hutton\",\n      \"avatar_url\": \"https://avatars.githubusercontent.com/u/50920802?v=4\",\n      \"profile\": \"https://github.com/AlexandreHutton\",\n      \"contributions\": [\n        \"doc\"\n      ]\n    },\n    {\n      \"login\": \"AbrrenC\",\n      \"name\": \"Abrren Chen\",\n      \"avatar_url\": \"https://avatars.githubusercontent.com/u/54808990?v=4\",\n      \"profile\": \"http://Abrren_Chen\",\n      \"contributions\": [\n        \"maintenance\"\n      ]\n    },\n    {\n      \"login\": \"Gabomfim\",\n      \"name\": \"Gabriel Silveira\",\n      \"avatar_url\": \"https://avatars.githubusercontent.com/u/21208915?v=4\",\n      \"profile\": \"http://gabrielabs.com\",\n      \"contributions\": [\n        \"bug\",\n        \"code\"\n      ]\n    },\n    {\n      \"login\": \"1nathanliang\",\n      \"name\": \"nathan liang\",\n      \"avatar_url\": \"https://avatars.githubusercontent.com/u/36468637?v=4\",\n      \"profile\": \"http://1nathanliang.github.io\",\n      \"contributions\": [\n        \"bug\"\n      ]\n    }\n  ],\n  \"contributorsPerLine\": 7,\n  \"projectName\": \"bids-starter-kit\",\n  \"projectOwner\": \"bids-standard\",\n  \"repoType\": \"github\",\n  \"repoHost\": \"https://github.com\",\n  \"skipCi\": true\n}\n"
  },
  {
    "path": ".github/workflows/deploy_book.yml",
    "content": "---\nname: deploy-book\n\nconcurrency:\n  group: ${{ github.workflow }}-${{ github.ref }}\n  cancel-in-progress: true\n\n# Only run this when the master branch changes\n\non:\n  push:\n    branches:\n    - main\n\n# This job installs dependencies, build the book, and pushes it to `gh-pages`\n\njobs:\n  deploy-book:\n    runs-on: ubuntu-latest\n\n    steps:\n    - uses: actions/checkout@v4\n      with:\n        submodules: recursive\n        fetch-depth: 0\n\n    # Install dependencies\n    - name: Set up Python\n      uses: actions/setup-python@v5\n      with:\n        python-version: '3.12'\n    - name: Install dependencies\n      run: pip install jupyter-book sphinx-reredirects\n\n    # Build the book\n    - name: Build the book\n      run: make book\n\n    # Push the book's HTML to github-pages\n    - name: GitHub Pages action\n      uses: peaceiris/actions-gh-pages@v4.0.0\n      with:\n        github_token: ${{ secrets.GITHUB_TOKEN }}\n        publish_dir: src/_build/html\n"
  },
  {
    "path": ".gitignore",
    "content": ".vscode/\n\n.DS_Store\n\nsrc/_build\n\ndesktop.ini\n\n.idea/\n\n# -----------------------------------------------------------------------------#\n\n## template MATLAB gitignore from\n# https://github.com/github/gitignore/blob/main/Global/MATLAB.gitignore\n\n# Windows default autosave extension\n*.asv\n\n# OSX / *nix default autosave extension\n*.m~\n\n# Compiled MEX binaries (all platforms)\n*.mex*\n\n# Packaged app and toolbox files\n*.mlappinstall\n*.mltbx\n\n# Generated helpsearch folders\nhelpsearch*/\n\n# Simulink code generation folders\nslprj/\nsccprj/\n\n# Matlab code generation folders\ncodegen/\n\n# Simulink autosave extension\n*.autosave\n\n# Simulink cache files\n*.slxc\n\n# Octave session info\noctave-workspace\n\n# -----------------------------------------------------------------------------#\n\n## template python gitignore from\n# https://github.com/github/gitignore/blob/main/Python.gitignore\n\n# Byte-compiled / optimized / DLL files\n__pycache__/\n*.py[cod]\n*$py.class\n\n# C extensions\n*.so\n\n# Distribution / packaging\n.Python\nbuild/\ndevelop-eggs/\ndist/\ndownloads/\neggs/\n.eggs/\nlib/\nlib64/\nparts/\nsdist/\nvar/\nwheels/\nshare/python-wheels/\n*.egg-info/\n.installed.cfg\n*.egg\nMANIFEST\n\n# PyInstaller\n#  Usually these files are written by a python script from a template\n#  before PyInstaller builds the exe, so as to inject date/other infos into it.\n*.manifest\n*.spec\n\n# Installer logs\npip-log.txt\npip-delete-this-directory.txt\n\n# Unit test / coverage reports\nhtmlcov/\n.tox/\n.nox/\n.coverage\n.coverage.*\n.cache\nnosetests.xml\ncoverage.xml\n*.cover\n*.py,cover\n.hypothesis/\n.pytest_cache/\ncover/\n\n# Translations\n*.mo\n*.pot\n\n# Django stuff:\n*.log\nlocal_settings.py\ndb.sqlite3\ndb.sqlite3-journal\n\n# Flask stuff:\ninstance/\n.webassets-cache\n\n# Scrapy stuff:\n.scrapy\n\n# Sphinx documentation\ndocs/_build/\n\n# PyBuilder\n.pybuilder/\ntarget/\n\n# Jupyter Notebook\n.ipynb_checkpoints\n\n# IPython\nprofile_default/\nipython_config.py\n\n# pyenv\n#   For a library or package, you might want to ignore these files since the code is\n#   intended to run in multiple environments; otherwise, check them in:\n# .python-version\n\n# pipenv\n#   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.\n#   However, in case of collaboration, if having platform-specific dependencies or dependencies\n#   having no cross-platform support, pipenv may install dependencies that don't work, or not\n#   install all needed dependencies.\n#Pipfile.lock\n\n# poetry\n#   Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.\n#   This is especially recommended for binary packages to ensure reproducibility, and is more\n#   commonly ignored for libraries.\n#   https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control\n#poetry.lock\n\n# PEP 582; used by e.g. github.com/David-OConnor/pyflow\n__pypackages__/\n\n# Celery stuff\ncelerybeat-schedule\ncelerybeat.pid\n\n# SageMath parsed files\n*.sage.py\n\n# Environments\n.env\n.venv\nenv/\nvenv/\nENV/\nenv.bak/\nvenv.bak/\n\n# Spyder project settings\n.spyderproject\n.spyproject\n\n# Rope project settings\n.ropeproject\n\n# mkdocs documentation\n/site\n\n# mypy\n.mypy_cache/\n.dmypy.json\ndmypy.json\n\n# Pyre type checker\n.pyre/\n\n# pytype static type analyzer\n.pytype/\n\n# Cython debug symbols\ncython_debug/\n\n# PyCharm\n#  JetBrains specific template is maintained in a separate JetBrains.gitignore that can\n#  be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore\n#  and can be added to the global gitignore or merged into this file.  For a more nuclear\n#  option (not recommended) you can uncomment the following to ignore the entire idea folder.\n#.idea/\n"
  },
  {
    "path": "LICENSE",
    "content": "Attribution 4.0 International\n\n=======================================================================\n\nCreative Commons Corporation (\"Creative Commons\") is not a law firm and\ndoes not provide legal services or legal advice. Distribution of\nCreative Commons public licenses does not create a lawyer-client or\nother relationship. Creative Commons makes its licenses and related\ninformation available on an \"as-is\" basis. Creative Commons gives no\nwarranties regarding its licenses, any material licensed under their\nterms and conditions, or any related information. Creative Commons\ndisclaims all liability for damages resulting from their use to the\nfullest extent possible.\n\nUsing Creative Commons Public Licenses\n\nCreative Commons public licenses provide a standard set of terms and\nconditions that creators and other rights holders may use to share\noriginal works of authorship and other material subject to copyright\nand certain other rights specified in the public license below. The\nfollowing considerations are for informational purposes only, are not\nexhaustive, and do not form part of our licenses.\n\n     Considerations for licensors: Our public licenses are\n     intended for use by those authorized to give the public\n     permission to use material in ways otherwise restricted by\n     copyright and certain other rights. Our licenses are\n     irrevocable. Licensors should read and understand the terms\n     and conditions of the license they choose before applying it.\n     Licensors should also secure all rights necessary before\n     applying our licenses so that the public can reuse the\n     material as expected. Licensors should clearly mark any\n     material not subject to the license. This includes other CC-\n     licensed material, or material used under an exception or\n     limitation to copyright. More considerations for licensors:\n\twiki.creativecommons.org/Considerations_for_licensors\n\n     Considerations for the public: By using one of our public\n     licenses, a licensor grants the public permission to use the\n     licensed material under specified terms and conditions. If\n     the licensor's permission is not necessary for any reason--for\n     example, because of any applicable exception or limitation to\n     copyright--then that use is not regulated by the license. Our\n     licenses grant only permissions under copyright and certain\n     other rights that a licensor has authority to grant. Use of\n     the licensed material may still be restricted for other\n     reasons, including because others have copyright or other\n     rights in the material. A licensor may make special requests,\n     such as asking that all changes be marked or described.\n     Although not required by our licenses, you are encouraged to\n     respect those requests where reasonable. More_considerations\n     for the public:\n\twiki.creativecommons.org/Considerations_for_licensees\n\n=======================================================================\n\nCreative Commons Attribution 4.0 International Public License\n\nBy exercising the Licensed Rights (defined below), You accept and agree\nto be bound by the terms and conditions of this Creative Commons\nAttribution 4.0 International Public License (\"Public License\"). To the\nextent this Public License may be interpreted as a contract, You are\ngranted the Licensed Rights in consideration of Your acceptance of\nthese terms and conditions, and the Licensor grants You such rights in\nconsideration of benefits the Licensor receives from making the\nLicensed Material available under these terms and conditions.\n\n\nSection 1 -- Definitions.\n\n  a. Adapted Material means material subject to Copyright and Similar\n     Rights that is derived from or based upon the Licensed Material\n     and in which the Licensed Material is translated, altered,\n     arranged, transformed, or otherwise modified in a manner requiring\n     permission under the Copyright and Similar Rights held by the\n     Licensor. For purposes of this Public License, where the Licensed\n     Material is a musical work, performance, or sound recording,\n     Adapted Material is always produced where the Licensed Material is\n     synched in timed relation with a moving image.\n\n  b. Adapter's License means the license You apply to Your Copyright\n     and Similar Rights in Your contributions to Adapted Material in\n     accordance with the terms and conditions of this Public License.\n\n  c. Copyright and Similar Rights means copyright and/or similar rights\n     closely related to copyright including, without limitation,\n     performance, broadcast, sound recording, and Sui Generis Database\n     Rights, without regard to how the rights are labeled or\n     categorized. For purposes of this Public License, the rights\n     specified in Section 2(b)(1)-(2) are not Copyright and Similar\n     Rights.\n\n  d. Effective Technological Measures means those measures that, in the\n     absence of proper authority, may not be circumvented under laws\n     fulfilling obligations under Article 11 of the WIPO Copyright\n     Treaty adopted on December 20, 1996, and/or similar international\n     agreements.\n\n  e. Exceptions and Limitations means fair use, fair dealing, and/or\n     any other exception or limitation to Copyright and Similar Rights\n     that applies to Your use of the Licensed Material.\n\n  f. Licensed Material means the artistic or literary work, database,\n     or other material to which the Licensor applied this Public\n     License.\n\n  g. Licensed Rights means the rights granted to You subject to the\n     terms and conditions of this Public License, which are limited to\n     all Copyright and Similar Rights that apply to Your use of the\n     Licensed Material and that the Licensor has authority to license.\n\n  h. Licensor means the individual(s) or entity(ies) granting rights\n     under this Public License.\n\n  i. Share means to provide material to the public by any means or\n     process that requires permission under the Licensed Rights, such\n     as reproduction, public display, public performance, distribution,\n     dissemination, communication, or importation, and to make material\n     available to the public including in ways that members of the\n     public may access the material from a place and at a time\n     individually chosen by them.\n\n  j. Sui Generis Database Rights means rights other than copyright\n     resulting from Directive 96/9/EC of the European Parliament and of\n     the Council of 11 March 1996 on the legal protection of databases,\n     as amended and/or succeeded, as well as other essentially\n     equivalent rights anywhere in the world.\n\n  k. You means the individual or entity exercising the Licensed Rights\n     under this Public License. Your has a corresponding meaning.\n\n\nSection 2 -- Scope.\n\n  a. License grant.\n\n       1. Subject to the terms and conditions of this Public License,\n          the Licensor hereby grants You a worldwide, royalty-free,\n          non-sublicensable, non-exclusive, irrevocable license to\n          exercise the Licensed Rights in the Licensed Material to:\n\n            a. reproduce and Share the Licensed Material, in whole or\n               in part; and\n\n            b. produce, reproduce, and Share Adapted Material.\n\n       2. Exceptions and Limitations. For the avoidance of doubt, where\n          Exceptions and Limitations apply to Your use, this Public\n          License does not apply, and You do not need to comply with\n          its terms and conditions.\n\n       3. Term. The term of this Public License is specified in Section\n          6(a).\n\n       4. Media and formats; technical modifications allowed. The\n          Licensor authorizes You to exercise the Licensed Rights in\n          all media and formats whether now known or hereafter created,\n          and to make technical modifications necessary to do so. The\n          Licensor waives and/or agrees not to assert any right or\n          authority to forbid You from making technical modifications\n          necessary to exercise the Licensed Rights, including\n          technical modifications necessary to circumvent Effective\n          Technological Measures. For purposes of this Public License,\n          simply making modifications authorized by this Section 2(a)\n          (4) never produces Adapted Material.\n\n       5. Downstream recipients.\n\n            a. Offer from the Licensor -- Licensed Material. Every\n               recipient of the Licensed Material automatically\n               receives an offer from the Licensor to exercise the\n               Licensed Rights under the terms and conditions of this\n               Public License.\n\n            b. No downstream restrictions. You may not offer or impose\n               any additional or different terms or conditions on, or\n               apply any Effective Technological Measures to, the\n               Licensed Material if doing so restricts exercise of the\n               Licensed Rights by any recipient of the Licensed\n               Material.\n\n       6. No endorsement. Nothing in this Public License constitutes or\n          may be construed as permission to assert or imply that You\n          are, or that Your use of the Licensed Material is, connected\n          with, or sponsored, endorsed, or granted official status by,\n          the Licensor or others designated to receive attribution as\n          provided in Section 3(a)(1)(A)(i).\n\n  b. Other rights.\n\n       1. Moral rights, such as the right of integrity, are not\n          licensed under this Public License, nor are publicity,\n          privacy, and/or other similar personality rights; however, to\n          the extent possible, the Licensor waives and/or agrees not to\n          assert any such rights held by the Licensor to the limited\n          extent necessary to allow You to exercise the Licensed\n          Rights, but not otherwise.\n\n       2. Patent and trademark rights are not licensed under this\n          Public License.\n\n       3. To the extent possible, the Licensor waives any right to\n          collect royalties from You for the exercise of the Licensed\n          Rights, whether directly or through a collecting society\n          under any voluntary or waivable statutory or compulsory\n          licensing scheme. In all other cases the Licensor expressly\n          reserves any right to collect such royalties.\n\n\nSection 3 -- License Conditions.\n\nYour exercise of the Licensed Rights is expressly made subject to the\nfollowing conditions.\n\n  a. Attribution.\n\n       1. If You Share the Licensed Material (including in modified\n          form), You must:\n\n            a. retain the following if it is supplied by the Licensor\n               with the Licensed Material:\n\n                 i. identification of the creator(s) of the Licensed\n                    Material and any others designated to receive\n                    attribution, in any reasonable manner requested by\n                    the Licensor (including by pseudonym if\n                    designated);\n\n                ii. a copyright notice;\n\n               iii. a notice that refers to this Public License;\n\n                iv. a notice that refers to the disclaimer of\n                    warranties;\n\n                 v. a URI or hyperlink to the Licensed Material to the\n                    extent reasonably practicable;\n\n            b. indicate if You modified the Licensed Material and\n               retain an indication of any previous modifications; and\n\n            c. indicate the Licensed Material is licensed under this\n               Public License, and include the text of, or the URI or\n               hyperlink to, this Public License.\n\n       2. You may satisfy the conditions in Section 3(a)(1) in any\n          reasonable manner based on the medium, means, and context in\n          which You Share the Licensed Material. For example, it may be\n          reasonable to satisfy the conditions by providing a URI or\n          hyperlink to a resource that includes the required\n          information.\n\n       3. If requested by the Licensor, You must remove any of the\n          information required by Section 3(a)(1)(A) to the extent\n          reasonably practicable.\n\n       4. If You Share Adapted Material You produce, the Adapter's\n          License You apply must not prevent recipients of the Adapted\n          Material from complying with this Public License.\n\n\nSection 4 -- Sui Generis Database Rights.\n\nWhere the Licensed Rights include Sui Generis Database Rights that\napply to Your use of the Licensed Material:\n\n  a. for the avoidance of doubt, Section 2(a)(1) grants You the right\n     to extract, reuse, reproduce, and Share all or a substantial\n     portion of the contents of the database;\n\n  b. if You include all or a substantial portion of the database\n     contents in a database in which You have Sui Generis Database\n     Rights, then the database in which You have Sui Generis Database\n     Rights (but not its individual contents) is Adapted Material; and\n\n  c. You must comply with the conditions in Section 3(a) if You Share\n     all or a substantial portion of the contents of the database.\n\nFor the avoidance of doubt, this Section 4 supplements and does not\nreplace Your obligations under this Public License where the Licensed\nRights include other Copyright and Similar Rights.\n\n\nSection 5 -- Disclaimer of Warranties and Limitation of Liability.\n\n  a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE\n     EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS\n     AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF\n     ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,\n     IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,\n     WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR\n     PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,\n     ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT\n     KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT\n     ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.\n\n  b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE\n     TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,\n     NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,\n     INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,\n     COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR\n     USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN\n     ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR\n     DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR\n     IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.\n\n  c. The disclaimer of warranties and limitation of liability provided\n     above shall be interpreted in a manner that, to the extent\n     possible, most closely approximates an absolute disclaimer and\n     waiver of all liability.\n\n\nSection 6 -- Term and Termination.\n\n  a. This Public License applies for the term of the Copyright and\n     Similar Rights licensed here. However, if You fail to comply with\n     this Public License, then Your rights under this Public License\n     terminate automatically.\n\n  b. Where Your right to use the Licensed Material has terminated under\n     Section 6(a), it reinstates:\n\n       1. automatically as of the date the violation is cured, provided\n          it is cured within 30 days of Your discovery of the\n          violation; or\n\n       2. upon express reinstatement by the Licensor.\n\n     For the avoidance of doubt, this Section 6(b) does not affect any\n     right the Licensor may have to seek remedies for Your violations\n     of this Public License.\n\n  c. For the avoidance of doubt, the Licensor may also offer the\n     Licensed Material under separate terms or conditions or stop\n     distributing the Licensed Material at any time; however, doing so\n     will not terminate this Public License.\n\n  d. Sections 1, 5, 6, 7, and 8 survive termination of this Public\n     License.\n\n\nSection 7 -- Other Terms and Conditions.\n\n  a. The Licensor shall not be bound by any additional or different\n     terms or conditions communicated by You unless expressly agreed.\n\n  b. Any arrangements, understandings, or agreements regarding the\n     Licensed Material not stated herein are separate from and\n     independent of the terms and conditions of this Public License.\n\n\nSection 8 -- Interpretation.\n\n  a. For the avoidance of doubt, this Public License does not, and\n     shall not be interpreted to, reduce, limit, restrict, or impose\n     conditions on any use of the Licensed Material that could lawfully\n     be made without permission under this Public License.\n\n  b. To the extent possible, if any provision of this Public License is\n     deemed unenforceable, it shall be automatically reformed to the\n     minimum extent necessary to make it enforceable. If the provision\n     cannot be reformed, it shall be severed from this Public License\n     without affecting the enforceability of the remaining terms and\n     conditions.\n\n  c. No term or condition of this Public License will be waived and no\n     failure to comply consented to unless expressly agreed to by the\n     Licensor.\n\n  d. Nothing in this Public License constitutes or may be interpreted\n     as a limitation upon, or waiver of, any privileges and immunities\n     that apply to the Licensor or You, including from the legal\n     processes of any jurisdiction or authority.\n\n\n=======================================================================\n\nCreative Commons is not a party to its public\nlicenses. Notwithstanding, Creative Commons may elect to apply one of\nits public licenses to material it publishes and in those instances\nwill be considered the “Licensor.” The text of the Creative Commons\npublic licenses is dedicated to the public domain under the CC0 Public\nDomain Dedication. Except for the limited purpose of indicating that\nmaterial is shared under a Creative Commons public license or as\notherwise permitted by the Creative Commons policies published at\ncreativecommons.org/policies, Creative Commons does not authorize the\nuse of the trademark \"Creative Commons\" or any other trademark or logo\nof Creative Commons without its prior written consent including,\nwithout limitation, in connection with any unauthorized modifications\nto any of its public licenses or any other arrangements,\nunderstandings, or agreements concerning use of licensed material. For\nthe avoidance of doubt, this paragraph does not form part of the\npublic licenses.\n\nCreative Commons may be contacted at creativecommons.org.\n"
  },
  {
    "path": "Makefile",
    "content": ".PHONY: all clean\n\ndefine BROWSER_PYSCRIPT\nimport os, webbrowser, sys\n\nfrom urllib.request import pathname2url\n\nwebbrowser.open(\"file://\" + pathname2url(os.path.abspath(sys.argv[1])))\nendef\nexport BROWSER_PYSCRIPT\n\ndefine PRINT_HELP_PYSCRIPT\nimport re, sys\n\nfor line in sys.stdin:\n\tmatch = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line)\n\tif match:\n\t\ttarget, help = match.groups()\n\t\tprint(\"%-20s %s\" % (target, help))\nendef\nexport PRINT_HELP_PYSCRIPT\n\nBROWSER := python -c \"$$BROWSER_PYSCRIPT\"\n\n# Put it first so that \"make\" without argument is like \"make help\".\nhelp:\n\t@python -c \"$$PRINT_HELP_PYSCRIPT\" < $(MAKEFILE_LIST)\n\nclean:\n\trm -fr src/_build/\n\nbook: clean ## build the book\n\tjupyter-book build src\n\nview: book ## view the book\n\t$(BROWSER) $$PWD/src/_build/html/index.html\n\ntest: ## build the book and tests the links\n\tjupyter-book build src --builder linkcheck\n"
  },
  {
    "path": "README.md",
    "content": "<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->\n[![All Contributors](https://img.shields.io/badge/all_contributors-43-orange.svg?style=flat-square)](#contributors-)\n<!-- ALL-CONTRIBUTORS-BADGE:END -->\n\n# The Starter-kit has moved to the <a href=\"https://bids.neuroimaging.io/getting_started/\" target=\"_blank\">new BIDS website</a>.\n\n## Contributors ✨\n\nThanks goes to these wonderful people\n([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- prettier-ignore-start -->\n<!-- markdownlint-disable -->\n<table>\n  <tr>\n    <td align=\"center\"><a href=\"https://github.com/dorahermes\"><img src=\"https://avatars1.githubusercontent.com/u/4977351?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Dora Hermes</b></sub></a><br /><a href=\"https://github.com/bids-standard/bids-starter-kit/commits?author=dorahermes\" title=\"Code\">💻</a> <a href=\"#content-dorahermes\" title=\"Content\">🖋</a> <a href=\"#ideas-dorahermes\" title=\"Ideas, Planning, & Feedback\">🤔</a> <a href=\"https://github.com/bids-standard/bids-starter-kit/pulls?q=is%3Apr+reviewed-by%3Adorahermes\" title=\"Reviewed Pull Requests\">👀</a> <a href=\"#maintenance-dorahermes\" title=\"Maintenance\">🚧</a> <a href=\"https://github.com/bids-standard/bids-starter-kit/commits?author=dorahermes\" title=\"Documentation\">📖</a></td>\n    <td align=\"center\"><a href=\"http://chrisgorgolewski.org\"><img src=\"https://avatars2.githubusercontent.com/u/238759?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Chris Gorgolewski</b></sub></a><br /><a href=\"https://github.com/bids-standard/bids-starter-kit/pulls?q=is%3Apr+reviewed-by%3Achrisgorgo\" title=\"Reviewed Pull Requests\">👀</a> <a href=\"#maintenance-chrisgorgo\" title=\"Maintenance\">🚧</a> <a href=\"https://github.com/bids-standard/bids-starter-kit/issues?q=author%3Achrisgorgo\" title=\"Bug reports\">🐛</a></td>\n    <td align=\"center\"><a href=\"http://chrisholdgraf.com\"><img src=\"https://avatars1.githubusercontent.com/u/1839645?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Chris Holdgraf</b></sub></a><br /><a href=\"https://github.com/bids-standard/bids-starter-kit/pulls?q=is%3Apr+reviewed-by%3Acholdgraf\" title=\"Reviewed Pull Requests\">👀</a> <a href=\"#content-choldgraf\" title=\"Content\">🖋</a> <a href=\"#maintenance-choldgraf\" title=\"Maintenance\">🚧</a></td>\n    <td align=\"center\"><a href=\"https://chrisgahnstrom.wordpress.com/\"><img src=\"https://avatars1.githubusercontent.com/u/12600386?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Chris Gahnström</b></sub></a><br /><a href=\"https://github.com/bids-standard/bids-starter-kit/commits?author=cofficer\" title=\"Code\">💻</a> <a href=\"#content-cofficer\" title=\"Content\">🖋</a> <a href=\"#ideas-cofficer\" title=\"Ideas, Planning, & Feedback\">🤔</a></td>\n    <td align=\"center\"><a href=\"http://emdupre.me\"><img src=\"https://avatars3.githubusercontent.com/u/15017191?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Elizabeth DuPre</b></sub></a><br /><a href=\"https://github.com/bids-standard/bids-starter-kit/pulls?q=is%3Apr+reviewed-by%3Aemdupre\" title=\"Reviewed Pull Requests\">👀</a> <a href=\"#maintenance-emdupre\" title=\"Maintenance\">🚧</a> <a href=\"#ideas-emdupre\" title=\"Ideas, Planning, & Feedback\">🤔</a> <a href=\"#content-emdupre\" title=\"Content\">🖋</a> <a href=\"https://github.com/bids-standard/bids-starter-kit/commits?author=emdupre\" title=\"Documentation\">📖</a></td>\n    <td align=\"center\"><a href=\"https://github.com/anushkab\"><img src=\"https://avatars0.githubusercontent.com/u/20943511?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Utmost Happiness</b></sub></a><br /><a href=\"https://github.com/bids-standard/bids-starter-kit/commits?author=anushkab\" title=\"Code\">💻</a> <a href=\"#content-anushkab\" title=\"Content\">🖋</a> <a href=\"#ideas-anushkab\" title=\"Ideas, Planning, & Feedback\">🤔</a></td>\n    <td align=\"center\"><a href=\"https://whitakerlab.github.io\"><img src=\"https://avatars1.githubusercontent.com/u/3626306?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Kirstie Whitaker</b></sub></a><br /><a href=\"https://github.com/bids-standard/bids-starter-kit/pulls?q=is%3Apr+reviewed-by%3AKirstieJane\" title=\"Reviewed Pull Requests\">👀</a> <a href=\"#ideas-KirstieJane\" title=\"Ideas, Planning, & Feedback\">🤔</a> <a href=\"#maintenance-KirstieJane\" title=\"Maintenance\">🚧</a> <a href=\"#content-KirstieJane\" title=\"Content\">🖋</a> <a href=\"https://github.com/bids-standard/bids-starter-kit/commits?author=KirstieJane\" title=\"Documentation\">📖</a> <a href=\"https://github.com/bids-standard/bids-starter-kit/issues?q=author%3AKirstieJane\" title=\"Bug reports\">🐛</a></td>\n  </tr>\n  <tr>\n    <td align=\"center\"><a href=\"https://github.com/Park-Patrick\"><img src=\"https://avatars3.githubusercontent.com/u/12662110?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Patrick Park</b></sub></a><br /><a href=\"#ideas-Park-Patrick\" title=\"Ideas, Planning, & Feedback\">🤔</a> <a href=\"#content-Park-Patrick\" title=\"Content\">🖋</a> <a href=\"https://github.com/bids-standard/bids-starter-kit/pulls?q=is%3Apr+reviewed-by%3APark-Patrick\" title=\"Reviewed Pull Requests\">👀</a></td>\n    <td align=\"center\"><a href=\"http://peerherholz.github.io\"><img src=\"https://avatars0.githubusercontent.com/u/20129524?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Peer Herholz</b></sub></a><br /><a href=\"https://github.com/bids-standard/bids-starter-kit/commits?author=PeerHerholz\" title=\"Code\">💻</a></td>\n    <td align=\"center\"><a href=\"http://www.sbirc.ed.ac.uk/cyril/\"><img src=\"https://avatars2.githubusercontent.com/u/4772878?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Cyril Pernet</b></sub></a><br /><a href=\"https://github.com/bids-standard/bids-starter-kit/commits?author=CPernet\" title=\"Code\">💻</a></td>\n    <td align=\"center\"><a href=\"https://www.stefanappelhoff.com\"><img src=\"https://avatars1.githubusercontent.com/u/9084751?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Stefan Appelhoff</b></sub></a><br /><a href=\"https://github.com/bids-standard/bids-starter-kit/pulls?q=is%3Apr+reviewed-by%3Asappelhoff\" title=\"Reviewed Pull Requests\">👀</a> <a href=\"https://github.com/bids-standard/bids-starter-kit/commits?author=sappelhoff\" title=\"Code\">💻</a> <a href=\"#content-sappelhoff\" title=\"Content\">🖋</a> <a href=\"#ideas-sappelhoff\" title=\"Ideas, Planning, & Feedback\">🤔</a></td>\n    <td align=\"center\"><a href=\"https://ilkayisik.github.io\"><img src=\"https://avatars1.githubusercontent.com/u/22478219?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Ilkay Isik</b></sub></a><br /><a href=\"https://github.com/bids-standard/bids-starter-kit/issues?q=author%3Ailkayisik\" title=\"Bug reports\">🐛</a></td>\n    <td align=\"center\"><a href=\"https://teonbrooks.com\"><img src=\"https://avatars1.githubusercontent.com/u/1578674?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Teon L Brooks</b></sub></a><br /><a href=\"https://github.com/bids-standard/bids-starter-kit/issues?q=author%3Ateonbrooks\" title=\"Bug reports\">🐛</a></td>\n    <td align=\"center\"><a href=\"https://github.com/bayab\"><img src=\"https://avatars0.githubusercontent.com/u/16117420?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>ayab</b></sub></a><br /><a href=\"#content-bayab\" title=\"Content\">🖋</a></td>\n  </tr>\n  <tr>\n    <td align=\"center\"><a href=\"https://remi-gau.github.io/\"><img src=\"https://avatars3.githubusercontent.com/u/6961185?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Remi Gau</b></sub></a><br /><a href=\"#content-Remi-Gau\" title=\"Content\">🖋</a></td>\n    <td align=\"center\"><a href=\"https://github.com/JaapVanDerAar\"><img src=\"https://avatars3.githubusercontent.com/u/32334327?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Jaap van der Aar</b></sub></a><br /><a href=\"https://github.com/bids-standard/bids-starter-kit/commits?author=JaapVanDerAar\" title=\"Code\">💻</a> <a href=\"#content-JaapVanDerAar\" title=\"Content\">🖋</a> <a href=\"#ideas-JaapVanDerAar\" title=\"Ideas, Planning, & Feedback\">🤔</a></td>\n    <td align=\"center\"><a href=\"https://github.com/GiulioCastegnaro\"><img src=\"https://avatars2.githubusercontent.com/u/45361920?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Giulio Castegnaro</b></sub></a><br /><a href=\"https://github.com/bids-standard/bids-starter-kit/commits?author=GiulioCastegnaro\" title=\"Code\">💻</a> <a href=\"#content-GiulioCastegnaro\" title=\"Content\">🖋</a> <a href=\"#ideas-GiulioCastegnaro\" title=\"Ideas, Planning, & Feedback\">🤔</a></td>\n    <td align=\"center\"><a href=\"https://github.com/franklin-feingold\"><img src=\"https://avatars1.githubusercontent.com/u/35307458?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Franklin Feingold</b></sub></a><br /><a href=\"https://github.com/bids-standard/bids-starter-kit/issues?q=author%3Afranklin-feingold\" title=\"Bug reports\">🐛</a> <a href=\"https://github.com/bids-standard/bids-starter-kit/pulls?q=is%3Apr+reviewed-by%3Afranklin-feingold\" title=\"Reviewed Pull Requests\">👀</a></td>\n    <td align=\"center\"><a href=\"http://www.nisox.org\"><img src=\"https://avatars3.githubusercontent.com/u/5155907?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Thomas Nichols</b></sub></a><br /><a href=\"https://github.com/bids-standard/bids-starter-kit/pulls?q=is%3Apr+reviewed-by%3Anicholst\" title=\"Reviewed Pull Requests\">👀</a></td>\n    <td align=\"center\"><a href=\"https://github.com/pvdemael\"><img src=\"https://avatars1.githubusercontent.com/u/37624277?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Pieter Vandemaele</b></sub></a><br /><a href=\"https://github.com/bids-standard/bids-starter-kit/issues?q=author%3Apvdemael\" title=\"Bug reports\">🐛</a></td>\n    <td align=\"center\"><a href=\"https://github.com/gllmflndn\"><img src=\"https://avatars0.githubusercontent.com/u/5950855?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Guillaume Flandin</b></sub></a><br /><a href=\"https://github.com/bids-standard/bids-starter-kit/pulls?q=is%3Apr+reviewed-by%3Agllmflndn\" title=\"Reviewed Pull Requests\">👀</a> <a href=\"#ideas-gllmflndn\" title=\"Ideas, Planning, & Feedback\">🤔</a></td>\n  </tr>\n  <tr>\n    <td align=\"center\"><a href=\"https://github.com/robertoostenveld\"><img src=\"https://avatars1.githubusercontent.com/u/899043?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Robert Oostenveld</b></sub></a><br /><a href=\"https://github.com/bids-standard/bids-starter-kit/issues?q=author%3Arobertoostenveld\" title=\"Bug reports\">🐛</a> <a href=\"https://github.com/bids-standard/bids-starter-kit/pulls?q=is%3Apr+reviewed-by%3Arobertoostenveld\" title=\"Reviewed Pull Requests\">👀</a> <a href=\"#ideas-robertoostenveld\" title=\"Ideas, Planning, & Feedback\">🤔</a></td>\n    <td align=\"center\"><a href=\"https://github.com/HappyFacade\"><img src=\"https://avatars0.githubusercontent.com/u/54226355?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Happy</b></sub></a><br /><a href=\"#content-HappyFacade\" title=\"Content\">🖋</a></td>\n    <td align=\"center\"><a href=\"https://www.linkedin.com/in/tal-pal-attia-201373b0/\"><img src=\"https://avatars1.githubusercontent.com/u/24300712?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Tal Pal Attia</b></sub></a><br /><a href=\"https://github.com/bids-standard/bids-starter-kit/commits?author=tpatpa\" title=\"Code\">💻</a></td>\n    <td align=\"center\"><a href=\"https://github.com/VisLab\"><img src=\"https://avatars1.githubusercontent.com/u/1189050?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Kay Robbins</b></sub></a><br /><a href=\"#ideas-VisLab\" title=\"Ideas, Planning, & Feedback\">🤔</a> <a href=\"#content-VisLab\" title=\"Content\">🖋</a></td>\n    <td align=\"center\"><a href=\"https://erasmus-synclab.nl/\"><img src=\"https://avatars1.githubusercontent.com/u/41283173?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Eduard Klapwijk</b></sub></a><br /><a href=\"#ideas-eduardklap\" title=\"Ideas, Planning, & Feedback\">🤔</a></td>\n    <td align=\"center\"><a href=\"https://github.com/DorienHuijser\"><img src=\"https://avatars1.githubusercontent.com/u/58177697?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Dorien Huijser</b></sub></a><br /><a href=\"#ideas-DorienHuijser\" title=\"Ideas, Planning, & Feedback\">🤔</a></td>\n    <td align=\"center\"><a href=\"http://cmn.nimh.nih.gov/dsst\"><img src=\"https://avatars1.githubusercontent.com/u/10297203?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Arshitha Basavaraj</b></sub></a><br /><a href=\"#ideas-Arshitha\" title=\"Ideas, Planning, & Feedback\">🤔</a></td>\n  </tr>\n  <tr>\n    <td align=\"center\"><a href=\"https://lennartwittkuhn.com\"><img src=\"https://avatars0.githubusercontent.com/u/42233065?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Lennart Wittkuhn</b></sub></a><br /><a href=\"#ideas-lnnrtwttkhn\" title=\"Ideas, Planning, & Feedback\">🤔</a></td>\n    <td align=\"center\"><a href=\"https://github.com/bendhouseart\"><img src=\"https://avatars.githubusercontent.com/u/28850131?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Anthony Galassi</b></sub></a><br /><a href=\"#ideas-bendhouseart\" title=\"Ideas, Planning, & Feedback\">🤔</a> <a href=\"https://github.com/bids-standard/bids-starter-kit/commits?author=bendhouseart\" title=\"Code\">💻</a></td>\n    <td align=\"center\"><a href=\"http://DrMowinckels.io\"><img src=\"https://avatars.githubusercontent.com/u/14014329?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Athanasia Monika Mowinckel</b></sub></a><br /><a href=\"#ideas-Athanasiamo\" title=\"Ideas, Planning, & Feedback\">🤔</a> <a href=\"https://github.com/bids-standard/bids-starter-kit/commits?author=Athanasiamo\" title=\"Code\">💻</a></td>\n    <td align=\"center\"><a href=\"https://github.com/yonestar\"><img src=\"https://avatars.githubusercontent.com/u/4513934?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Yoni Ashar</b></sub></a><br /><a href=\"#ideas-yonestar\" title=\"Ideas, Planning, & Feedback\">🤔</a></td>\n    <td align=\"center\"><a href=\"https://github.com/dkp\"><img src=\"https://avatars.githubusercontent.com/u/965184?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>dkp</b></sub></a><br /><a href=\"https://github.com/bids-standard/bids-starter-kit/issues?q=author%3Adkp\" title=\"Bug reports\">🐛</a></td>\n    <td align=\"center\"><a href=\"https://jdkent.github.io/\"><img src=\"https://avatars.githubusercontent.com/u/12564882?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>James Kent</b></sub></a><br /><a href=\"#ideas-jdkent\" title=\"Ideas, Planning, & Feedback\">🤔</a></td>\n    <td align=\"center\"><a href=\"https://github.com/cfxb\"><img src=\"https://avatars.githubusercontent.com/u/39246257?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Chris Benjamin</b></sub></a><br /><a href=\"https://github.com/bids-standard/bids-starter-kit/commits?author=cfxb\" title=\"Documentation\">📖</a></td>\n  </tr>\n  <tr>\n    <td align=\"center\"><a href=\"http://isla.st\"><img src=\"https://avatars.githubusercontent.com/u/23707851?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Isla</b></sub></a><br /><a href=\"https://github.com/bids-standard/bids-starter-kit/commits?author=Islast\" title=\"Documentation\">📖</a></td>\n    <td align=\"center\"><a href=\"https://github.com/effigies\"><img src=\"https://avatars.githubusercontent.com/u/83442?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Chris Markiewicz</b></sub></a><br /><a href=\"https://github.com/bids-standard/bids-starter-kit/commits?author=effigies\" title=\"Documentation\">📖</a></td>\n    <td align=\"center\"><a href=\"https://ankiitgupta7.github.io/\"><img src=\"https://avatars.githubusercontent.com/u/25341569?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Ankit Gupta</b></sub></a><br /><a href=\"https://github.com/bids-standard/bids-starter-kit/commits?author=ankiitgupta7\" title=\"Documentation\">📖</a></td>\n    <td align=\"center\"><a href=\"https://github.com/alexvonlautz\"><img src=\"https://avatars.githubusercontent.com/u/44004062?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Alex von Lautz</b></sub></a><br /><a href=\"https://github.com/bids-standard/bids-starter-kit/commits?author=alexvonlautz\" title=\"Documentation\">📖</a></td>\n    <td align=\"center\"><a href=\"https://github.com/AlexandreHutton\"><img src=\"https://avatars.githubusercontent.com/u/50920802?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Alexandre Hutton</b></sub></a><br /><a href=\"https://github.com/bids-standard/bids-starter-kit/commits?author=AlexandreHutton\" title=\"Documentation\">📖</a></td>\n    <td align=\"center\"><a href=\"http://Abrren_Chen\"><img src=\"https://avatars.githubusercontent.com/u/54808990?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Abrren Chen</b></sub></a><br /><a href=\"#maintenance-AbrrenC\" title=\"Maintenance\">🚧</a></td>\n    <td align=\"center\"><a href=\"http://gabrielabs.com\"><img src=\"https://avatars.githubusercontent.com/u/21208915?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>Gabriel Silveira</b></sub></a><br /><a href=\"https://github.com/bids-standard/bids-starter-kit/issues?q=author%3AGabomfim\" title=\"Bug reports\">🐛</a> <a href=\"https://github.com/bids-standard/bids-starter-kit/commits?author=Gabomfim\" title=\"Code\">💻</a></td>\n  </tr>\n  <tr>\n    <td align=\"center\"><a href=\"http://1nathanliang.github.io\"><img src=\"https://avatars.githubusercontent.com/u/36468637?v=4?s=100\" width=\"100px;\" alt=\"\"/><br /><sub><b>nathan liang</b></sub></a><br /><a href=\"https://github.com/bids-standard/bids-starter-kit/issues?q=author%3A1nathanliang\" title=\"Bug reports\">🐛</a></td>\n  </tr>\n</table>\n\n<!-- markdownlint-restore -->\n<!-- prettier-ignore-end -->\n\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n\nThis project follows the\n[all-contributors](https://github.com/all-contributors/all-contributors)\nspecification. Contributions of any kind welcome!\n"
  },
  {
    "path": "interactiveTreeVisualization/epilepsyClassification2017/tree.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n    <meta charset=\"utf-8\">\n\n    <title>ILAE classification of the epilepsies Tree</title>\n\n    <link rel=\"stylesheet\" href=\"./treeStyle.css\">\n\n</head>\n\n<header>\n    <h1 align=\"center\">ILAE classification of the epilepsies Tree</h1>\n\n    <p align=\"center\">Scheffer, I. E., Berkovic, S., Capovilla, G., Connolly, M. B., French, J., Guilhoto, L., ... &\n        Nordli, D. R. (2017). ILAE classification of the epilepsies: position paper of the ILAE Commission for\n        Classification and Terminology. Epilepsia, 58(4), 512-521.</p>\n\n    <p align=\"center\">\n        <button class=\"button\" onclick=\"expandAll()\">Expand All</button>\n        &nbsp;&nbsp;&nbsp;&nbsp;\n        <button class=\"button\" onclick=\"collapseAll()\">Collapse All</button>\n    </p>\n</header>\n\n<body>\n\n    <!-- load the d3.js library -->\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.min.js\"></script>\n\n    <!-- load tree data -->\n    <script src=\"./treeData.js\"></script>\n\n    <!-- load tree functions -->\n    <script src=\"./treeFunctions.js\"></script>\n\n\n</body>\n\n<footer>\n</footer>\n\n</html>\n\n<!--\n    References:\n\n    Scheffer, I. E., Berkovic, S., Capovilla, G., Connolly, M. B., French, J., Guilhoto, L., ... & Nordli, D. R. (2017). ILAE classification of the epilepsies: position paper of the ILAE Commission for Classification and Terminology. Epilepsia, 58(4), 512-521.\n        https://onlinelibrary.wiley.com/doi/full/10.1111/epi.13709\n\n    Simple d3.js tree diagram -\n        https://bl.ocks.org/d3noob/8323795\n\n    Interactive d3.js tree diagram -\n        https://bl.ocks.org/d3noob/8375092\n\n    Export SVG D3 visualization to PNG or JPEG -\n        http://bl.ocks.org/Rokotyan/0556f8facbaf344507cdc45dc3622177\n\n    d3-hierarchy -\n        https://github.com/d3/d3-hierarchy/blob/v1.1.8/README.md#tree\n\n\n\n-->\n"
  },
  {
    "path": "interactiveTreeVisualization/epilepsyClassification2017/treeData.js",
    "content": "var treeData = [{\n    \"name\": \"Epilepsy Classification\",\n    \"parent\": \"null\",\n    \"_children\": [\n\n        // ****** Seizure Type ******\n\n        {\n            \"name\": \"Seizure Type\",\n            \"parent\": \"Epilepsy Classification\",\n            \"_children\": [\n\n                // *** Generalised ***\n                {\n                    \"name\": \"Generalised\",\n                    \"parent\": \"Seizure Type\",\n                    \"_children\": [{\n                            \"name\": \"Motor\",\n                            \"parent\": \"Generalised\",\n                            \"_children\": [{\n                                    \"name\": \"Generalized tonic-clonic and variants\",\n                                    \"parent\": \"Motor\"\n                                },\n                                {\n                                    \"name\": \"Generalized tonic\",\n                                    \"parent\": \"Motor\"\n                                },\n                                {\n                                    \"name\": \"Generalized atonic\",\n                                    \"parent\": \"Motor\"\n                                },\n                                {\n                                    \"name\": \"Myoclonic\",\n                                    \"parent\": \"Motor\"\n                                },\n                                {\n                                    \"name\": \"Myoclonic-atonic\",\n                                    \"parent\": \"Motor\"\n                                },\n                                {\n                                    \"name\": \"Epileptic spasms\",\n                                    \"parent\": \"Motor\"\n                                }\n                            ]\n                        },\n                        {\n                            \"name\": \"Non-motor\",\n                            \"parent\": \"Generalised\",\n                            \"_children\": [{\n                                \"name\": \"Typical Absence\",\n                                \"parent\": \"Non-motor\"\n                            }, {\n                                \"name\": \"Atypical Absence\",\n                                \"parent\": \"Non-motor\"\n                            }, {\n                                \"name\": \"Myoclonic absence\",\n                                \"parent\": \"Non-motor\"\n                            }, {\n                                \"name\": \"Absence with eyelid myoclonia\",\n                                \"parent\": \"Non-motor\"\n                            }]\n                        }\n                    ]\n                },\n\n                // *** Focal ***\n                {\n                    \"name\": \"Focal\",\n                    \"parent\": \"Seizure Type\",\n                    \"_children\": [{\n                            \"name\": \"Awareness\",\n                            \"parent\": \"Focal\",\n                            \"_children\": [{\n                                \"name\": \"Aware\",\n                                \"parent\": \"Awareness\",\n                            }, {\n                                \"name\": \"Impaired Awareness\",\n                                \"parent\": \"Awareness\",\n                            }]\n                        },\n                        {\n                            \"name\": \"Motor\",\n                            \"parent\": \"Focal\",\n                            \"_children\": [{\n                                    \"name\": \"Focal clonic seizure\",\n                                    \"parent\": \"Motor\"\n                                },\n                                {\n                                    \"name\": \"Focal tonic seizure\",\n                                    \"parent\": \"Motor\"\n                                },\n                                {\n                                    \"name\": \"Focal motor seizure with dystonia\",\n                                    \"parent\": \"Motor\"\n                                },\n                                {\n                                    \"name\": \"Focal myoclonic seizure\",\n                                    \"parent\": \"Motor\"\n                                },\n                                {\n                                    \"name\": \"Focal atonic seizure\",\n                                    \"parent\": \"Motor\"\n                                },\n                                {\n                                    \"name\": \"Focal motor seizure with paresis/paralysis\",\n                                    \"parent\": \"Motor\"\n                                },\n                                {\n                                    \"name\": \"Focal epileptic spasms\",\n                                    \"parent\": \"Motor\"\n                                },\n                                {\n                                    \"name\": \"Focal hyperkinetic seizure\",\n                                    \"parent\": \"Motor\"\n                                },\n                                {\n                                    \"name\": \"Focal automatism seizure\",\n                                    \"parent\": \"Motor\"\n                                },\n                                {\n                                    \"name\": \"Focal motor seizure with dysarthria / anarthria\",\n                                    \"parent\": \"Motor\"\n                                },\n                                {\n                                    \"name\": \"Focal motor seizure with negative myoclonus\",\n                                    \"parent\": \"Motor\"\n                                },\n                                {\n                                    \"name\": \"Focal motor seizure with version\",\n                                    \"parent\": \"Motor\"\n                                },\n                                {\n                                    \"name\": \"Focal bilateral motor seizure\",\n                                    \"parent\": \"Motor\"\n                                }\n                            ]\n                        },\n                        {\n                            \"name\": \"Non-motor\",\n                            \"parent\": \"Focal\",\n                            \"_children\": [{\n                                    \"name\": \"Focal sensory seizure\",\n                                    \"parent\": \"Non-motor\",\n                                    \"_children\": [{\n                                        \"name\": \"Focal somatosensory seizure\",\n                                        \"parent\": \"Focal sensory seizure\"\n                                    }, {\n                                        \"name\": \"Focal sensory visual seizure\",\n                                        \"parent\": \"Focal sensory seizure\"\n                                    }, {\n                                        \"name\": \"Focal sensory auditory seizure\",\n                                        \"parent\": \"Focal sensory seizure\"\n                                    }, {\n                                        \"name\": \"Focal sensory olfactory seizure\",\n                                        \"parent\": \"Focal sensory seizure\"\n                                    }, {\n                                        \"name\": \"Focal sensory gustatory seizure\",\n                                        \"parent\": \"Focal sensory seizure\"\n                                    }, {\n                                        \"name\": \"Focal sensory vestibular seizure\",\n                                        \"parent\": \"Focal sensory seizure\"\n                                    }, {\n                                        \"name\": \"Focal sensory seizure with hot-cold sensations\",\n                                        \"parent\": \"Focal sensory seizure\"\n                                    }, {\n                                        \"name\": \"Focal sensory seizure with cephalic sensation\",\n                                        \"parent\": \"Focal sensory seizure\"\n                                    }]\n                                },\n                                {\n                                    \"name\": \"Focal cognitive seizure\",\n                                    \"parent\": \"Non-motor\",\n                                    \"_children\": [{\n                                        \"name\": \"Focal cognitive seizure with expressive dysphasia / aphasia\",\n                                        \"parent\": \"Focal cognitive seizure\"\n                                    }, {\n                                        \"name\": \"Focal cognitive seizure with anomia\",\n                                        \"parent\": \"Focal cognitive seizure\"\n                                    }, {\n                                        \"name\": \"Focal cognitive seizure with receptive dysphasia / aphasia\",\n                                        \"parent\": \"Focal cognitive seizure\"\n                                    }, {\n                                        \"name\": \"Focal cognitive seizure with auditory agnosia\",\n                                        \"parent\": \"Focal cognitive seizure\"\n                                    }, {\n                                        \"name\": \"Focal cognitive seizure with conduction dysphasia / aphasia\",\n                                        \"parent\": \"Focal cognitive seizure\"\n                                    }, {\n                                        \"name\": \"Focal cognitive seizure with dyslexia / alexia\",\n                                        \"parent\": \"Focal cognitive seizure\"\n                                    }, {\n                                        \"name\": \"Focal cognitive seizure with memory impairment\",\n                                        \"parent\": \"Focal cognitive seizure\"\n                                    }, {\n                                        \"name\": \"Focal cognitive seizure with deja vu / jamais vu\",\n                                        \"parent\": \"Focal cognitive seizure\"\n                                    }, {\n                                        \"name\": \"Focal cognitive seizure with hallucination\",\n                                        \"parent\": \"Focal cognitive seizure\"\n                                    }, {\n                                        \"name\": \"Focal cognitive seizure with illusion\",\n                                        \"parent\": \"Focal cognitive seizure\"\n                                    }, {\n                                        \"name\": \"Focal cognitive seizure with dissociation\",\n                                        \"parent\": \"Focal cognitive seizure\"\n                                    }, {\n                                        \"name\": \"Focal cognitive seizure with forced thinking\",\n                                        \"parent\": \"Focal cognitive seizure\"\n                                    }, {\n                                        \"name\": \"Focal cognitive seizure with dyscalculia / acalculia\",\n                                        \"parent\": \"Focal cognitive seizure\"\n                                    }, {\n                                        \"name\": \"Focal cognitive seizure with dysgraphia/agraphia\",\n                                        \"parent\": \"Focal cognitive seizure\"\n                                    }, {\n                                        \"name\": \"Focal cognitive seizure with left-right confusion\",\n                                        \"parent\": \"Focal cognitive seizure\"\n                                    }, {\n                                        \"name\": \"Focal cognitive seizure with neglect\",\n                                        \"parent\": \"Focal cognitive seizure\"\n                                    }]\n                                },\n                                {\n                                    \"name\": \"Focal emotional seizure\",\n                                    \"parent\": \"Non-motor\",\n                                    \"_children\": [{\n                                        \"name\": \"Focal emotional seizure with fear/anxiety/panic\",\n                                        \"parent\": \"Focal emotional seizure\"\n                                    }, {\n                                        \"name\": \"Focal emotional seizure with laughing (gelastic)\",\n                                        \"parent\": \"Focal emotional seizure\"\n                                    }, {\n                                        \"name\": \"Focal emotional seizure with crying (dacrystic)\",\n                                        \"parent\": \"Focal emotional seizure\"\n                                    }, {\n                                        \"name\": \"Focal emotional seizure with pleasure\",\n                                        \"parent\": \"Focal emotional seizure\"\n                                    }, {\n                                        \"name\": \"Focal emotional seizure with anger\",\n                                        \"parent\": \"Focal emotional seizure\"\n                                    }]\n                                },\n                                {\n                                    \"name\": \"Focal autonomic seizure\",\n                                    \"parent\": \"Non-motor\",\n                                    \"_children\": [{\n                                        \"name\": \"Focal autonomic seizure with palpitations / tachycardia / bradycardia / asystole\",\n                                        \"parent\": \"Focal autonomic seizure\"\n                                    }, {\n                                        \"name\": \"Focal autonomic seizure with epigastric sensation\",\n                                        \"parent\": \"Focal autonomic seizure\"\n                                    }, {\n                                        \"name\": \"Focal autonomic seizure with pallor / flushing\",\n                                        \"parent\": \"Focal autonomic seizure\"\n                                    }, {\n                                        \"name\": \"Focal autonomic seizure with hypoventilation / hyperventilation / altered respiration\",\n                                        \"parent\": \"Focal autonomic seizure\"\n                                    }, {\n                                        \"name\": \"Focal autonomic seizure with piloerection\",\n                                        \"parent\": \"Focal autonomic seizure\"\n                                    }, {\n                                        \"name\": \"Focal autonomic seizure with erection\",\n                                        \"parent\": \"Focal autonomic seizure\"\n                                    }, {\n                                        \"name\": \"Focal autonomic seizure with urge to urinate / defecate\",\n                                        \"parent\": \"Focal autonomic seizure\"\n                                    }, {\n                                        \"name\": \"Focal autonomic seizure with lacrimation\",\n                                        \"parent\": \"Focal autonomic seizure\"\n                                    }, {\n                                        \"name\": \"Focal autonomic seizure with pupillary dilation / constriction\",\n                                        \"parent\": \"Focal autonomic seizure\"\n                                    }]\n                                },\n                                {\n                                    \"name\": \"Focal behavioural arrest seizure\",\n                                    \"parent\": \"Non-motor\",\n                                    \"_children\": [{\n                                        \"name\": \"Focal behavioural arrest seizure\",\n                                        \"parent\": \"Focal behavioural arrest seizure\"\n                                    }]\n                                }\n                            ]\n                        },\n                        {\n                            \"name\": \"Focal to bilateral tonic-clonic seizure\",\n                            \"parent\": \"Focal\",\n                            \"_children\": [{\n                                \"name\": \"Focal to bilateral tonic-clonic seizure\",\n                                \"parent\": \"Focal to bilateral tonic-clonic seizure\"\n                            }]\n                        }\n                    ]\n                },\n\n                // *** Unknown ***\n                {\n                    \"name\": \"Unknown\",\n                    \"parent\": \"Seizure Type\",\n                    \"_children\": [{\n                            \"name\": \"Motor\",\n                            \"parent\": \"Focal\",\n                            \"_children\": [{\n                                    \"name\": \"Tonic–clonic\",\n                                    \"parent\": \"Motor\"\n                                },\n                                {\n                                    \"name\": \"Epileptic spasms\",\n                                    \"parent\": \"Motor\"\n                                }\n                            ]\n                        },\n                        {\n                            \"name\": \"Non-motor\",\n                            \"parent\": \"Focal\",\n                            \"_children\": [{\n                                \"name\": \"Behaviour arrest\",\n                                \"parent\": \"Non-motor\"\n                            }, {\n                                \"name\": \"Unclassified\",\n                                \"parent\": \"Non-motor\"\n                            }]\n                        }\n                    ]\n                }\n            ]\n        },\n\n        // ****** Epilepsy Type ******\n\n        {\n            \"name\": \"Epilepsy Type\",\n            \"parent\": \"Epilepsy Classification\",\n            \"_children\": [{\n                \"name\": \"Generalised Epilepsy\",\n                \"parent\": \"Epilepsy Type\"\n            }, {\n                \"name\": \"Focal Epilepsy\",\n                \"parent\": \"Epilepsy Type\"\n            }, {\n                \"name\": \"Combined generalised and focal Epilepsy\",\n                \"parent\": \"Epilepsy Type\"\n            }, {\n                \"name\": \"Unknown Epilepsy\",\n                \"parent\": \"Epilepsy Type\"\n            }]\n        },\n\n        // ****** Epilepsy Syndrome ******\n\n        {\n            \"name\": \"Epilepsy Syndrome\",\n            \"parent\": \"Epilepsy Classification\",\n            \"_children\": [{\n                \"name\": \"Neonatal/Infantile\",\n                \"parent\": \"Epilepsy Syndrome\",\n                \"_children\": [{\n                    \"name\": \"Self-limited neonatal seizures and Self-limited familial neonatal epilepsy\",\n                    \"parent\": \"Neonatal/Infantile\"\n                }, {\n                    \"name\": \"Self limited familial and non-familial infantile epilepsy\",\n                    \"parent\": \"Neonatal/Infantile\"\n                }, {\n                    \"name\": \"Early myoclonic encephalopathy\",\n                    \"parent\": \"Neonatal/Infantile\"\n                }, {\n                    \"name\": \"Ohtahara syndrome\",\n                    \"parent\": \"Neonatal/Infantile\"\n                }, {\n                    \"name\": \"West syndrome\",\n                    \"parent\": \"Neonatal/Infantile\"\n                }, {\n                    \"name\": \"Dravet syndrome\",\n                    \"parent\": \"Neonatal/Infantile\"\n                }, {\n                    \"name\": \"Myoclonic epilepsy in infancy\",\n                    \"parent\": \"Neonatal/Infantile\"\n                }, {\n                    \"name\": \"Epilepsy of infancy with migrating focal seizures\",\n                    \"parent\": \"Neonatal/Infantile\"\n                }, {\n                    \"name\": \"Myoclonic encephalopathy in non-progressive disorders\",\n                    \"parent\": \"Neonatal/Infantile\"\n                }, {\n                    \"name\": \"Febrile seizures plus, genetic epilepsy with febrile seizures plus\",\n                    \"parent\": \"Neonatal/Infantile\"\n                }]\n            }, {\n                \"name\": \"Childhood\",\n                \"parent\": \"Epilepsy Syndrome\",\n                \"_children\": [{\n                    \"name\": \"Epilepsy with myoclonic-atonic seizures\",\n                    \"parent\": \"Childhood\"\n                }, {\n                    \"name\": \"Epilepsy with eyelid myoclonias\",\n                    \"parent\": \"Childhood\"\n                }, {\n                    \"name\": \"Lennox-Gastaut syndrome\",\n                    \"parent\": \"Childhood\"\n                }, {\n                    \"name\": \"Childhood absence epilepsy\",\n                    \"parent\": \"Childhood\"\n                }, {\n                    \"name\": \"Epilepsy with myoclonic absences\",\n                    \"parent\": \"Childhood\"\n                }, {\n                    \"name\": \"Panayiotopoulos syndrome\",\n                    \"parent\": \"Childhood\"\n                }, {\n                    \"name\": \"Childhood occipital epilepsy (Gastaut type)\",\n                    \"parent\": \"Childhood\"\n                }, {\n                    \"name\": \"Photosensitive occipital lobe epilepsy\",\n                    \"parent\": \"Childhood\"\n                }, {\n                    \"name\": \"Childhood epilepsy with centrotemporal spikes\",\n                    \"parent\": \"Childhood\"\n                }, {\n                    \"name\": \"Atypical childhood epilepsy with centrotemporal spikes\",\n                    \"parent\": \"Childhood\"\n                }, {\n                    \"name\": \"Epileptic encephalopathy with continuous spike-and-wave during sleep\",\n                    \"parent\": \"Childhood\"\n                }, {\n                    \"name\": \"Landau-Kleffner syndrome\",\n                    \"parent\": \"Childhood\"\n                }, {\n                    \"name\": \"Autosomal dominant nocturnal frontal lobe epilepsy\",\n                    \"parent\": \"Childhood\"\n                }]\n            }, {\n                \"name\": \"Adolescent/Adult\",\n                \"parent\": \"Epilepsy Syndrome\",\n                \"_children\": [{\n                    \"name\": \"Juvenile absence epilepsy\",\n                    \"parent\": \"Adolescent/Adult\"\n                }, {\n                    \"name\": \"Juvenile myoclonic epilepsy\",\n                    \"parent\": \"Adolescent/Adult\"\n                }, {\n                    \"name\": \"Epilepsy with generalized tonic-clonic seizures alone\",\n                    \"parent\": \"Adolescent/Adult\"\n                }, {\n                    \"name\": \"Autosomal dominant epilepsy with auditory features\",\n                    \"parent\": \"Adolescent/Adult\"\n                }, {\n                    \"name\": \"Other familial temporal lobe epilepsies\",\n                    \"parent\": \"Adolescent/Adult\"\n                }]\n            }, {\n                \"name\": \"Any Age\",\n                \"parent\": \"Epilepsy Syndrome\",\n                \"_children\": [{\n                        \"name\": \"Familial focal epilepsy with variable foci\",\n                        \"parent\": \"Any Age\"\n                    },\n                    {\n                        \"name\": \"Reflex epilepsies\",\n                        \"parent\": \"Any Age\"\n                    }, {\n                        \"name\": \"Progressive myoclonus epilepsies\",\n                        \"parent\": \"Any Age\"\n                    }\n                ]\n            }]\n        },\n\n        // ****** Etiology ******\n\n        {\n            \"name\": \"Etiology\",\n            \"parent\": \"Epilepsy Classification\",\n            \"_children\": [{\n                \"name\": \"Genetic Etiology\",\n                \"parent\": \"Etiology\",\n                \"_children\": [{\n                    \"name\": \"Chromosomal abnormalities\",\n                    \"parent\": \"Genetic Etiology\"\n                }, {\n                    \"name\": \"Gene abnormalities\",\n                    \"parent\": \"Genetic Etiology\"\n                }]\n            }, {\n                \"name\": \"Structural Etiology\",\n                \"parent\": \"Etiology\",\n                \"_children\": [{\n                    \"name\": \"Malformations of cortical development\",\n                    \"parent\": \"Structural Etiology\"\n                }, {\n                    \"name\": \"Vascular malformations\",\n                    \"parent\": \"Structural Etiology\"\n                }, {\n                    \"name\": \"Hippocampal sclerosis\",\n                    \"parent\": \"Structural Etiology\"\n                }, {\n                    \"name\": \"Hypoxic-ischemic structural abnormalities\",\n                    \"parent\": \"Structural Etiology\"\n                }, {\n                    \"name\": \"Traumatic Brain Injury\",\n                    \"parent\": \"Structural Etiology\"\n                }, {\n                    \"name\": \"Tumors\",\n                    \"parent\": \"Structural Etiology\"\n                }, {\n                    \"name\": \"Porencephalic cyst\",\n                    \"parent\": \"Structural Etiology\"\n                }]\n            }, {\n                \"name\": \"Metabolic Etiology\",\n                \"parent\": \"Etiology\",\n                \"_children\": [{\n                    \"name\": \"Biotinidase and holocarboxylase synthase deficiency\",\n                    \"parent\": \"Metabolic Etiology\"\n                }, {\n                    \"name\": \"Cerebral folate deficiency\",\n                    \"parent\": \"Metabolic Etiology\"\n                }, {\n                    \"name\": \"Creatine disorders\",\n                    \"parent\": \"Metabolic Etiology\"\n                }, {\n                    \"name\": \"Folinic acid responsive seizures\",\n                    \"parent\": \"Metabolic Etiology\"\n                }, {\n                    \"name\": \"Glucose transporter 1 (GLUT1) deficiency\",\n                    \"parent\": \"Metabolic Etiology\"\n                }, {\n                    \"name\": \"Mitochondrial disorders\",\n                    \"parent\": \"Metabolic Etiology\"\n                }, {\n                    \"name\": \"Peroxisomal Disorders\",\n                    \"parent\": \"Metabolic Etiology\"\n                }, {\n                    \"name\": \"Pyridoxine dependent epilepsy/PNPO deficiency\",\n                    \"parent\": \"Metabolic Etiology\"\n                }]\n            }, {\n                \"name\": \"Immune Etiology\",\n                \"parent\": \"Etiology\",\n                \"_children\": [{\n                    \"name\": \"Rasmussen syndrome\",\n                    \"parent\": \"Immune Etiology\"\n                }, {\n                    \"name\": \"Antibody mediated etiologies\",\n                    \"parent\": \"Immune Etiology\"\n                }]\n            }, {\n                \"name\": \"Infectious Etiology\",\n                \"parent\": \"Etiology\",\n                \"_children\": [{\n                    \"name\": \"Bacterial Meningitis\",\n                    \"parent\": \"Infectious Etiology\"\n                }, {\n                    \"name\": \"Cerebral Malaria\",\n                    \"parent\": \"Infectious Etiology\"\n                }, {\n                    \"name\": \"Cerebral Toxoplasmosis\",\n                    \"parent\": \"Infectious Etiology\"\n                }, {\n                    \"name\": \"CMV\",\n                    \"parent\": \"Infectious Etiology\"\n                }, {\n                    \"name\": \"HIV\",\n                    \"parent\": \"Infectious Etiology\"\n                }, {\n                    \"name\": \"Neurocysticercosis\",\n                    \"parent\": \"Infectious Etiology\"\n                }, {\n                    \"name\": \"Tuberculosis\",\n                    \"parent\": \"Infectious Etiology\"\n                }, {\n                    \"name\": \"Viral Encephalitis\",\n                    \"parent\": \"Infectious Etiology\"\n                }, {\n                    \"name\": \"Other infections\",\n                    \"parent\": \"Infectious Etiology\"\n                }]\n            }, {\n                \"name\": \"Unknown Etiology\",\n                \"parent\": \"Etiology\",\n                \"_children\": [{\n                    \"name\": \"Febrile infection related epilepsy syndrome (FIRES)\",\n                    \"parent\": \"Unknown Etiology\"\n                }]\n            }]\n        }\n    ]\n}];\n"
  },
  {
    "path": "interactiveTreeVisualization/epilepsyClassification2017/treeFunctions.js",
    "content": "// ************** Generate the tree diagram\t *****************\n\nvar margin = {\n        top: 50,\n        right: 150,\n        bottom: 50,\n        left: 150\n    },\n    width = 2 * window.innerWidth - margin.right - margin.left,\n    height = 4 * window.innerHeight - margin.top - margin.bottom;\n\nvar i = 0,\n    duration = 750,\n    root;\n\nvar tree = d3.layout.tree()\n    .separation(function (a, b) {\n        if (a.depth > 0) {\n            depth = a.depth\n        } else {\n            depth = 1\n        }\n        return (a.parent === b.parent ? 2 : 3) / depth;\n    })\n    .size([height, width]);\n\n//var tree = d3.layout.tree()\n//   .size([height, width]);\n\nvar diagonal = d3.svg.diagonal()\n    .projection(function (d) {\n        return [d.y, d.x];\n    });\n\nvar svg0 = d3.select(\"body\").append(\"svg\")\n    .attr(\"width\", width + margin.right + margin.left)\n    .attr(\"height\", height + margin.top + margin.bottom)\n    .attr(\"style\", \"background-color:white\")\n\nsvg = svg0.append(\"g\")\n    .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\nroot = treeData[0];\nroot.x0 = height / 2;\nroot.y0 = 0;\n\nupdate(root);\n\nd3.select(self.frameElement).style(\"height\", \"500px\");\n\n// ************** functions to update the tree diagram\t *****************\n\nfunction update(source) {\n\n    var levelWidth = [1];\n    var childCount = function (level, n) {\n\n        if (n.children && n.children.length > 0) {\n            if (levelWidth.length <= level + 1) levelWidth.push(0);\n\n            levelWidth[level + 1] += n.children.length;\n            n.children.forEach(function (d) {\n                childCount(level + 1, d);\n            });\n        }\n    };\n\n    childCount(0, root);\n    var newHeight = d3.max(levelWidth) * 50; // 50 pixels per line\n    tree = tree.size([newHeight, width]);\n\n    // Compute the new tree layout.\n    var nodes = tree.nodes(root).reverse(),\n        links = tree.links(nodes);\n\n    // Normalize for fixed-depth.\n    nodes.forEach(function (d) {\n        d.y = d.depth * 350;\n    });\n\n    // Update the nodes…\n    var node = svg.selectAll(\"g.node\")\n        .data(nodes, function (d) {\n            return d.id || (d.id = ++i);\n        });\n\n    // Enter any new nodes at the parent's previous position.\n    var nodeEnter = node.enter().append(\"g\")\n        .attr(\"class\", \"node\")\n        .attr(\"transform\", function (d) {\n            return \"translate(\" + source.y0 + \",\" + source.x0 + \")\";\n        })\n        .on(\"click\", click);\n\n    nodeEnter.append(\"circle\")\n        .attr(\"r\", 1e-6)\n        .style(\"fill\", function (d) {\n            return d._children ? \"lightsteelblue\" : \"#fff\";\n        });\n\n    nodeEnter.append(\"text\")\n        .attr(\"x\", function (d) {\n            return d.children || d._children ? -13 : 13;\n        })\n        .attr(\"dy\", \".35em\")\n        .attr(\"text-anchor\", function (d) {\n            return d.children || d._children ? \"end\" : \"start\";\n        })\n        .text(function (d) {\n            return d.name;\n        })\n        .style(\"fill-opacity\", 1e-6);\n\n    // Transition nodes to their new position.\n    var nodeUpdate = node.transition()\n        .duration(duration)\n        .attr(\"transform\", function (d) {\n            return \"translate(\" + d.y + \",\" + d.x + \")\";\n        });\n\n    nodeUpdate.select(\"circle\")\n        .attr(\"r\", 10)\n        .style(\"fill\", function (d) {\n            return d._children ? \"lightsteelblue\" : \"#fff\";\n        });\n\n    nodeUpdate.select(\"text\")\n        .style(\"fill-opacity\", 1);\n\n    // Transition exiting nodes to the parent's new position.\n    var nodeExit = node.exit().transition()\n        .duration(duration)\n        .attr(\"transform\", function (d) {\n            return \"translate(\" + source.y + \",\" + source.x + \")\";\n        })\n        .remove();\n\n    nodeExit.select(\"circle\")\n        .attr(\"r\", 1e-6);\n\n    nodeExit.select(\"text\")\n        .style(\"fill-opacity\", 1e-6);\n\n    // Update the links…\n    var link = svg.selectAll(\"path.link\")\n        .data(links, function (d) {\n            return d.target.id;\n        });\n\n    // Enter any new links at the parent's previous position.\n    link.enter().insert(\"path\", \"g\")\n        .attr(\"class\", \"link\")\n        .attr(\"d\", function (d) {\n            var o = {\n                x: source.x0,\n                y: source.y0\n            };\n            return diagonal({\n                source: o,\n                target: o\n            });\n        })\n\n    // Transition links to their new position.\n    link.transition()\n        .duration(duration)\n        .attr(\"d\", diagonal);\n\n    // Transition exiting nodes to the parent's new position.\n    link.exit().transition()\n        .duration(duration)\n        .attr(\"d\", function (d) {\n            var o = {\n                x: source.x,\n                y: source.y\n            };\n            return diagonal({\n                source: o,\n                target: o\n            });\n        })\n        .remove();\n\n    // Stash the old positions for transition.\n    nodes.forEach(function (d) {\n        d.x0 = d.x;\n        d.y0 = d.y;\n    });\n}\n\n// Toggle children on click.\nfunction click(d) {\n    if (d.children) {\n        d._children = d.children;\n        d.children = null;\n    } else {\n        d.children = d._children;\n        d._children = null;\n    }\n    update(d);\n}\n\nfunction expand(d) {\n    var children = (d.children) ? d.children : d._children;\n    if (d._children) {\n        d.children = d._children;\n        d._children = null;\n    }\n    if (children)\n        children.forEach(expand);\n}\n\nfunction collapse(d) {\n    if (d.children) {\n        d._children = d.children;\n        d._children.forEach(collapse);\n        d.children = null;\n    }\n}\n\nfunction expandAll() {\n    expand(root);\n    update(root);\n}\n\nfunction collapseAll() {\n    root.children.forEach(collapse);\n    collapse(root);\n    update(root);\n}\n\n// ************** functions to save the tree diagram\t *****************\n\n// Set-up the export button\nd3.select('#saveButton').on('click', function () {\n    var svgString = getSVGString(svg0.node());\n    svgString2Image(svgString, 1 * width, 1 * height, 'png', save); // passes Blob and filesize String to the callback\n    function save(dataBlob, filesize) {\n        saveAs(dataBlob, 'D3 vis exported to PNG.png'); // FileSaver.js function\n    }\n});\n\n\n// Below are the functions that handle actual exporting:\n// getSVGString ( svgNode ) and svgString2Image( svgString, width, height, format, callback )\nfunction getSVGString(svgNode) {\n    svgNode.setAttribute('xlink', 'http://www.w3.org/1999/xlink');\n    var cssStyleText = getCSSStyles(svgNode);\n    appendCSS(cssStyleText, svgNode);\n\n    var serializer = new XMLSerializer();\n    var svgString = serializer.serializeToString(svgNode);\n    svgString = svgString.replace(/(\\w+)?:?xlink=/g, 'xmlns:xlink='); // Fix root xlink without namespace\n    svgString = svgString.replace(/NS\\d+:href/g, 'xlink:href'); // Safari NS namespace fix\n\n    return svgString;\n\n    function getCSSStyles(parentElement) {\n        var selectorTextArr = [];\n\n        // Add Parent element Id and Classes to the list\n        selectorTextArr.push('#' + parentElement.id);\n        for (var c = 0; c < parentElement.classList.length; c++)\n            if (!contains('.' + parentElement.classList[c], selectorTextArr))\n                selectorTextArr.push('.' + parentElement.classList[c]);\n\n        // Add Children element Ids and Classes to the list\n        var nodes = parentElement.getElementsByTagName(\"*\");\n        for (var i = 0; i < nodes.length; i++) {\n            var id = nodes[i].id;\n            if (!contains('#' + id, selectorTextArr))\n                selectorTextArr.push('#' + id);\n\n            var classes = nodes[i].classList;\n            for (var c = 0; c < classes.length; c++)\n                if (!contains('.' + classes[c], selectorTextArr))\n                    selectorTextArr.push('.' + classes[c]);\n        }\n\n        // Extract CSS Rules\n        var extractedCSSText = \"\";\n        for (var i = 0; i < document.styleSheets.length; i++) {\n            var s = document.styleSheets[i];\n\n            try {\n                if (!s.cssRules) continue;\n            } catch (e) {\n                if (e.name !== 'SecurityError') throw e; // for Firefox\n                continue;\n            }\n\n            var cssRules = s.cssRules;\n            for (var r = 0; r < cssRules.length; r++) {\n                if (contains(cssRules[r].selectorText, selectorTextArr))\n                    extractedCSSText += cssRules[r].cssText;\n            }\n        }\n\n        return extractedCSSText;\n\n        function contains(str, arr) {\n            return arr.indexOf(str) === -1 ? false : true;\n        }\n\n    }\n\n    function appendCSS(cssText, element) {\n        var styleElement = document.createElement(\"style\");\n        styleElement.setAttribute(\"type\", \"text/css\");\n        styleElement.innerHTML = cssText;\n        var refNode = element.hasChildNodes() ? element.children[0] : null;\n        element.insertBefore(styleElement, refNode);\n    }\n}\n\nfunction svgString2Image(svgString, width, height, format, callback) {\n    var format = format ? format : 'png';\n\n    var imgsrc = 'data:image/svg+xml;base64,' + btoa(unescape(encodeURIComponent(svgString))); // Convert SVG string to data URL\n\n    var canvas = document.createElement(\"canvas\");\n    var context = canvas.getContext(\"2d\");\n\n    canvas.width = width;\n    canvas.height = height;\n\n    var image = new Image();\n    image.onload = function () {\n        context.clearRect(0, 0, width, height);\n        context.drawImage(image, 0, 0, width, height);\n\n        canvas.toBlob(function (blob) {\n            var filesize = Math.round(blob.length / 1024) + ' KB';\n            if (callback) callback(blob, filesize);\n        });\n\n    };\n\n    image.src = imgsrc;\n}\n"
  },
  {
    "path": "interactiveTreeVisualization/epilepsyClassification2017/treeStyle.css",
    "content": "\n.node {\n    cursor: pointer;\n}\n\n.node circle {\n    fill: #fff;\n    stroke: steelblue;\n    stroke-width: 3px;\n}\n\n.node text {\n    font: 12px sans-serif;\n}\n\n.link {\n    fill: none;\n    stroke: #ccc;\n    stroke-width: 3px;\n}\n\n.button {\n    background-color: #ccc;\n    color: black;\n    border: none;\n    padding: 15px 32px;\n    border-radius: 8px;\n    text-align: center;\n    text-decoration: none;\n    display: inline-block;\n    font-size: 14px;\n    transition-duration: 0.4s;\n    cursor: pointer;\n}\n\n.button:hover {\n    background-color:steelblue;\n}\n"
  },
  {
    "path": "matlabCode/anat/createBIDS_T1w_json_full.m",
    "content": "% Template Matlab script to create a BIDS compatible file:\n%\n%  sub-01_ses-01_run-01_acq-FullExample_T1w.json\n%\n% This example lists only the REQUIRED, RECOMMENDED and OPTIONAL fields.\n% When adding additional metadata please use CamelCase\n\n% Writing json files relies on the JSONio library\n% https://github.com/bids-standard/bids-matlab\n%\n% Make sure it is in the matab/octave path\ntry\n    bids.bids_matlab_version;\ncatch\n    warning('%s\\n%s\\n%s\\n%s', ...\n            'Writing the JSON file seems to have failed.', ...\n            'Make sure that the following library is in the matlab/octave path:', ...\n            'https://github.com/bids-standard/bids-matlab');\nend\n\n%%\nclear;\n\nthis_dir = fileparts(mfilename('fullpath'));\nroot_dir = fullfile(this_dir, '..', filesep, '..');\n\nproject = 'templates';\n\nsub_label = '01';\nses_label = '01';\nrun_label = '01';\n\n% The OPTIONAL acq-<label> key/value pair corresponds to a custom label\n% the user MAY use to distinguish a different set of parameters used for\n% acquiring the same modality.\nacq_label = 'FullExample';\n\nname_spec.modality = 'anat';\nname_spec.suffix = 'T1w';\nname_spec.ext = '.json';\n\nname_spec.entities = struct('ses', ses_label, ...\n                            'acq', acq_label, ...\n                            'run', run_label, ...\n                            'sub', sub_label);\n\n% using the 'use_schema', true\n% ensures that the entities will be in the correct order\nbids_file = bids.File(name_spec, 'use_schema', true);\n\n% Contrust the fullpath version of the filename\njson_name = fullfile(root_dir, project, bids_file.bids_path, bids_file.filename);\n\n%%\n% Assign the fields in the Matlab structure that can be saved as a json.\n% all REQUIRED /RECOMMENDED /OPTIONAL metadata fields for Magnetic Resonance Imaging data\n\n%% Adding metadata\n% to get the definition of each metadata,\n% you can use the bids.Schema class from bids matlab\n\n% For example\nschema = bids.Schema;\ndef = schema.get_definition('TaskName');\nfprintf(def.description);\n\n%% Scanner Hardware metadata fields\njson.Manufacturer = ' ';\njson.ManufacturersModelName = ' ';\njson.MagneticFieldStrength = ' ';\njson.DeviceSerialNumber = ' ';\njson.StationName = ' ';\njson.SoftwareVersions = ' ';\njson.HardcopyDeviceSoftwareVersion = ' ';\nl;\njson.ReceiveCoilName = ' ';\njson.ReceiveCoilActiveElements = ' ';\njson.GradientSetType = ' ';\njson.MRTransmitCoilSequence = ' ';\njson.MatrixCoilMode = ' ';\njson.CoilCombinationMethod = ' ';\n\n%% Sequence Specifics metadata fields\njson.PulseSequenceType = ' ';\njson.ScanningSequence = ' ';\njson.SequenceVariant = ' ';\njson.ScanOptions = ' ';\njson.SequenceName = ' ';\njson.PulseSequenceDetails = ' ';\njson.NonlinearGradientCorrection = ' ';\n\n%% In-Plane Spatial Encoding metadata fields\njson.NumberShots = ' ';\njson.ParallelReductionFactorInPlane = ' ';\njson.ParallelAcquisitionTechnique = ' ';\njson.PartialFourier = ' ';\njson.PartialFourierDirection = ' ';\njson.WaterFatShift = ' ';\njson.EchoTrainLength = ' ';\n\n%% Timing Parameters metadata fields\njson.EchoTime = ' ';\njson.InversionTime = ' ';\njson.SliceEncodingDirection = ' ';\njson.DwellTime = ' ';\n\n%% RF & Contrast metadata field\njson.FlipAngle = ' ';\n\n%% Slice Acceleration metadata field\njson.MultibandAccelerationFactor = ' ';\n\n%% Anatomical landmarks metadata fields\njson.AnatomicalLandmarkCoordinates = ' ';\n\n%% Institution information metadata fields\njson.InstitutionName = ' ';\njson.InstitutionAddress = ' ';\njson.InstitutionalDepartmentName = ' ';\n\n%% Write JSON\n% Make sure the directory exists\nbids.util.mkdir(fileparts(json_name));\nbids.util.jsonencode(json_name, json);\n"
  },
  {
    "path": "matlabCode/anat/createBIDS_T1w_json_full_schma_based.m",
    "content": "% Similar to \"createBIDS_T1w_json_full.m\"\n% but relies on the BIDS schema to get a more updated version\n% of the list of metadata\n\n% This is work in progress but should become most useful when the BIDS\n% shcema is updated to include what are the required fields a given suffix\n\n%%\nclear;\n\nthis_dir = fileparts(mfilename('fullpath'));\n\nroot_dir = fullfile(this_dir, '..', filesep, '..');\n\nproject = 'templates';\n\nsub_label = '01';\nses_label = '01';\nrun_label = '01';\n\n% The OPTIONAL acq-<label> key/value pair corresponds to a custom label\n% the user MAY use to distinguish a different set of parameters used for\n% acquiring the same modality.\nacq_label = 'SchemaBased';\n\nname_spec.modality = 'anat';\nname_spec.suffix = 'T1w';\nname_spec.ext = '.json';\n\nname_spec.entities = struct('sub', sub_label, ...\n                            'ses', ses_label, ...\n                            'acq', acq_label, ...\n                            'run', run_label);\n\n% using the 'use_schema', true\n% ensures that the entities will be in the correct order\nbids_file = bids.File(name_spec, 'use_schema', true);\n\n% Contrust the fullpath version of the filename\nanat_json_name = fullfile(root_dir, project, bids_file.bids_path, bids_file.filename);\n\n% Make sure the directory exists\nbids.util.mkdir(fileparts(anat_json_name));\n\n%%\n% Assign the fields in the Matlab structure that can be saved as a json.\n% all REQUIRED /RECOMMENDED /OPTIONAL metadata fields for Magnetic Resonance Imaging data\n\nfprintf(1, '\\n');\n\nanat_json = struct();\n\nschema = bids.Schema;\n\nmri_fields = fieldnames(schema.content.rules.sidecars.mri);\n\nfor i = 1:numel(mri_fields)\n\n    this_field = schema.content.rules.sidecars.mri.(mri_fields{i});\n\n    mri_subfields = fieldnames(this_field.fields);\n\n    for j = 1:numel(mri_subfields)\n\n        this_subfield = this_field.fields.(mri_subfields{j});\n\n        if ischar(this_subfield) && strcmp(this_subfield, 'recommended')\n            fprintf(1, '%s\\n', mri_subfields{j});\n            this_field.fields;\n            anat_json.(mri_subfields{j}) = ' ';\n        end\n\n    end\n\nend\n\n%% Write JSON\n% bids.util.jsonencode(anat_json_name, anat_json);\n\nfprintf(1, '\\n');\n"
  },
  {
    "path": "matlabCode/anat/createBIDS_T1w_json_short.m",
    "content": "% Template Matlab script to create a BIDS compatible file:\n%\n%  sub-01_ses-01_acq-ShortExample_run-01_T1w.json\n%\n% This example lists only the REQUIRED fields.\n% When adding additional metadata please use CamelCase\n\n% Writing json files relies on the JSONio library\n% https://github.com/bids-standard/bids-matlab\n%\n% Make sure it is in the matab/octave path\ntry\n    bids.bids_matlab_version;\ncatch\n    warning('%s\\n%s\\n%s\\n%s', ...\n            'Writing the JSON file seems to have failed.', ...\n            'Make sure that the following library is in the matlab/octave path:', ...\n            'https://github.com/bids-standard/bids-matlab');\nend\n\n%%\nclear;\n\nthis_dir = fileparts(mfilename('fullpath'));\n\nroot_dir = fullfile(this_dir, '..', filesep, '..');\n\nproject = 'templates';\n\nsub_label = '01';\nses_label = '01';\nrun_label = '01';\n\n% The OPTIONAL acq-<label> key/value pair corresponds to a custom label\n% the user MAY use to distinguish a different set of parameters used for\n% acquiring the same modality.\nacq_label = 'ShortExample';\n\nname_spec.modality = 'anat';\nname_spec.suffix = 'T1w';\nname_spec.ext = '.json';\n\nname_spec.entities = struct('sub', sub_label, ...\n                            'ses', ses_label, ...\n                            'acq', acq_label, ...\n                            'run', run_label);\n\n% using the 'use_schema', true\n% ensures that the entities will be in the correct order\nbids_file = bids.File(name_spec, 'use_schema', true);\n\n% Contrust the fullpath version of the filename\njson_name = fullfile(root_dir, project, bids_file.bids_path, bids_file.filename);\n\n% Make sure the directory exists\nbids.util.mkdir(fileparts(json_name));\n\n%%\n% Assign the fields in the Matlab structure that can be saved as a json.\n% all REQUIRED /RECOMMENDED /OPTIONAL metadata fields for Magnetic Resonance Imaging data\n\n%% Adding metadata\n% to get the definition of each metadata,\n% you can use the bids.Schema class from bids matlab\n\n% For example\nschema = bids.Schema;\ndef = schema.get_definition('TaskName');\nfprintf(def.description);\n\n%% In-Plane Spatial Encoding metadata fields\njson.PhaseEncodingDirection = ' ';\njson.EffectiveEchoSpacing = ' ';\njson.TotalReadoutTime = ' ';\n\n%% Timing Parameters metadata fields\njson.EchoTime = ' ';\n\n%% Write JSON\nbids.util.jsonencode(json_name, json);\n"
  },
  {
    "path": "matlabCode/eeg-meg/createBIDS_meg_json_full.m",
    "content": "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n% Create JSON using MATLAB for MEG BIDS:\n%\n% This template is for MEG data of any kind,\n% including but not limited to task-based, resting-state, and noise recordings.\n%\n% If multiple Tasks were performed within a single Run,\n% the task description can be set to \"task-multitask\".\n%\n% The _meg.json SHOULD contain details on the Tasks.\n%\n% Some manufacturers data storage\n% conventions use folders which contain data files of various nature:\n% for example: CTF's .ds format, or 4D/BTi.\n%\n% Please refer to Appendix VI for examples from a selection of MEG manufacturers\n%\n% By @Cofficer, Created 9/03/2018\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\n% Writing json files relies on the JSONio library\n% https://github.com/bids-standard/bids-matlab\n%\n% Make sure it is in the matab/octave path\ntry\n    bids.bids_matlab_version;\ncatch\n    warning('%s\\n%s\\n%s\\n%s', ...\n            'Writing the JSON file seems to have failed.', ...\n            'Make sure that the following library is in the matlab/octave path:', ...\n            'https://github.com/bids-standard/bids-matlab');\nend\n\nclear;\n\nthis_dir = fileparts(mfilename('fullpath'));\nroot_dir = fullfile(this_dir, '..', filesep, '..');\n\nproject = 'templates';\n\nsub_label = '01';\nses_label = '01';\ntask_label = 'FullExample';\nacq_label = 'CTF';\nrun_label = '1';\n\n% A \"proc\" (processed) label has been added, especially useful for files coming from Maxfilter\n% (for example: sss, tsss, trans, quat, mc, etc.)\nproc_label = 'sss';\n\nname_spec.modality = 'meg';\nname_spec.suffix = 'meg';\nname_spec.ext = '.json';\nname_spec.entities = struct('sub', sub_label, ...\n                            'acq', acq_label, ...\n                            'ses', ses_label, ...\n                            'task', task_label, ...\n                            'run', run_label, ...\n                            'proc', proc_label);\n\n% using the 'use_schema', true\n% ensures that the entities will be in the correct order\nbids_file = bids.File(name_spec, 'use_schema', true);\n\n% Contrust the fullpath version of the filename\njson_name = fullfile(root_dir, project, bids_file.bids_path, bids_file.filename);\n\n%% Adding metadata\n% Assign the fields in the Matlab structure that can be saved as a json.\n% The following fields must be defined:\n\n% to get the definition of each metadata,\n% you can use the bids.Schema class from bids matlab\n% For example\nschema = bids.Schema;\ndef = schema.get_definition('TaskName');\nfprintf(def.description);\n\njson.TaskName = task_label;\njson.InstitutionName = '';\njson.InstitutionAddress = '';\njson.Manufacturer = '';\njson.ManufacturersModelName = '';\njson.SoftwareVersions = '';\njson.TaskDescription = '';\njson.Instructions = '';\njson.CogPOID = 'http://www.cogpo.org/ontologies/CogPOver1.owl#FIXME';\njson.DeviceSerialNumber = '';\n\n%%\n% The following MEG specific fields must also be defined:\njson.SamplingFrequency = '';\njson.PowerLineFrequency = '';\njson.DewarPosition = '';\njson.SoftwareFilters = '';\njson.DigitizedLandmarks = '';\n\njson.DigitizedHeadPoints = '';\n\n%%\n% The following fields should be present for MEG:\njson.MEGChannelCount = [];\njson.MEGREFChannelCount = [];\njson.EEGChannelCount = [];\njson.ECOGChannelCount = [];\njson.SEEGChannelCount = [];\njson.EOGChannelCount = [];\njson.ECGChannelCount = [];\njson.EMGChannelCount = [];\njson.MiscChannelCount = [];\njson.TriggerChannelCount = [];\njson.RecordingDuration = [];\njson.RecordingType = '';\njson.EpochLength = '';\njson.ContinuousHeadLocalization = '';\njson.HeadCoilFrequency = [];\njson.MaxMovement = '';\njson.SubjectArtefactDescription = '';\njson.AssociatedEmptyRoom = '';\n\n%%\n% Specific EEG fields if recorded with MEG\n% SHOULD be present:\njson.EEGSamplingFrequency = [];\njson.EEGPlacementScheme = '';\njson.ManufacturersAmplifierModelName = '';\njson.EEGReference = '';\n\n%% Write JSON\n% Make sure the directory exists\nbids.util.mkdir(fileparts(json_name));\nbids.util.jsonencode(json_name, json);\n"
  },
  {
    "path": "matlabCode/eeg-meg/createBIDS_meg_json_short.m",
    "content": "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n% Create JSON using MATLAB for MEG BIDS:\n%\n% This template is for MEG data of any kind, including but not limited to task-based,\n% resting-state, and noise recordings.\n%\n% If multiple Tasks were performed within a single Run,\n% the task description can be set to \"task-multitask\".\n%\n% The _meg.json SHOULD contain details on the Tasks.\n%\n% Some manufacturers data storage conventions use folders\n% which contain data files of various nature:\n% for example: CTF's .ds format, or 4D/BTi.\n%\n% Please refer to Appendix VI for examples from a selection of MEG manufacturers\n%\n% By Cofficer, Created 14/03/2018\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n\n% Writing json files relies on the JSONio library\n% https://github.com/bids-standard/bids-matlab\n%\n% Make sure it is in the matab/octave path\ntry\n    bids.bids_matlab_version;\ncatch\n    warning('%s\\n%s\\n%s\\n%s', ...\n            'Writing the JSON file seems to have failed.', ...\n            'Make sure that the following library is in the matlab/octave path:', ...\n            'https://github.com/bids-standard/bids-matlab');\nend\n\nthis_dir = fileparts(mfilename('fullpath'));\nroot_dir = fullfile(this_dir, '..', filesep, '..');\n\nproject = 'templates';\n\nsub_label = '01';\nses_label = '01';\ntask_label = 'ShortExample';\nacq_label = 'CTF';\nrun_label = '1';\n\n% A \"proc\" (processed) label has been added, especially useful for files coming from Maxfilter\n% (for example: sss, tsss, trans, quat, mc, etc.)\nproc_label = 'sss';\n\nname_spec.modality = 'meg';\nname_spec.suffix = 'meg';\nname_spec.ext = '.json';\nname_spec.entities = struct('sub', sub_label, ...\n                            'acq', acq_label, ...\n                            'ses', ses_label, ...\n                            'task', task_label, ...\n                            'run', run_label, ...\n                            'proc', proc_label);\n\n% using the 'use_schema', true\n% ensures that the entities will be in the correct order\nbids_file = bids.File(name_spec, 'use_schema', true);\n\n% Contrust the fullpath version of the filename\njson_name = fullfile(root_dir, project, bids_file.bids_path, bids_file.filename);\n\n%% Adding metadata\n% Assign the fields in the Matlab structure that can be saved as a json.\n% The following fields must be defined:\n\n% to get the definition of each metadata,\n% you can use the bids.Schema class from bids matlab\n% For example\nschema = bids.Schema;\ndef = schema.get_definition('TaskName');\nfprintf(def.description);\n\n%%\njson.TaskName = task_label;\n\n%%\njson.SamplingFrequency = [];\njson.PowerLineFrequency = [];\njson.DewarPosition = '';\njson.SoftwareFilters = '';\njson.DigitizedLandmarks = '';\njson.DigitizedHeadPoints = '';\n\n%% Write JSON\n% Make sure the directory exists\nbids.util.mkdir(fileparts(json_name));\nbids.util.jsonencode(json_name, json);\n"
  },
  {
    "path": "matlabCode/eeg-meg/rename_brainvision_files.m",
    "content": "function rename_brainvision_files(varargin)\n\n    % RENAME_BRAINVISION_FILES renames a BrainVision EEG dataset, which consists of a vhdr header\n    % file, vmrk marker file and a data file that usually has the extension dat, eeg or seg.\n    %\n    % Use as\n    % rename_brainvision_files(oldname, newname, 'rmf', 'on')\n    % where both the old and the new filename should be strings corresponding to the\n    % header file, for instance: including the vhdr extension.\n    % 'rmf' option indicates to remove old files and can be turned 'on' of 'off' (default)\n    %\n    % See also http://www.fieldtriptoolbox.org/ and https://sccn.ucsd.edu/wiki/EEGLAB for\n    % open source software to process BrainVision EEG data.\n    %\n    % Robert Oostenveld https://gist.github.com/robertoostenveld/e31637a777c514bf1e86272e1092316e\n    % Cyril Pernet - fixed few bugs here and there https://gist.github.com/CPernet/e037df46e064ca83a49fb4c595d4566a\n\n    %% deal with inputs\n\n    rmf = 'off'; % by default do not delete files\n    if nargin >= 3\n        if strcmpi(varargin{3}, 'rmf')\n            if nargin == 3\n                disp('no value associated to the remove file option, assuming off');\n            else\n                rmf = varargin{4};\n            end\n        else\n            error(['unrecognized option argument ''' varargin{3} '''']);\n        end\n    end\n\n    oldheaderfile = varargin{1};\n    newheaderfile = varargin{2};\n    clear varargin;\n\n    % determine whether the file extensions should be in lower or upper case\n    if ~isempty(regexp(newheaderfile, 'VHDR$', 'once'))\n        switchcase = @upper;\n    else\n        switchcase = @lower;\n    end\n\n    % determine the filename without extension\n    [~, f, ~] = fileparts(newheaderfile);\n\n    %% do the renaming\n\n    % deal with the header file\n    assert(exist(oldheaderfile, 'file') ~= 0, 'the file %s does not exists', oldheaderfile);\n    assert(exist(newheaderfile, 'file') == 0, 'the file %s already exists', newheaderfile);\n    fid1 = fopen(oldheaderfile, 'r'); % read old\n    fid2 = fopen(newheaderfile, 'w'); % write new\n\n    while ~feof(fid1)\n        line = fgetl(fid1);\n        if ~isempty(regexp(line, '^MarkerFile', 'once'))\n            [~, rem] = strtok(line, '=');\n            oldmarkerfile = rem(2:end);\n            [~, ~, x] = fileparts(oldmarkerfile);\n            newmarkerfile = [f switchcase(x)];\n            line = sprintf('MarkerFile=%s', newmarkerfile);\n        elseif ~isempty(regexp(line, '^DataFile', 'once'))\n            [~, rem] = strtok(line, '=');\n            olddatafile = rem(2:end);\n            [~, ~, x] = fileparts(olddatafile);\n            newdatafile = [f switchcase(x)];\n            line = sprintf('DataFile=%s', newdatafile);\n        end\n        fprintf(fid2, '%s\\r\\n', line);\n    end\n    fclose(fid1);\n    fclose(fid2);\n\n    % deal with the marker file\n    if exist(oldmarkerfile, 'file') == 0\n        [~, ~, ext] = fileparts(oldmarkerfile);\n        [~, ff, ~] = fileparts(oldheaderfile); % re-reading as sometimes weird names comes up\n        if exist([ff ext], 'file')\n            oldmarkerfile = [ff ext];\n        else\n            error('the file %s does not exists', oldmarkerfile);\n        end\n    end\n    assert(exist(newmarkerfile, 'file') == 0, 'the file %s already exists', newmarkerfile);\n    fid1 = fopen(oldmarkerfile, 'r');\n    fid2 = fopen(newmarkerfile, 'w');\n\n    while ~feof(fid1)\n        line = fgetl(fid1);\n        if ~isempty(regexp(line, '^HeaderFile', 'once'))\n            [~, rem] = strtok(line, '=');\n            oldheaderfile = rem(2:end);\n            [~, ~, x] = fileparts(oldheaderfile);\n            newheaderfile = [f switchcase(x)];\n            line = sprintf('HeaderFile=%s', newheaderfile);\n        elseif ~isempty(regexp(line, '^DataFile', 'once'))\n            [~, rem] = strtok(line, '=');\n            olddatafile = rem(2:end);\n            [~, ~, x] = fileparts(olddatafile);\n            newdatafile = [f switchcase(x)];\n            line = sprintf('DataFile=%s', newdatafile);\n        end\n        fprintf(fid2, '%s\\r\\n', line);\n    end\n    fclose(fid1);\n    fclose(fid2);\n\n    % deal with the data file\n    if exist(olddatafile, 'file') == 0\n        [~, ~, ext] = fileparts(olddatafile);\n        [~, ff, ~] = fileparts(oldheaderfile); % re-reading as sometimes weird names comes up\n        if exist([ff ext], 'file')\n            olddatafile = [ff ext];\n        else\n            error('the file %s does not exists', oldmarkerfile);\n        end\n    end\n    assert(exist(newdatafile, 'file') == 0, 'the file %s already exists', newdatafile);\n    status = copyfile(olddatafile, newdatafile);\n    if ~status\n        error('failed to copy data from %s to %s', olddatafile, newdatafile);\n    end\n\n    %% delete old files *try* in case of user restriction\n    if strcmpi(rmf, 'on')\n        try\n            delete(oldheaderfile);\n        end\n        try\n            delete(oldmarkerfile);\n        end\n        try\n            delete(olddatafile);\n        end\n    end\n"
  },
  {
    "path": "matlabCode/fmap/createBIDS_fmap_json.m",
    "content": "%% Template Matlab script to create an BIDS compatible _fmap.json file\n% There are different cases, see BIDS spec 1.0.2 paragraph 8.9\n% This example lists all required and optional fields.\n% When adding additional metadata please use CamelCase\n%\n% DHermes, 2017\n\n% Writing json files relies on the JSONio library\n% https://github.com/bids-standard/bids-matlab\n%\n% Make sure it is in the matab/octave path\ntry\n    bids.bids_matlab_version;\ncatch\n    warning('%s\\n%s\\n%s\\n%s', ...\n            'Writing the JSON file seems to have failed.', ...\n            'Make sure that the following library is in the matlab/octave path:', ...\n            'https://github.com/bids-standard/bids-matlab');\nend\n\n%% Case 1: Phase difference image and at least one magnitude image\nclear;\n\nthis_dir = fileparts(mfilename('fullpath'));\nroot_dir = fullfile(this_dir, '..', filesep, '..');\n\nproject = 'templates';\n\nsub_label = '01';\nses_label = '01';\nacq_label = 'Case1';\nrun_label = '01';\n\nname_spec.modality = 'fmap';\nname_spec.suffix = 'phasediff';\nname_spec.ext = '.json';\nname_spec.entities = struct('sub', sub_label, ...\n                            'ses', ses_label, ...\n                            'acq', acq_label, ...\n                            'run', run_label);\n\n% using the 'use_schema', true\n% ensures that the entities will be in the correct order\nbids_file = bids.File(name_spec, 'use_schema', true);\n\n% Contrust the fullpath version of the filename\njson_name = fullfile(root_dir, project, bids_file.bids_path, bids_file.filename);\n\n%% Adding metadata\n% to get the definition of each metadata,\n% you can use the bids.Schema class from bids matlab\n\n% For example\nschema = bids.Schema;\ndef = schema.get_definition('TaskName');\nfprintf(def.description);\n\njson.EchoTime1 = '';\njson.EchoTime2 = '';\njson.IntendedFor = {'sub-01/ses-01/func/...'\n                    'sub-01/ses-01/func/...'};\n\n% Write JSON\n% Make sure the directory exists\nbids.util.mkdir(fileparts(json_name));\nbids.util.jsonencode(json_name, json);\n\n%% Case 2: Two phase images and two magnitude images\nclear;\n\nthis_dir = fileparts(mfilename('fullpath'));\nroot_dir = fullfile(this_dir, '..', filesep, '..');\n\nproject = 'templates';\n\nsub_label = '01';\nses_label = '01';\nacq_label = 'Case2';\nrun_label = '01';\n\nname_spec.modality = 'fmap';\nname_spec.suffix = 'phase1';\nname_spec.ext = '.json';\nname_spec.entities = struct('sub', sub_label, ...\n                            'ses', ses_label, ...\n                            'acq', acq_label, ...\n                            'run', run_label);\n% using the 'use_schema', true\n% ensures that the entities will be in the correct order\nbids_file = bids.File(name_spec, 'use_schema', true);\n\n% Contrust the fullpath version of the filename\nfmap1_json_name = fullfile(root_dir, project, bids_file.bids_path, bids_file.filename);\n\nname_spec.suffix = 'phase2';\nbids_file = bids.File(name_spec, 'use_schema', true);\nfmap2_json_name = fullfile(root_dir, project, bids_file.bids_path, bids_file.filename);\n\n%% Adding metadata\n% to get the definition of each metadata,\n% you can use the bids.Schema class from bids matlab\n\n% For example\nschema = bids.Schema;\ndef = schema.get_definition('TaskName');\nfprintf(def.description);\n\nfmap1_json.EchoTime = '';\nfmap1_json.IntendedFor = {'sub-01/ses-01/func/...'\n                          'sub-01/ses-01/func/...'};\n\nfmap2_json.EchoTime = '';\nfmap2_json.IntendedFor = {'sub-01/ses-01/func/...'\n                          'sub-01/ses-01/func/...'};\n\n% Write JSON\n% Make sure the directory exists\nbids.util.mkdir(fileparts(fmap1_json_name));\nbids.util.jsonencode(fmap1_json_name, fmap1_json);\nbids.util.jsonencode(fmap2_json_name, fmap2_json);\n\n%% Case 3: A single, real fieldmap image (showing the field inhomogeneity in each voxel)\n\nclear;\n\nthis_dir = fileparts(mfilename('fullpath'));\nroot_dir = fullfile(this_dir, '..', filesep, '..');\n\nproject = 'templates';\n\nsub_label = '01';\nses_label = '01';\nacq_label = 'Case3';\nrun_label = '01';\n\nname_spec.modality = 'fmap';\nname_spec.suffix = 'fieldmap';\nname_spec.ext = '.json';\nname_spec.entities = struct('sub', sub_label, ...\n                            'ses', ses_label, ...\n                            'acq', acq_label, ...\n                            'run', run_label);\n% using the 'use_schema', true\n% ensures that the entities will be in the correct order\nbids_file = bids.File(name_spec, 'use_schema', true);\n\n% Contrust the fullpath version of the filename\njson_name = fullfile(root_dir, project, bids_file.bids_path, bids_file.filename);\n\n%% Adding metadata\n% to get the definition of each metadata,\n% you can use the bids.Schema class from bids matlab\n\n% For example\nschema = bids.Schema;\ndef = schema.get_definition('TaskName');\nfprintf(def.description);\n\njson.Units = '';\njson.IntendedFor = {'sub-01/ses-01/func/...'\n                    'sub-01/ses-01/func/...'};\n\n% Write JSON\n% Make sure the directory exists\nbids.util.mkdir(fileparts(json_name));\nbids.util.jsonencode(json_name, json);\n\n%% Case 4: Multiple phase encoded directions (topup)\n\nclear;\n\nthis_dir = fileparts(mfilename('fullpath'));\nroot_dir = fullfile(this_dir, '..', filesep, '..');\n\nproject = 'templates';\n\nsub_label = '01';\nses_label = '01';\nacq_label = 'Case4';\nrun_label = '01';\n\n% dir_label value can be set to arbitrary alphanumeric\n% label ([a-zA-Z0-9]+ for example \"LR\" or \"AP\") that can help users to\n% distinguish between different files, but should not be used to infer any\n% scanning parameters (such as phase encoding directions) of the corresponding sequence.\ndir_label = 'LR';\n\nname_spec.modality = 'fmap';\nname_spec.suffix = 'epi';\nname_spec.ext = '.json';\nname_spec.entities = struct('sub', sub_label, ...\n                            'ses', ses_label, ...\n                            'acq', acq_label, ...\n                            'run', run_label, ...\n                            'dir', dir_label);\n% using the 'use_schema', true\n% ensures that the entities will be in the correct order\nbids_file = bids.File(name_spec, 'use_schema', true);\n\n% Contrust the fullpath version of the filename\njson_name = fullfile(root_dir, project, bids_file.bids_path, bids_file.filename);\n\n%% Adding metadata\n% to get the definition of each metadata,\n% you can use the bids.Schema class from bids matlab\n\n% For example\nschema = bids.Schema;\ndef = schema.get_definition('TaskName');\nfprintf(def.description);\n\njson.PhaseEncodingDirection = '';\njson.TotalReadoutTime = '';\njson.IntendedFor = {'sub-01/ses-01/func/...'\n                    'sub-01/ses-01/func/...'};\n\n% Write JSON\n% Make sure the directory exists\nbids.util.mkdir(fileparts(json_name));\nbids.util.jsonencode(json_name, json);\n"
  },
  {
    "path": "matlabCode/func/createBIDS_bold_json_full.m",
    "content": "%% Template Matlab script to create an BIDS compatible _bold.json file\n% This example lists all required and optional fields.\n% When adding additional metadata please use CamelCase\n% Use version of DICOM ontology terms whenever possible.\n%\n% DHermes, 2017\n\n% Writing json files relies on the JSONio library\n% https://github.com/bids-standard/bids-matlab\n%\n% Make sure it is in the matab/octave path\ntry\n    bids.bids_matlab_version;\ncatch\n    warning('%s\\n%s\\n%s\\n%s', ...\n            'Writing the JSON file seems to have failed.', ...\n            'Make sure that the following library is in the matlab/octave path:', ...\n            'https://github.com/bids-standard/bids-matlab');\nend\n\n%%\n\nclear;\n\nthis_dir = fileparts(mfilename('fullpath'));\nroot_dir = fullfile(this_dir, '..', filesep, '..');\n\nproject = 'templates';\n\nsub_label = '01';\nses_label = '01';\ntask_label = 'FullExample';\nrun_label = '01';\n\nname_spec.modality = 'func';\nname_spec.suffix = 'bold';\nname_spec.ext = '.json';\nname_spec.entities = struct('sub', sub_label, ...\n                            'ses', ses_label, ...\n                            'task', task_label, ...\n                            'run', run_label);\n\n% using the 'use_schema', true\n% ensures that the entities will be in the correct order\nbids_file = bids.File(name_spec, 'use_schema', true);\n\n% Contrust the fullpath version of the filename\njson_name = fullfile(root_dir, project, bids_file.bids_path, bids_file.filename);\n\n%% Adding metadata\n% to get the definition of each metadata,\n% you can use the bids.Schema class from bids matlab\n\n% For example\nschema = bids.Schema;\ndef = schema.get_definition('TaskName');\nfprintf(def.description);\n\n%% Required fields\njson.TaskName = 'FullExample';\njson.RepetitionTime = [];\n\n%% Required fields if using a fieldmap\njson.PhaseEncodingDirection = '';\njson.EffectiveEchoSpacing = [];\njson.EchoTime = [];\n\n%% Recommended fields:\n\n%% Scanner Hardware metadata fields\njson.Manufacturer = '';\njson.ManufacturersModelName = '';\njson.MagneticFieldStrength = [];\njson.DeviceSerialNumber = '';\njson.StationName = ' ';\njson.SoftwareVersions = ' ';\njson.HardcopyDeviceSoftwareVersion = '';\njson.ReceiveCoilName = ' ';\njson.ReceiveCoilActiveElements = '';\njson.GradientSetType = '';\njson.MRTransmitCoilSequence = '';\njson.MatrixCoilMode = '';\njson.CoilCombinationMethod = '';\n\n%% Sequence Specifics metadata fields\njson.PulseSequenceType = '';\njson.ScanningSequence = '';\njson.SequenceVariant = '';\njson.ScanOptions = '';\njson.SequenceName = '';\njson.PulseSequenceDetails = '';\njson.NonlinearGradientCorrection = '';\n\n%% In-Plane Spatial Encoding metadata fields\njson.NumberShots = [];\njson.ParallelReductionFactorInPlane = '';\njson.ParallelAcquisitionTechnique = '';\njson.PartialFourier = '';\njson.PartialFourierDirection = '';\njson.WaterFatShift = '';\njson.EchoTrainLength = '';\n\n%% Timing Parameters metadata fields\njson.InversionTime = [];\njson.SliceEncodingDirection = '';\njson.DwellTime = [];\njson.TotalReadoutTime = [];\njson.DelayAfterTrigger = [];\njson.NumberOfVolumesDiscardedByScanner = [];\njson.NumberOfVolumesDiscardedByUser = [];\n\n%% RF & Contrast metadata field\njson.FlipAngle = [];\n\n%% Slice Acceleration metadata field\njson.MultibandAccelerationFactor = [];\n\n%% Task metadata field\njson.Instructions = '';\njson.TaskDescription = '';\njson.CogAtlasID = 'https://www.cognitiveatlas.org/FIXME';\njson.CogPOID = 'http://www.cogpo.org/ontologies/CogPOver1.owl#FIXME';\n\n%% Institution information metadata fields\njson.InstitutionName = '';\njson.InstitutionAddress = '';\njson.InstitutionalDepartmentName = '';\n\n%% Write JSON\n% Make sure the directory exists\nbids.util.mkdir(fileparts(json_name));\nbids.util.jsonencode(json_name, json);\n"
  },
  {
    "path": "matlabCode/func/createBIDS_bold_json_short.m",
    "content": "%% Template Matlab script to create an BIDS compatible _bold.json file\n% This example only lists the required fields.\n% When adding additional metadata please use CamelCase\n% Use version of DICOM ontology terms whenever possible.\n%\n% DHermes, 2017\n\n% Writing json files relies on the JSONio library\n% https://github.com/bids-standard/bids-matlab\n%\n% Make sure it is in the matab/octave path\ntry\n    bids.bids_matlab_version;\ncatch\n    warning('%s\\n%s\\n%s\\n%s', ...\n            'Writing the JSON file seems to have failed.', ...\n            'Make sure that the following library is in the matlab/octave path:', ...\n            'https://github.com/bids-standard/bids-matlab');\nend\n\n%%\n\nclear;\n\nthis_dir = fileparts(mfilename('fullpath'));\nroot_dir = fullfile(this_dir, '..', filesep, '..');\n\nproject = 'templates';\n\nsub_label = '01';\nses_label = '01';\ntask_label = 'ShortExample';\nrun_label = '01';\n\nname_spec.modality = 'func';\nname_spec.suffix = 'bold';\nname_spec.ext = '.json';\nname_spec.entities = struct('sub', sub_label, ...\n                            'ses', ses_label, ...\n                            'task', task_label, ...\n                            'run', run_label);\n\n% using the 'use_schema', true\n% ensures that the entities will be in the correct order\nbids_file = bids.File(name_spec, 'use_schema', true);\n\n% Contrust the fullpath version of the filename\njson_name = fullfile(root_dir, project, bids_file.bids_path, bids_file.filename);\n\n%% Adding metadata\n% to get the definition of each metadata,\n% you can use the bids.Schema class from bids matlab\n\n% For example\nschema = bids.Schema;\ndef = schema.get_definition('TaskName');\nfprintf(def.description);\n\n%% Required fields\njson.TaskName = 'ShortExample';\njson.RepetitionTime = [];\njson.SliceTiming = [];\n\n%% Required fields if using a fieldmap\njson.PhaseEncodingDirection = '';\njson.EffectiveEchoSpacing = [];\njson.EchoTime = [];\n\n%% Write JSON\n% Make sure the directory exists\nbids.util.mkdir(fileparts(json_name));\nbids.util.jsonencode(json_name, json);\n"
  },
  {
    "path": "matlabCode/general/README.md",
    "content": "# Code to generate \"modality agnostic\" BIDS files\n\n## bids_spreadsheet2participants\n\nThis function requires Matlab 2018a or above to run.\n\nRun the following in Matlab:\n\n```matlab\ncd matlabCode/general\ninput_file = fullfile(pwd, 'input', 'input_to_create_participants_file.xlsx')\nfiles_out = bids_spreadsheet2participants(input_file, 'ignore', 'comment')\n```\n"
  },
  {
    "path": "matlabCode/general/bids_spreadsheet2participants.m",
    "content": "function files_out = bids_spreadsheet2participants(varargin)\n    %\n    % routine to takes an spreadsheet file (for example: excel) as input and export as participants.tsv\n    % and participants.json\n    %\n    % FORMAT files_out = bids_spreadsheet2participants(file_in,'ignore','field1','field2',...)\n    %\n    % INPUTS if empty user is prompted:\n    %\n    %   - 'file_in' is the excel file, with at least the 3 BIDS mandatory fields in the 1st sheet:\n    %       - participant_id,\n    %       - age,\n    %       - gender\n    %\n    %     A second sheet can be used to specify variables for the json file column format:\n    %       - variable name (same as sheet 1),\n    %       - description,\n    %       - values (optional)\n    %\n    %   - 'ignore' is the key to ignore specific fields (columns) in the excel file\n    %     for example: 'ignore', 'variableX', 'variableY'\n    %\n    %   - 'export_dir' is the directory to save output files\n    %\n    % OUTPUT:\n    %\n    %   - 'files_out' is a cell array with:\n    %       - files_out{1} the full name of the particpiants.tsv\n    %       - files_out{2} the full name of the particpiants.json\n    %\n    % EXAMPLE:\n    %\n    %   files_out = bids_spreadsheet2participants('D:\\icpsr_subset.xlsx','ignore','EEGtesttime')\n    %\n    % the spreadsheet must have:\n    %   worksheet 1 with data, each column has a variable name and values\n    %       -- note missing values MUST be n/a or nill\n    %   worksheet 2 is optional with columns variables, Description, Levels, Units to describe worksheet 1\n    %   variables similar to\n    % https://bids-specification.readthedocs.io/en/stable/03-modality-agnostic-files.html#participants-file\n    %       -- note the order of 'Levels' names should match the order of apparition in the data\n    %          to have an exact match\n    %\n    % Requires matlab 2018a or above\n    %\n    % Cyril Pernet - March 2021\n    % ---------------------------------\n\n    if verLessThan('matlab', '9.4')\n        error('This function requires matlab 2018a or above.');\n    end\n\n    files_out = cell(2, 1);\n    % check library\n    if ~exist('jsonwrite.m', 'file')\n        if exist(fullfile(fileparts(which('bids_spreadsheet2participants.m')), 'JSONio'), 'dir')\n            addpath(fullfile(fileparts(which('bids_spreadsheet2participants.m')), 'JSONio'));\n        else\n            error(['JSONio library needed, available with EEGLAB bids-matlab-tools or', ...\n                   'at https://github.com/gllmflndn/JSONio']);\n        end\n    end\n\n    %% deal with input file\n    if nargin == 0\n        [filename, pathname] = uigetfile({'*.xlsx;*.ods;*.xls'}, 'Pick an spreadsheet file');\n        if isequal(filename, 0) || isequal(pathname, 0)\n            disp('Selection cancelled');\n            return\n        else\n            filein = fullfile(pathname, filename);\n            disp(['file selected: ', filein]);\n        end\n    else\n        filein = varargin{1};\n        if ~exist(filein, 'file')\n            error('%s not found', filein);\n        end\n    end\n\n    % detect what's inside the selected file\n    sheet1_opts = detectImportOptions(filein, 'Sheet', 1);\n    try\n        sheet2_opts = detectImportOptions(filein, 'PreserveVariableNames', true, 'Sheet', 2);\n    catch one_sheet\n        fprintf('import only variables: %s\\n', one_sheet.message);\n        sheet2_opts = [];\n    end\n\n    %% quickly check other arguments are valid\n    if nargin > 1\n        if ~any(contains(varargin, {'ignore', 'export'}, 'IgnoreCase', true))\n            error('key input arguments in are missing ''ignore'' and/or ''export_dir''');\n        else\n            if any(contains(varargin, 'export', 'IgnoreCase', true))\n                export_dir = varargin{find(contains(varargin, 'export', 'IgnoreCase', true)) + 1};\n            end\n\n            if any(contains(varargin, 'ignore', 'IgnoreCase', true))\n                if any(contains(varargin, 'export', 'IgnoreCase', true))\n                    if find(contains(varargin, 'ignore', 'IgnoreCase', true)) < ...\n                      find(contains(varargin, 'export', 'IgnoreCase', true))\n                        ignore_var = find(contains(varargin, 'ignore', 'IgnoreCase', true)) + ...\n                          1:find(contains(varargin, 'export', 'IgnoreCase', true)) - 1;\n                    else\n                        ignore_var = find(contains(varargin, 'ignore', 'IgnoreCase', true)) + 1:nargin;\n                    end\n                else\n                    ignore_var = find(contains(varargin, 'ignore', 'IgnoreCase', true)) + 1:nargin;\n                end\n            end\n        end\n    end\n\n    %% create particpiants.tsv\n    Data = readtable(filein, sheet1_opts);\n\n    % 1st check mandatory/recommended fields are presents\n    participant_idvar = any(strcmpi(Data.Properties.VariableNames, 'participant_id'));\n    idvar = any(strcmpi(Data.Properties.VariableNames, 'id'));\n    if idvar == 0 && participant_idvar == 0\n        error('no participant ID variable detected, invalid file');\n    elseif idvar == 1 && participant_idvar == 0\n        disp('ID variable detected, the BIDS value exported will be participant_id ');\n        Data.Properties.VariableNames(strcmpi(Data.Properties.VariableNames, 'id')) = {'participant_id'};\n    end\n\n    if length(unique(Data.participant_id)) ~= length(Data.participant_id)\n        [~, idx] = unique(Data.participant_id);\n        non_unique = setdiff(1:length(Data.participant_id), idx);\n        non_unique = cell2mat(Data.participant_id(non_unique));\n        for id = 1:size(non_unique, 1)\n            warning('some IDs are duplicate: %s', non_unique(id, :));\n        end\n        error('non unique IDS are not permitted');\n    end\n\n    if any(strcmp(Data.Properties.VariableNames, 'Sex'))\n        Data.Properties.VariableNames(strcmpi(Data.Properties.VariableNames, 'Sex')) = {'sex'};\n    end\n    sexvar = any(strcmpi(Data.Properties.VariableNames, 'sex'));\n    gendervar = any(strcmpi(Data.Properties.VariableNames, 'gender'));\n    if gendervar == 1 && sexvar == 0\n        disp('gender variable detected - the recommended optional field is ''sex'' but ok using gender');\n    end\n\n    if any(strcmp(Data.Properties.VariableNames, 'Age'))\n        Data.Properties.VariableNames(strcmpi(Data.Properties.VariableNames, 'Age')) = {'age'};\n    end\n    if ~any(strcmpi(Data.Properties.VariableNames, 'age'))\n        disp('age variable is missing - this is only an optional field still exporting');\n    else\n        if ~isnumeric(Data.age)\n            for v = 1:length(Data.age)\n                Data.age{v} = str2double(Data.age{v});\n            end\n            Data.age = cell2mat(Data.age); % ensure age treated as number\n        end\n    end\n\n    % 2nd check if any of those variable should be removed - and feedback if\n    % some input variable names were not found\n    if nargin > 1\n        if any(contains(varargin, 'ignore', 'IgnoreCase', true))\n            for var = ignore_var\n                if any(contains(Data.Properties.VariableNames, varargin{var}, 'IgnoreCase', true))\n                    Data = removevars(Data, varargin{var});\n                else\n                    fprintf('''%s'' input variable to ignore not recognized - skipping it\\n', varargin{var});\n                end\n            end\n        else\n            warning('ignore argument not recognized - skipping any options');\n        end\n    end\n\n    % last check variable values (also useful for metadata)\n    if any(~contains(Data.participant_id, 'sub-'))\n        disp('participant_id should include ''sub-'', adding it to current IDs');\n        for sub = 1:length(Data.participant_id)\n            if ~contains(Data.participant_id{sub}, 'sub-')\n                Data.participant_id{sub} = ['sub-' Data.participant_id{sub}];\n            end\n        end\n    end\n\n    value_types = varfun(@class, Data, 'OutputFormat', 'cell');\n    for v = length(value_types):-1:1\n        values{v} = unique(Data.(Data.Properties.VariableNames{v}));\n    end\n\n    export_data = convert_NAN_to_na(Data);\n\n    if ~exist('export_dir', 'var')\n        export_dir = uigetdir(fileparts(filein), 'Select directory to save exported files');\n        if export_dir == 0\n            export_dir = fileparts(filein);\n        end\n    end\n    try\n        writetable(export_data, [export_dir filesep 'participants.tsv'], 'FileType', 'text', 'Delimiter', '\\t');\n        files_out{1} = fullfile(export_dir, 'participants.tsv');\n        fprintf('participants.tsv file saved in %s\\n', export_dir);\n        clear export_data;\n    catch tsv_error\n        files_out{2} = 'particpants.tsv file not created';\n        error('participants.tsv not saved %s\\n', tsv_error.mewsage);\n    end\n\n    %% create participants.json\n    if ~isempty(sheet2_opts)\n        GivenMetaData = readtable(filein, sheet2_opts);\n\n        if any(contains(GivenMetaData.Properties.VariableNames, 'Variable'))\n            GivenMetaData.Properties.VariableNames(strcmpi(GivenMetaData.Properties.VariableNames, 'Variable')) = ...\n              {'variables'};\n        elseif any(contains(GivenMetaData.Properties.VariableNames, 'variable'))\n            GivenMetaData.Properties.VariableNames(strcmpi(GivenMetaData.Properties.VariableNames, 'variable')) = ...\n              {'variables'};\n        end\n\n        if ~any(strcmpi('variables', GivenMetaData.Properties.VariableNames))\n            warning('metadata sheet provided but ''variables name'' not found - using worksheet 1');\n        else\n            % given variables present check description\n            if ~any(contains(GivenMetaData.Properties.VariableNames, 'description', 'IgnoreCase', true))\n                warning('metadata sheet provided but ''description of variables'' not found - using worksheet 1');\n            else\n                matched_var = cellfun(@(x) find(strcmpi(x, Data.Properties.VariableNames)), GivenMetaData.variables, ...\n                                      'UniformOutput', false);\n                matched_var(cellfun(@(x) isempty(x), matched_var')) = {0}; % mark empty as 0\n                try\n                    matched_var = cell2mat(matched_var); % works if unique, ie one value per cell\n                    if any(contains(GivenMetaData.Properties.VariableNames, 'description'))\n                        GivenMetaData.Properties.VariableNames(strcmpi(GivenMetaData.Properties.VariableNames, ...\n                                                                       'description')) = ...\n                          {'Description'};\n                    end\n                catch matched_var_err\n                    warning(['variable names between worksheets likely not unique,', ...\n                             ' skipping provided metadata \\n%s\\n'], ...\n                            matched_var_err.message); %#ok<MEXCEP>\n                end\n            end\n\n            % given variables present check levels\n            if ~any(contains(GivenMetaData.Properties.VariableNames, 'level', 'IgnoreCase', true))\n                warning('metadata sheet provided but ''levels'' not found - using worksheet 1');\n            else\n                if any(contains(GivenMetaData.Properties.VariableNames, 'level'))\n                    GivenMetaData.Properties.VariableNames(strcmpi(GivenMetaData.Properties.VariableNames, ...\n                                                                   'level')) = ...\n                      {'Levels'};\n                elseif any(contains(GivenMetaData.Properties.VariableNames, 'levels'))\n                    GivenMetaData.Properties.VariableNames(strcmpi(GivenMetaData.Properties.VariableNames, ...\n                                                                   'levels')) = ...\n                      {'Levels'};\n                end\n            end\n\n            % given variables present check unit\n            if ~any(contains(GivenMetaData.Properties.VariableNames, 'unit', 'IgnoreCase', true))\n                warning('metadata sheet provided but ''Units'' of variables not found');\n            else\n                if any(contains(GivenMetaData.Properties.VariableNames, 'unit'))\n                    GivenMetaData.Properties.VariableNames(strcmpi(GivenMetaData.Properties.VariableNames, ...\n                                                                   'unit')) = ...\n                      {'Units'};\n                elseif any(contains(GivenMetaData.Properties.VariableNames, 'units'))\n                    GivenMetaData.Properties.VariableNames(strcmpi(GivenMetaData.Properties.VariableNames, ...\n                                                                   'units')) = ...\n                      {'Units'};\n                end\n            end\n        end\n    else\n        matched_var = zeros(length(Data.Properties.VariableNames), 1);\n    end\n\n    % prepare json variables from worksheet 1\n    % 'values' are the unique values read on the data\n    % 'value_types' gives an indication if we want to use Level or Unit\n    % we can complement with GivenMetaData.Description, GivenMetaData.Levels and GivenMetaData.Units\n    % using 'matched_var' for instance: variables names match between worksheet\n\n    json = struct;\n    for var = 1:length(Data.Properties.VariableNames)\n        if ~strcmpi(Data.Properties.VariableNames{var}, 'participant_id')\n            % add description\n            if ismember(var, matched_var)\n                if any(contains(GivenMetaData.Properties.VariableNames, 'Description'))\n                    if ~isempty(GivenMetaData.Description{matched_var == var})\n                        json.(Data.Properties.VariableNames{var}).Description = ...\n                          GivenMetaData.Description{matched_var == var};\n                    else\n                        json.(Data.Properties.VariableNames{var}).Description = [];\n                    end\n                end\n            else\n                json.(Data.Properties.VariableNames{var}).Description = [];\n            end\n\n            % add Levels and Units\n            if strcmpi(value_types{var}, 'cell') % likely Levels\n                if ismember(var, matched_var) && any(contains(GivenMetaData.Properties.VariableNames, 'Levels'))\n                    if ~isempty(GivenMetaData.Levels{matched_var == var})\n                        tmp = lower(GivenMetaData.Levels{matched_var == var});\n                        tmp = regexprep(tmp, '\\t', ';'); % in case tab is used\n                        tmp(isspace(tmp)) = []; % deblank as well\n                        separators = sort([strfind(tmp, ';') strfind(tmp, ',') length(tmp)]);\n                        index1 = 1;\n                        index2 = separators(1) - 1;\n                        for l = 1:length(separators)\n                            Levels{l} = tmp(index1:index2);\n                            if l < length(separators)\n                                index1 = separators(l) + 1;\n                                index2 = separators(l + 1);\n                            end\n                        end\n\n                        tmp = values{var};\n                        tmp(strcmpi(tmp, 'n/a')) = [];\n                        tmp(strcmpi(tmp, 'nill')) = [];\n                        if length(tmp) ~= length(Levels)\n                            warning('Levels of ''%s'' between data and metadata don''t match', ...\n                                    Data.Properties.VariableNames{var});\n                            % only write fields\n                            for v = 1:length(tmp)\n                                json.(Data.Properties.VariableNames{var}).Levels.(tmp{v}) = [];\n                            end\n                        else\n                            % store levels\n                            for v = 1:length(tmp)\n                                json.(Data.Properties.VariableNames{var}).Levels.(tmp{v}) = Levels{v};\n                            end\n                        end\n                    else\n                        json.(Data.Properties.VariableNames{var}).Levels = [];\n                    end\n                else % no metadata\n                    json.(Data.Properties.VariableNames{var}).Levels = values{var};\n                end\n            else % likely units\n                if ismember(var, matched_var) && any(contains(GivenMetaData.Properties.VariableNames, 'Units'))\n                    if ~isempty(GivenMetaData.Levels{var})\n                        json.(Data.Properties.VariableNames{var}).Units = ...\n                          lower(GivenMetaData.Units{matched_var == var});\n                    else\n                        json.(Data.Properties.VariableNames{var}).Units = [];\n                    end\n                else % no metadata\n                    json.(Data.Properties.VariableNames{var}).Units = [];\n                end\n            end\n        end\n    end\n\n    try\n        jsonwrite([export_dir filesep 'participants.json'], json, struct('indent', ' '));\n        files_out{2} = fullfile(export_dir, 'participants.json');\n        fprintf('participants.json file saved in %s\\n', export_dir);\n        warndlg(sprintf('json file created, do check it ! \\n it is almost certain it needs editing'), ...\n                'BIDS spec', 'modal');\n    catch json_err\n        files_out{2} = 'particpants.json file not created';\n        error('participants.json not saved %s\\n', json_err.mewsage);\n    end\n\nend\n\nfunction export_data = convert_NAN_to_na(data)\n\n    % make sure to export NaN as n/a\n    export_data = data;\n\n    for v = 1:length(export_data.Properties.VariableNames)\n\n        if strcmp(class(export_data.(cell2mat(export_data.Properties.VariableNames(v)))), 'double')\n\n            export_data.(cell2mat(export_data.Properties.VariableNames(v))) = ...\n              num2cell(export_data.(cell2mat(export_data.Properties.VariableNames(v))));\n\n            for n = 1:size(export_data.(cell2mat(export_data.Properties.VariableNames(v))), 1)\n                if isnan(export_data.(cell2mat(export_data.Properties.VariableNames(v))){n})\n                    export_data.(cell2mat(export_data.Properties.VariableNames(v))){n} = 'n/a';\n                end\n            end\n\n        end\n\n    end\n\nend\n"
  },
  {
    "path": "matlabCode/general/createBIDS_dataset_description_json.m",
    "content": "%% Template Matlab script to create an BIDS compatible dataset_description.json file\n% This example lists all required and optional fields.\n% When adding additional metadata please use CamelCase\n%\n% DHermes, 2017\n\n% Writing json files relies on the JSONio library\n% https://github.com/bids-standard/bids-matlab\n%\n% Make sure it is in the matab/octave path\ntry\n    bids.bids_matlab_version;\ncatch\n    warning('%s\\n%s\\n%s\\n%s', ...\n            'Writing the JSON file seems to have failed.', ...\n            'Make sure that the following library is in the matlab/octave path:', ...\n            'https://github.com/bids-standard/bids-matlab');\nend\n\n%%\nclear;\n\nthis_dir = fileparts(mfilename('fullpath'));\nroot_dir = fullfile(this_dir, '..', filesep, '..');\n\nproject_label = 'templates';\n\njson_label = 'dataset_description';\n\njson_name = fullfile(root_dir, project_label, 'dataset_description.json');\n\n%% General fields, shared with MRI BIDS and MEG BIDS:\n\n%% Required fields:\n\n% name of the dataset\njson.Name = '';\n\n% The version of the BIDS standard that was used\njson.BIDSVersion = '1.7.0';\n\n% The interpretation of the dataset. MUST be one of \"raw\" or \"derivative\".\n% For backwards compatibility, the default value is \"raw\".\njson.DatasetType = 'raw';\n\n%% Recommended fields:\n\n% what license is this dataset distributed under? The\n% use of license name abbreviations is suggested for specifying a license.\n% A list of common licenses with suggested abbreviations can be found in appendix III.\njson.License = '';\n\n% List of individuals who contributed to the\n% creation/curation of the dataset\njson.Authors = {'', '', ''};\n\njson.Acknowledgements = ''; % who should be acknowledge in helping to collect the data\n\n% Instructions how researchers using this\n% dataset should acknowledge the original authors. This field can also be used\n% to define a publication that should be cited in publications that use the\n% dataset.\njson.HowToAcknowledge = '';\n\n% sources of funding (grant numbers)\njson.Funding = {'', '', ''};\n\n% List of ethics committee approvals of the research protocols and/or protocol identifiers.\njson.EthicsApprovals = {''};\n\n% a list of references to\n% publication that contain information on the dataset, or links.\njson.ReferencesAndLinks = {'', '', ''};\n\n% the Document Object Identifier of the dataset\n% (not the corresponding paper).\njson.DatasetDOI = 'doi:';\n\n%% Write JSON\n% Make sure the directory exists\nbids.util.mkdir(fileparts(json_name));\nbids.util.jsonencode(json_name, json);\n"
  },
  {
    "path": "matlabCode/general/createBIDS_events_tsv_json_full.m",
    "content": "%% Template Matlab script to create an BIDS compatible sub-01_ses-01_task-FullExample-01_events.tsv file\n% This example lists all required and optional fields.\n% When adding additional metadata please use CamelCase\n%\n% anushkab, 2018\n\n% Writing json files relies on the JSONio library\n% https://github.com/bids-standard/bids-matlab\n%\n% Make sure it is in the matab/octave path\ntry\n    bids.bids_matlab_version;\ncatch\n    warning('%s\\n%s\\n%s\\n%s', ...\n            'Writing the JSON file seems to have failed.', ...\n            'Make sure that the following library is in the matlab/octave path:', ...\n            'https://github.com/bids-standard/bids-matlab');\nend\n\n%%\nclear;\n\nthis_dir = fileparts(mfilename('fullpath'));\nroot_dir = fullfile(this_dir, '..', filesep, '..');\n\nproject = 'templates';\n\nsub_label = '01';\nses_label = '01';\ntask_label = 'FullExample';\nrun_label = '01';\n\nname_spec.modality = 'func';\nname_spec.suffix = 'events';\nname_spec.ext = '.tsv';\nname_spec.entities = struct('sub', sub_label, ...\n                            'ses', ses_label, ...\n                            'task', task_label, ...\n                            'run', run_label);\n\n% using the 'use_schema', true\n% ensures that the entities will be in the correct order\nbids_file = bids.File(name_spec, 'use_schema', true);\n\n% Contrust the fullpath version of the filename\nevents_tsv_name = fullfile(root_dir, project, bids_file.bids_path, bids_file.filename);\nevents_json_name = fullfile(root_dir, project, bids_file.bids_path, bids_file.json_filename);\n\n%% make an event table and save\n\n%% CONTAINS a set of REQUIRED and OPTIONAL columns\n% REQUIRED Onset (in seconds) of the event measured from the beginning of\n% the acquisition of the first volume in the corresponding task imaging data file.\n% If any acquired scans have been discarded before forming the imaging data file,\n% ensure that a time of 0 corresponds to the first image stored. In other words\n% negative numbers in onset are allowed.\ntsv.onset = 0;\n\n% REQUIRED. Duration of the event (measured from onset) in seconds.\n% Must always be either zero or positive. A \"duration\" value of zero implies\n% that the delta function or event is so short as to be effectively modeled as an impulse.\ntsv.duration = 0;\n\n% OPTIONAL Primary categorisation of each trial to identify them as instances\n% of the experimental conditions\ntsv.trial_type = {'afraid'};\n\n% OPTIONAL. Response time measured in seconds. A negative response time can be\n% used to represent preemptive responses and n/a denotes a missed response.\ntsv.response_time = 0;\n\n% OPTIONAL Represents the location of the stimulus file (image, video, sound etc.)\n% presented at the given onset time\ntsv.stim_file = {' '};\n\n% OPTIONAL Hierarchical Event Descriptor (HED) Tag.\ntsv.HED = {' '};\n\n%% Save table\nbids.util.tsvwrite(events_tsv_name, tsv);\n\n%% associated data dictionary\n\ntemplate = struct('LongName', '', ...\n                  'Description', '', ...\n                  'Levels', [], ...\n                  'Units', '', ...\n                  'TermURL', '');\n\njson.trial_type = template;\njson.trial_type.Description = 'Emotion image type';\njson.trial_type.Levels = struct('afraid', 'A face showing fear is displayed', ...\n                                'angry', 'A face showing anger is displayed');\n\njson.identifier.LongName = 'Unique identifier from Karolinska (KDEF) database';\njson.identifier.Description = 'ID from KDEF database used to identify the displayed image';\n\njson.StimulusPresentation.OperatingSystem = 'Linux Ubuntu 18.04.5';\njson.StimulusPresentation.SoftwareName = 'Psychtoolbox';\njson.StimulusPresentation.SoftwareRRID = 'SCR_002881';\njson.StimulusPresentation.SoftwareVersion = '3.0.14';\njson.StimulusPresentation.Code = 'doi:10.5281/zenodo.3361717';\n\n%% Write JSON\n% Make sure the directory exists\nbids.util.mkdir(fileparts(events_json_name));\nbids.util.jsonencode(events_json_name, json);\n"
  },
  {
    "path": "matlabCode/general/createBIDS_participants_tsv.m",
    "content": "%% Template Matlab script to create an BIDS compatible participants.tsv file\n% This example lists all required and optional fields.\n% When adding additional metadata please use CamelCase\n%\n% DHermes, 2017\n\n% Writing json files relies on the JSONio library\n% https://github.com/bids-standard/bids-matlab\n%\n% Make sure it is in the matab/octave path\ntry\n    bids.bids_matlab_version;\ncatch\n    warning('%s\\n%s\\n%s\\n%s', ...\n            'Writing the JSON file seems to have failed.', ...\n            'Make sure that the following library is in the matlab/octave path:', ...\n            'https://github.com/bids-standard/bids-matlab');\nend\n\n%%\nclear;\n\nthis_dir = fileparts(mfilename('fullpath'));\nroot_dir = fullfile(this_dir, '..', filesep, '..');\n\nproject_label = 'templates';\n\nparticipants_tsv_name = fullfile(root_dir, project_label, 'participants.tsv');\n\n%% make a participants table and save\n\ntsv.participant_id = {'sub-01'; 'sub-epilepsy01'};\ntsv.age = [0; 10];\ntsv.sex = {'m'; 'f'};\ntsv.handedness = {'l'; 'r'};\n\nbids.util.tsvwrite(participants_tsv_name, tsv);\n\n%% associated data dictionary\n\ntemplate = struct( ...\n                  'LongName', '', ...\n                  'Description', '', ...\n                  'Levels', struct(), ...\n                  'Units', '', ...\n                  'TermURL', 'http://www.todo.com/fixme');\n\njson.age = template;\njson.age.Description = 'age of the participant';\njson.age.Units = 'years';\n\njson.sex = template;\njson.sex.Description = 'sex of the participant as reported by the participant';\njson.sex.Levels = struct( ...\n                         'm', 'male', ...\n                         'f', 'female');\n\njson.handedness = template;\njson.handedness.Description = 'handedness of the participant as reported by the participant';\njson.handedness.Levels = struct( ...\n                                'l', 'left', ...\n                                'r', 'right');\n\njson_name = fullfile(root_dir, project_label, 'participants.json');\n\n% Write JSON\n% Make sure the directory exists\nbids.util.mkdir(fileparts(json_name));\nbids.util.jsonencode(json_name, json);\n"
  },
  {
    "path": "matlabCode/general/createBIDS_samples_tsv.m",
    "content": "%% Template Matlab script to create an BIDS compatible samples.tsv file\n\n% Writing json files relies on the JSONio library\n% https://github.com/bids-standard/bids-matlab\n%\n% Make sure it is in the matab/octave path\ntry\n    bids.bids_matlab_version;\ncatch\n    warning('%s\\n%s\\n%s\\n%s', ...\n            'Writing the JSON file seems to have failed.', ...\n            'Make sure that the following library is in the matlab/octave path:', ...\n            'https://github.com/bids-standard/bids-matlab');\nend\n\n%%\nclear;\n\nthis_dir = fileparts(mfilename('fullpath'));\nroot_dir = fullfile(this_dir, '..', filesep, '..');\n\nproject_label = 'templates';\n\nsamples_tsv_name = fullfile(root_dir, project_label, 'samples.tsv');\n\n%% make a participants table and save\n\ntsv.sample_id = {'sample-01'; 'sample-02'};\ntsv.participant_id = {'sub-01'; 'sub-epilepsy01'};\ntsv.sample_type = {'tissue'; 'tissue'};\n\nbids.util.tsvwrite(samples_tsv_name, tsv);\n\n%% associated data dictionary\n\n% use the BIDS schema to get the official definitions\nschema = bids.Schema;\n\ncolumns = fieldnames(tsv);\n\nfor i = 1:numel(columns)\n    def = schema.get_definition(columns{i});\n    json.(columns{i}).LongName = def.display_name;\n    json.(columns{i}).Description = def.description;\nend\n\njson_name = fullfile(root_dir, project_label, 'samples.json');\n\n% Write JSON\n% Make sure the directory exists\nbids.util.mkdir(fileparts(json_name));\nbids.util.jsonencode(json_name, json);\n"
  },
  {
    "path": "matlabCode/general/tests/data/participants.json",
    "content": "{\r\n \"collectionIssues\": {\r\n  \"Description\": [],\r\n  \"Levels\": [\r\n   \"broken trigger cable, no EEG codes\",\r\n   \"nill\",\r\n   \"no EEG\",\r\n   \"no MRI\",\r\n   \"none\"\r\n  ]\r\n },\r\n \"CognitiveTest1\": {\r\n  \"Description\": [],\r\n  \"Units\": []\r\n },\r\n \"CognitiveTest2\": {\r\n  \"Description\": [],\r\n  \"Units\": []\r\n },\r\n \"testdate\": {\r\n  \"Description\": \"data collection start time\",\r\n  \"Units\": []\r\n },\r\n \"age\": {\r\n  \"Description\": \"Age in years\",\r\n  \"Units\": []\r\n },\r\n \"sex\": {\r\n  \"Description\": \"Sex\",\r\n  \"Levels\": {\r\n   \"Female\": \"male\",\r\n   \"Male\": \"female\"\r\n  }\r\n }\r\n}\n"
  },
  {
    "path": "matlabCode/general/tests/data/participants.tsv",
    "content": "participant_id\tcollectionIssues\tCognitiveTest1\tCognitiveTest2\ttestdate\tage\tsex\r\nsub-control1\tnone\t8\t1\t01-Nov-2019\tn/a\tnill\r\nsub-control2\tnone\t11\t2\t01-Nov-2019\tn/a\tnill\r\nsub-control3\tno MRI\tn/a\t1\tNaT\tn/a\tMale\r\nsub-control4\tnone\t8\t1\t07-Nov-2019\t5.52328767123288\tFemale\r\nsub-control5\tnone\t8\t2\t07-Nov-2019\t5.06575342465753\tFemale\r\nsub-control6\tnone\t11\t1\t04-Feb-2020\t5.4986301369863\tMale\r\nsub-patient1\tnill\tn/a\t5\tNaT\tn/a\tFemale\r\nsub-patient2\tno EEG\t7\t4\tNaT\tn/a\tnill\r\nsub-patient3\tnone\t11\t3\t12-Dec-2019\t5.68219178082192\tMale\r\nsub-patient4\tnone\t8\t1\t20-Feb-2020\tn/a\tnill\r\nsub-patient5\tnone\t11\t4\t05-Dec-2019\t5.12054794520548\tFemale\r\nsub-control7\tnone\t9\t1\t12-Dec-2019\t5.35342465753425\tMale\r\nsub-control8\tnone\t9\t2\t05-Dec-2019\t5.71506849315069\tFemale\r\nsub-control9\tnone\t9\t1\t04-Feb-2020\t5.2\tFemale\r\nsub-control10\tbroken trigger cable, no EEG codes\t9\t2\tNaT\tn/a\tFemale\r\nsub-patient6\tnone\t11\t5\t11-Feb-2020\t5.63013698630137\tFemale\r\n"
  },
  {
    "path": "matlabCode/general/tests/test_bids_spreadsheet2participants.m",
    "content": "% requires:\n% - moxunit: https://github.com/MOxUnit/MOxUnit\n% - bids-matlab\n\naddpath(fullfile(pwd, '..'));\n\ninput_file = fullfile(pwd, '..', 'input', 'spreadsheet_to_convert.xlsx');\nfiles_out = bids_spreadsheet2participants(input_file, 'ignore', 'comment', 'export', pwd);\n\njson_expected = jsonread(fullfile(pwd, 'data', 'participants.json'));\njson_actual = jsonread(fullfile(pwd, 'participants.json'));\n% uses moxunit assertEqual\nassertEqual(json_actual, json_expected);\n\ntsv_expected  = bids.util.tsvread(fullfile(pwd, 'data', 'participants.tsv'));\ntsv_actual  = bids.util.tsvread(fullfile(pwd, 'participants.tsv'));\nassertEqual(tsv_actual, tsv_expected);\n"
  },
  {
    "path": "matlabCode/ieeg/createBIDS_channels_tsv.m",
    "content": "%% Template Matlab script to create an BIDS compatible electrodes.tsv file\n% This example lists all required and optional fields.\n% When adding additional metadata please use CamelCase\n%\n% DHermes, 2017\n% modified Jaap van der Aar 30.11.18\n\n% Writing json files relies on the JSONio library\n% https://github.com/bids-standard/bids-matlab\n%\n% Make sure it is in the matab/octave path\ntry\n    bids.bids_matlab_version;\ncatch\n    warning('%s\\n%s\\n%s\\n%s', ...\n            'Writing the JSON file seems to have failed.', ...\n            'Make sure that the following library is in the matlab/octave path:', ...\n            'https://github.com/bids-standard/bids-matlab');\nend\n\n%%\nclear;\n\nthis_dir = fileparts(mfilename('fullpath'));\nroot_dir = fullfile(this_dir, '..', filesep, '..');\n\nproject = 'templates';\n\nsub_label = '01';\nses_label = '01';\ntask_label = 'LongExample';\nrun_label = '01';\n\nname_spec.modality = 'ieeg';\nname_spec.suffix = 'channels';\nname_spec.ext = '.tsv';\nname_spec.entities = struct('sub', sub_label, ...\n                            'ses', ses_label, ...\n                            'task', task_label, ...\n                            'run', run_label);\n\n% using the 'use_schema', true\n% ensures that the entities will be in the correct order\nbids_file = bids.File(name_spec, 'use_schema', true);\n\n% Contrust the fullpath version of the filename\nchannels_tsv_name = fullfile(root_dir, project, bids_file.bids_path, bids_file.filename);\n\n%% make a participants table and save\n\n%% required columns\nname = {'n/a'}; % Label of the channel, only contains letters and numbers. The label must\n% correspond to _electrodes.tsv name and all ieeg type channels are required to have \\\n% a position. The reference channel name MUST be provided in the reference column\n\ntype = {'n/a'}; % Type of channel, see below for adequate keywords in this field\n\nunits = {'n/a'}; % Physical unit of the value represented in this channel, for example: V for Volt,\n% specified according to the SI unit symbol and possibly prefix symbol (for example: mV, ?V),\n% see the BIDS spec (section 15 Appendix V: Units) for guidelines for Units and Prefixes.\n\nlow_cutoff = [0]; % Frequencies used for the low pass filter applied to the\n% channel in Hz. If no low pass filter was applied, use n/a. Note that\n% anti-alias is a low pass filter, specify its frequencies here if applicable.\n\nhigh_cutoff = [0]; % Frequencies used for the high pass filter applied to\n% the channel in Hz. If no high pass filter applied, use n/a.\n\n%% recommended columns:\n\nreference = {'n/a'}; % Specification of the reference (for example: \"mastoid\", \"ElectrodeName01\",\n% \"intracranial\", \"CAR\", \"other\", \"n/a\"). If the channel is not an electrode channel\n% (for example: a microphone channel) use `n/a`.\n\ngroup = {'n/a'}; % Which group of channels (grid/strip/probe) this channel belongs to.\n% One group has one wire and noise can be shared. This can be a name or number.\n% Note that any groups specified in `_electrodes.tsv` must match those present here.\n\n%% optional columns\n\nsampling_frequency = [0]; % Sampling rate of the channel in Hz.\n\ndescription = {'n/a'}; % Brief free-text description of the channel, or other information of\n% interest (for example: position (for example: 'left lateral temporal surface', 'unipolar/bipolar', etc.)).\n\nnotch = [0]; % Frequencies used for the notch filter applied to the channel,\n% in Hz. If no notch filter applied, use n/a.\n\nstatus = {'bad'}; % Data quality observed on the channel (good/bad). A channel is considered bad\n% if its data quality is compromised by excessive noise. Description of noise type SHOULD be\n% provided in [status_description].\n\nstatus_description = {'n/a'}; % Freeform text description of noise or artifact affecting data\n% quality on the channel. It is meant to explain why the channel was declared bad in [status].\n\n%% write\nt = table(name, type, units, low_cutoff, high_cutoff, reference, ...\n          group, sampling_frequency, description, notch, status, status_description);\n\nwritetable(t, channels_tsv_name, 'FileType', 'text', 'Delimiter', '\\t');\n"
  },
  {
    "path": "matlabCode/ieeg/createBIDS_coordsystem_json.m",
    "content": "%% Template Matlab script to create an BIDS compatible _electrodes.json file\n% For BIDS-iEEG\n% This example lists all required and optional fields.\n% When adding additional metadata please use CamelCase\n%\n% DHermes, 2017\n% modified Jaap van der Aar 30.11.18\n\n% Writing json files relies on the JSONio library\n% https://github.com/bids-standard/bids-matlab\n%\n% Make sure it is in the matab/octave path\ntry\n    bids.bids_matlab_version;\ncatch\n    warning('%s\\n%s\\n%s\\n%s', ...\n            'Writing the JSON file seems to have failed.', ...\n            'Make sure that the following library is in the matlab/octave path:', ...\n            'https://github.com/bids-standard/bids-matlab');\nend\n\n%%\nclear;\n\nthis_dir = fileparts(mfilename('fullpath'));\nroot_dir = fullfile(this_dir, '..', filesep, '..');\n\nproject = 'templates';\n\nsub_label = '01';\nses_label = '01';\n\nname_spec.modality = 'ieeg';\nname_spec.suffix = 'coordsystem';\nname_spec.ext = '.json';\nname_spec.entities = struct('sub', sub_label, ...\n                            'ses', ses_label);\n\n% using the 'use_schema', true\n% ensures that the entities will be in the correct order\nbids_file = bids.File(name_spec, 'use_schema', true);\n\n% Contrust the fullpath version of the filename\njson_name = fullfile(root_dir, project, bids_file.bids_path, bids_file.filename);\n\n%% Adding metadata\n% Assign the fields in the Matlab structure that can be saved as a json.\n% The following fields must be defined:\n\n% to get the definition of each metadata,\n% you can use the bids.Schema class from bids matlab\n% For example\nschema = bids.Schema;\ndef = schema.get_definition('iEEGCoordinateSystem');\nfprintf(def.description);\n\n%% Required fields\njson.iEEGCoordinateSystem = '';\njson.iEEGCoordinateUnits = '';\n\n%% Recommended fields\njson.iEEGCoordinateProcessingDescripton = '';\njson.IndendedFor = '';\njson.iEEGCoordinateProcessingDescription = '';\njson.iEEGCoordinateProcessingReference = '';\n\n%% Write JSON\n% Make sure the directory exists\nbids.util.mkdir(fileparts(json_name));\nbids.util.jsonencode(json_name, json);\n"
  },
  {
    "path": "matlabCode/ieeg/createBIDS_data_WriteBrainVisionWithFieldtrip.m",
    "content": "% %%%%% save data as BrainVision BIDS %%%%%\n%\n% Sample script that calls Fieldtrip functions to write a Brainvision dataset\n% Added fields are examples, read these from the raw data\n%\n% Fieldtrip has to be in the path!\n%\n% D. Hermes 2018\n\n% provide necessary labels and path to save the data:\ndataRootPath = '';\nsub_label = '01';\nses_label = '01';\ntask_label = 'visual';\nrun_label = '01';\n\n% name to save data:\nieeg_name_save = fullfile(dataRootPath, ['sub-' sub_label], ['ses-' ses_label], 'ieeg', ...\n                          ['sub-' sub_label...\n                           '_ses-' ses_label...\n                           '_task-' task_label...\n                           '_run-' run_label ...\n                           '_ieeg']);\n\n%%%% assign header fields:\n\n% sampling frequency\ndataStruct.hdr.Fs = 1000;\ndataStruct.hdr.nChans = 128;\n\n% number of channels\ndataStruct.hdr.label = cell(dataStruct.hdr.nChans, 1);\nfor kk = 1:dataStruct.hdr.nChans\n    dataStruct.hdr.label{kk} = ['iEEG' int2str(kk)];\nend\n\n% number of samples\ndataStruct.hdr.nSamples = 10000;\n\n% ?\ndataStruct.hdr.nSamplesPre = 0;\n\n% 1 trial for continuous data\ndataStruct.hdr.nTrials = 1;\n\n% channels type, see BIDS list of types\ndataStruct.hdr.chantype = cell(dataStruct.hdr.nChans, 1);\nfor kk = 1:dataStruct.hdr.nChans\n    dataStruct.hdr.chantype{kk} = ['ECOG'];\nend\n\n% I still don't how to indicate the mu in BIDS, now using letter u\ndataStruct.hdr.chanunit = repmat({'uV'}, size(d.data, 2), 1);\n\n% labels again, same as before\ndataStruct.label = dataStruct.hdr.label;\n\n% time vector\ndataStruct.time{1} = [1:dataStruct.hdr.nSamples] / dataStruct.hdr.Fs;\n\n% put the data matrix here: electrodes x samples\ndataStruct.trial{1} = data;\n\n% sampling freq again, same as before\ndataStruct.fsample = dataStruct.hdr.Fs;\n\n% ?\ndataStruct.sampleinfo = [1 dataStruct.hdr.nSamples];\n\n% now fetch a header\nhdr_data = ft_fetch_header(dataStruct);\n\n% save the data\nft_write_data(ieeg_name_save, dataStruct.trial{1}, 'header', hdr_data, 'dataformat', 'brainvision_eeg');\n"
  },
  {
    "path": "matlabCode/ieeg/createBIDS_electrodes_tsv.m",
    "content": "%% Template Matlab script to create an BIDS compatible electrodes.tsv file\n% This example lists all required and optional fields.\n% When adding additional metadata please use CamelCase\n%\n% DHermes, 2017\n% modified Giulio Castegnaro 201811\n\n% Writing json files relies on the JSONio library\n% https://github.com/bids-standard/bids-matlab\n%\n% Make sure it is in the matab/octave path\ntry\n    bids.bids_matlab_version;\ncatch\n    warning('%s\\n%s\\n%s\\n%s', ...\n            'Writing the JSON file seems to have failed.', ...\n            'Make sure that the following library is in the matlab/octave path:', ...\n            'https://github.com/bids-standard/bids-matlab');\nend\n\n%%\nclear;\n\nthis_dir = fileparts(mfilename('fullpath'));\nroot_dir = fullfile(this_dir, '..', filesep, '..');\n\nproject = 'templates';\n\nsub_label = '01';\nses_label = '01';\n\nname_spec.modality = 'ieeg';\nname_spec.suffix = 'electrodes';\nname_spec.ext = '.tsv';\nname_spec.entities = struct('sub', sub_label, ...\n                            'ses', ses_label);\n\n% using the 'use_schema', true\n% ensures that the entities will be in the correct order\nbids_file = bids.File(name_spec, 'use_schema', true);\n\n% Contrust the fullpath version of the filename\nelectrodes_tsv_name = fullfile(root_dir, project, bids_file.bids_path, bids_file.filename);\n\n%% make a participants table and save\n\n% to get the definition of each column,\n% you can use the bids.Schema class from bids matlab\n% For example\nschema = bids.Schema;\ndef = schema.get_definition('size');\nfprintf(def.description);\n\n%% required columns\ntsv.name = {'n/a'};\ntsv.x = 0;\ntsv.y = 0;\ntsv.z = 0;\ntsv.size = 0;\n\n%% recommended columns\ntsv.material = {'n/a'};\ntsv.manufacturer = {'n/a'};\ntsv.group = {'n/a'};\ntsv.hemisphere = {'n/a'};\n\n%% optional columns\ntsv.type = {'n/a'};\ntsv.impedance = nan;\n\n%% write\nbids.util.tsvwrite(electrodes_tsv_name, tsv);\n"
  },
  {
    "path": "matlabCode/ieeg/createBIDS_ieeg_json.m",
    "content": "%% Template Matlab script to create an BIDS compatible _ieeg.json file\n% This example lists all required and optional fields.\n% When adding additional metadata please use CamelCase\n%\n% DHermes, 2017\n% modified Jaap van der Aar & Giulio Castegnaro 30.11.18\n\n% Writing json files relies on the JSONio library\n% https://github.com/bids-standard/bids-matlab\n%\n% Make sure it is in the matab/octave path\ntry\n    bids.bids_matlab_version;\ncatch\n    warning('%s\\n%s\\n%s\\n%s', ...\n            'Writing the JSON file seems to have failed.', ...\n            'Make sure that the following library is in the matlab/octave path:', ...\n            'https://github.com/bids-standard/bids-matlab');\nend\n\n%%\n\nclear;\n\nthis_dir = fileparts(mfilename('fullpath'));\nroot_dir = fullfile(this_dir, '..', filesep, '..');\n\nproject = 'templates';\n\nsub_label = '01';\nses_label = '01';\ntask_label = 'LongExample';\nrun_label = '01';\n\nname_spec.modality = 'ieeg';\nname_spec.suffix = 'ieeg';\nname_spec.ext = '.json';\nname_spec.entities = struct('sub', sub_label, ...\n                            'ses', ses_label, ...\n                            'task', task_label, ...\n                            'run', run_label);\n\n% using the 'use_schema', true\n% ensures that the entities will be in the correct order\nbids_file = bids.File(name_spec, 'use_schema', true);\n\n% Contrust the fullpath version of the filename\njson_name = fullfile(root_dir, project, bids_file.bids_path, bids_file.filename);\n\n%% General fields, shared with MRI BIDS and MEG BIDS\n\n% to get the definition of each column,\n% you can use the bids.Schema class from bids matlab\n% For example\nschema = bids.Schema;\ndef = schema.get_definition('TaskName');\nfprintf(def.description);\n\n%% Required fields:\njson.TaskName = task_label;\njson.SamplingFrequency = [];\njson.PowerLineFrequency = [];\njson.SoftwareFilters = '';\n\n%% Recommended fields:\nHardwareFilters.HighpassFilter.CutoffFrequency = [];\nHardwareFilters.LowpassFilter.CutoffFrequency = [];\njson.HardwareFilters = HardwareFilters; %\n\njson.Manufacturer = '';\njson.ManufacturersModelName = '';\njson.TaskDescription = '';\njson.Instructions = '';\njson.CogAtlasID = 'https://www.cognitiveatlas.org/FIXME';\njson.CogPOID = 'http://www.cogpo.org/ontologies/CogPOver1.owl#FIXME';\njson.InstitutionName = '';\njson.InstitutionAddress = '';\njson.DeviceSerialNumber = '';\njson.ECOGChannelCount = [];\njson.SEEGChannelCount = [];\njson.EEGChannelCount = [];\njson.EOGChannelCount = [];\njson.ECGChannelCount = [];\njson.EMGChannelCount = [];\njson.MiscChannelCount = [];\njson.TriggerChannelCount = [];\njson.RecordingDuration = [];\njson.RecordingType = '';\njson.EpochLength = [];\njson.SubjectArtefactDescription = '';\njson.SoftwareVersions = '';\n\n%% Specific iEEG fields:\n\n% If mixed types of references, manufacturers or electrodes are used, please\n% specify in the corresponding table in the _electrodes.tsv file\n\n%% Required fields:\njson.iEEGReference = '';\n\n%% Recommended fields:\njson.ElectrodeManufacturer = '';\njson.ElectrodeManufacturersModelName = '';\njson.iEEGGround = '';\njson.iEEGPlacementScheme = '';\njson.iEEGElectrodeGroups = '';\n\n%% Optional fields:\njson.ElectricalStimulation = '';\njson.ElectricalStimulationParameters = '';\n\n%% Write JSON\n% Make sure the directory exists\nbids.util.mkdir(fileparts(json_name));\nbids.util.jsonencode(json_name, json);\n"
  },
  {
    "path": "matlabCode/micr/createBIDS_micr_json_full.m",
    "content": "%% Template Matlab script to create an BIDS compatible _bold.json file\n% This example lists all required and optional fields.\n% When adding additional metadata please use CamelCase\n% Use version of DICOM ontology terms whenever possible.\n%\n% DHermes, 2017\n\n% Writing json files relies on the JSONio library\n% https://github.com/bids-standard/bids-matlab\n%\n% Make sure it is in the matab/octave path\ntry\n    bids.bids_matlab_version;\ncatch\n    warning('%s\\n%s\\n%s\\n%s', ...\n            'Writing the JSON file seems to have failed.', ...\n            'Make sure that the following library is in the matlab/octave path:', ...\n            'https://github.com/bids-standard/bids-matlab');\nend\n\n%%\n\nclear;\n\nthis_dir = fileparts(mfilename('fullpath'));\nroot_dir = fullfile(this_dir, '..', filesep, '..');\n\nproject = 'templates';\n\nsub_label = '01';\nses_label = '01';\nsample_label = '01';\nchunk_label = '01';\nstain_label = '03';\nacq_label = 'Short';\n\nname_spec.modality = 'micr';\nname_spec.suffix = 'SEM';\nname_spec.ext = '.json';\nname_spec.entities = struct('sub', sub_label, ...\n                            'sample', sample_label, ...\n                            'stain', stain_label, ...\n                            'acq', acq_label, ...\n                            'ses', ses_label, ...\n                            'chunk', chunk_label);\n\n% using the 'use_schema'; true\n% ensures that the entities will be in the correct order\nbids_file = bids.File(name_spec, 'use_schema', true);\n\n% Contrust the fullpath version of the filename\njson_name = fullfile(root_dir, project, bids_file.bids_path, bids_file.filename);\n\n%% Adding metadata\n% to get the definition of each metadata,\n% you can use the bids.Schema class from bids matlab\n\n% For example\nschema = bids.Schema;\ndef = schema.get_definition('Manufacturer');\nfprintf(def.description);\n\n% Image Acquisition\njson.PixelSize = 'REQUIRED';\njson.PixelSizeUnits = 'REQUIRED';\n\n%% Write JSON\n% Make sure the directory exists\nbids.util.mkdir(fileparts(json_name));\nbids.util.jsonencode(json_name, json);\n"
  },
  {
    "path": "matlabCode/micr/createBIDS_micr_json_short.m",
    "content": "%% Template Matlab script to create an BIDS compatible _bold.json file\n% This example lists all required and optional fields.\n% When adding additional metadata please use CamelCase\n% Use version of DICOM ontology terms whenever possible.\n%\n% DHermes, 2017\n\n% Writing json files relies on the JSONio library\n% https://github.com/bids-standard/bids-matlab\n%\n% Make sure it is in the matab/octave path\ntry\n    bids.bids_matlab_version;\ncatch\n    warning('%s\\n%s\\n%s\\n%s', ...\n            'Writing the JSON file seems to have failed.', ...\n            'Make sure that the following library is in the matlab/octave path:', ...\n            'https://github.com/bids-standard/bids-matlab');\nend\n\n%%\n\nclear;\n\nthis_dir = fileparts(mfilename('fullpath'));\nroot_dir = fullfile(this_dir, '..', filesep, '..');\n\nproject = 'templates';\n\nsub_label = '01';\nses_label = '01';\nsample_label = '01';\nchunk_label = '01';\nstain_label = '03';\nacq_label = 'Full';\n\nname_spec.modality = 'micr';\nname_spec.suffix = 'SEM';\nname_spec.ext = '.json';\nname_spec.entities = struct('sub', sub_label, ...\n                            'sample', sample_label, ...\n                            'stain', stain_label, ...\n                            'acq', acq_label, ...\n                            'ses', ses_label, ...\n                            'chunk', chunk_label);\n\n% using the 'use_schema'; true\n% ensures that the entities will be in the correct order\nbids_file = bids.File(name_spec, 'use_schema', true);\n\n% Contrust the fullpath version of the filename\njson_name = fullfile(root_dir, project, bids_file.bids_path, bids_file.filename);\n\n%% Adding metadata\n% to get the definition of each metadata,\n% you can use the bids.Schema class from bids matlab\n\n% For example\nschema = bids.Schema;\ndef = schema.get_definition('Manufacturer');\nfprintf(def.description);\n\n% Device Hardware\njson.Manufacturer = 'RECOMMENDED';\njson.ManufacturersModelName = 'RECOMMENDED';\njson.DeviceSerialNumber = 'RECOMMENDED';\njson.StationName = 'RECOMMENDED';\njson.SoftwareVersions = 'RECOMMENDED';\njson.InstitutionName = 'RECOMMENDED';\njson.InstitutionAddress = 'RECOMMENDED';\njson.InstitutionalDepartmentName = 'RECOMMENDED';\n\n% Image Acquisition\njson.PixelSize = 'REQUIRED';\njson.PixelSizeUnits = 'REQUIRED';\njson.Immersion = 'OPTIONAL';\njson.NumericalAperture = 'OPTIONAL';\njson.Magnification = 'OPTIONAL';\njson.ImageAcquisitionProtocol = 'OPTIONAL';\njson.OtherAcquisitionParameters = 'OPTIONAL';\n\n% Sample\njson.BodyPart = 'RECOMMENDED';\njson.BodyPartDetails = 'RECOMMENDED';\njson.SampleEnvironment = 'RECOMMENDED';\njson.SampleStaining = 'RECOMMENDED';\njson.SamplePrimaryAntibody = 'RECOMMENDED';\njson.SampleSecondaryAntibody = 'RECOMMENDED';\njson.BodyPartDetailsOntology = 'OPTIONAL';\njson.SampleEmbedding = 'OPTIONAL';\njson.SampleFixation = 'OPTIONAL';\njson.SliceThickness = 'OPTIONAL';\njson.TissueDeformationScaling = 'OPTIONAL';\njson.SampleExtractionProtocol = 'OPTIONAL';\njson.SampleExtractionInstitution = 'OPTIONAL';\n\n% Chunk\njson.ChunkTransformationMatrix = 'RECOMMENDED if <chunk-index> is used in filenames';\njson.ChunkTransformationMatrixAxis = 'REQUIRED if ChunkTransformationMatrix is present';\n\n%% Write JSON\n% Make sure the directory exists\nbids.util.mkdir(fileparts(json_name));\nbids.util.jsonencode(json_name, json);\n"
  },
  {
    "path": "matlabCode/miss_hit.cfg",
    "content": "# styly guide (https://florianschanda.github.io/miss_hit/style_checker.html)\nline_length: 120\n\nregex_function_name: \"[a-zA-Z0-9]+(_[a-zA-Z0-9]+)*\"\nregex_parameter_name: \"[a-z]+(_[a-z]+)*\"\nregex_script_name: \"[a-zA-Z0-9]+(_[a-zA-Z0-9]+)*\"\n\ntab_width: 4\n\nsuppress_rule: \"copyright_notice\"\n\n# metrics limit for the code quality (https://florianschanda.github.io/miss_hit/metrics.html)\nmetric \"cnest\": limit 7\nmetric \"file_length\": limit 400\nmetric \"cyc\": limit 70\nmetric \"parameters\": limit 6\n"
  },
  {
    "path": "matlabCode/pet/createBIDS_blood_auto_tsv_and_json_short.m",
    "content": "% Template Matlab script to create a BIDS compatible:\n%\n%   sub-01_ses-01_recording-AutosamplerShortExample_blood.tsv\n%   sub-01_ses-01_recording-AutosamplerShortExample_blood.json\n%\n% This example lists all REQUIRED, RECOMMENDED and OPTIONAL fields.\n\n% Writing json files relies on the JSONio library\n% https://github.com/bids-standard/bids-matlab\n%\n% Make sure it is in the matab/octave path\ntry\n    bids.bids_matlab_version;\ncatch\n    warning('%s\\n%s\\n%s\\n%s', ...\n            'Writing the JSON file seems to have failed.', ...\n            'Make sure that the following library is in the matlab/octave path:', ...\n            'https://github.com/bids-standard/bids-matlab');\nend\n\nclear;\n\nthis_dir = fileparts(mfilename('fullpath'));\nroot_dir = fullfile(this_dir, '..', filesep, '..');\n\nproject = 'templates';\n\nsub_label = '01';\nses_label = '01';\nrecording_label = 'AutosamplerShortExample';\n\nname_spec.modality = 'pet';\nname_spec.suffix = 'blood';\nname_spec.ext = '.tsv';\nname_spec.entities = struct('sub', sub_label, ...\n                            'ses', ses_label, ...\n                            'recording', recording_label);\n\n% using the 'use_schema', true\n% ensures that the entities will be in the correct order\nbids_file = bids.File(name_spec, 'use_schema', true);\n\n% Contrust the fullpath version of the filename\ntsv_file_name = fullfile(root_dir, project, bids_file.bids_path, bids_file.filename);\njson_file_name = fullfile(root_dir, project, bids_file.bids_path, bids_file.json_filename);\n\n%% Write TSV\ntsv.time = 0;\ntsv.whole_blood_radioactivity = 0;\n\nbids.util.tsvwrite(tsv_file_name, tsv);\n\n%% Write JSON\n% this makes the json look prettier when opened in a txt editor\njson.PlasmaAvail = false;\njson.WholeBloodAvail = true;\njson.MetaboliteMethod = false;\njson.DispersionCorrected = false;\n\n% get the definition of each column,\n% use the bids.Schema class from bids matlab\nschema = bids.Schema;\n\ndef = schema.get_definition('time');\njson.time.Description = def.description;\njson.time.Unit = def.unit;\n\ndef = schema.get_definition('whole_blood_radioactivity');\njson.whole_blood_radioactivity.Description = def.description;\njson.whole_blood_radioactivity.Unit = def.unit;\n\n%% Write JSON\n% Make sure the directory exists\nbids.util.mkdir(fileparts(json_file_name));\nbids.util.jsonencode(json_file_name, json);\n"
  },
  {
    "path": "matlabCode/pet/createBIDS_blood_manual_tsv_and_json_full.m",
    "content": "% Template Matlab script to create a BIDS compatible:\n%\n%   sub-01_ses-01_recording-ManualFullExample_blood.tsv\n%   sub-01_ses-01_recording-ManualFullExample_blood.json\n%\n% This example lists all REQUIRED, RECOMMENDED and OPTIONAL fields.\n\n% Writing json files relies on the JSONio library\n% https://github.com/bids-standard/bids-matlab\n%\n% Make sure it is in the matab/octave path\ntry\n    bids.bids_matlab_version;\ncatch\n    warning('%s\\n%s\\n%s\\n%s', ...\n            'Writing the JSON file seems to have failed.', ...\n            'Make sure that the following library is in the matlab/octave path:', ...\n            'https://github.com/bids-standard/bids-matlab');\nend\n\nclear;\n\nthis_dir = fileparts(mfilename('fullpath'));\nroot_dir = fullfile(this_dir, '..', filesep, '..');\n\nproject = 'templates';\n\nsub_label = '01';\nses_label = '01';\nrecording_label = 'ManualFullExample';\n\nname_spec.modality = 'pet';\nname_spec.suffix = 'blood';\nname_spec.ext = '.tsv';\nname_spec.entities = struct('sub', sub_label, ...\n                            'ses', ses_label, ...\n                            'recording', recording_label);\n\n% using the 'use_schema', true\n% ensures that the entities will be in the correct order\nbids_file = bids.File(name_spec, 'use_schema', true);\n\n% Contrust the fullpath version of the filename\ntsv_file_name = fullfile(root_dir, project, bids_file.bids_path, bids_file.filename);\njson_file_name = fullfile(root_dir, project, bids_file.bids_path, bids_file.json_filename);\n\n%% Write TSV\ntsv.time = 0;\ntsv.plasma_radioactivity = 0;\ntsv.metabolite_parent_fraction = 0;\ntsv.metabolite_polar_fraction = 0;\ntsv.hplc_recovery_fractions = 0;\ntsv.whole_blood_radioactivity = 0;\n\nbids.util.tsvwrite(tsv_file_name, tsv);\n\n%% Write JSON\njson.PlasmaAvail = '';\njson.MetaboliteAvail = '';\njson.WholeBloodAvail = '';\njson.DispersionCorrected = '';\njson.WithdrawalRate = '';\njson.TubingType = '';\njson.TubingLength = '';\njson.DispersionConstant = '';\njson.Haematocrit = '';\njson.BloodDensity = '';\njson.PlasmaFreeFraction = '';\njson.PlasmaFreeFractionMethod = '';\njson.MetaboliteMethod = '';\njson.MetaboliteRecoveryCorrectionApplied = '';\n\n% get the definition of several columns,\n% use the bids.Schema class from bids matlab\nschema = bids.Schema;\n\ncolumns = {'time'\n           'plasma_radioactivity'\n           'metabolite_parent_fraction'\n           'metabolite_polar_fraction'\n           'hplc_recovery_fractions'\n           'whole_blood_radioactivity'};\n\nfor i = 1:numel(columns)\n    def = schema.get_definition(columns{i});\n    json.(columns{i}).Description = def.description;\n    if isfield(def, 'unit')\n        json.(columns{i}).Unit = def.unit;\n    end\nend\n\njson.plasma_radioactivity.unit = 'kBq/ml';\njson.whole_blood_radioactivity.unit = 'kBq/ml';\njson.metabolite_parent_fraction.unit = 'unitless';\njson.metabolite_polar_fraction.unit = 'unitless';\n\n%% Write JSON\n% Make sure the directory exists\nbids.util.mkdir(fileparts(json_file_name));\nbids.util.jsonencode(json_file_name, json);\n"
  },
  {
    "path": "matlabCode/pet/createBIDS_blood_manual_tsv_and_json_short.m",
    "content": "% Template Matlab script to create a BIDS compatible:\n%\n%   sub-01_ses-01_recording-ManualFullExample_blood.tsv\n%   sub-01_ses-01_recording-ManualFullExample_blood.json\n%\n% This example lists all REQUIRED, RECOMMENDED and OPTIONAL fields.\n\n% Writing json files relies on the JSONio library\n% https://github.com/bids-standard/bids-matlab\n%\n% Make sure it is in the matab/octave path\ntry\n    bids.bids_matlab_version;\ncatch\n    warning('%s\\n%s\\n%s\\n%s', ...\n            'Writing the JSON file seems to have failed.', ...\n            'Make sure that the following library is in the matlab/octave path:', ...\n            'https://github.com/bids-standard/bids-matlab');\nend\n\nclear;\n\nthis_dir = fileparts(mfilename('fullpath'));\nroot_dir = fullfile(this_dir, '..', filesep, '..');\n\nproject = 'templates';\n\nsub_label = '01';\nses_label = '01';\nrecording_label = 'ManualShortExample';\n\nname_spec.modality = 'pet';\nname_spec.suffix = 'blood';\nname_spec.ext = '.tsv';\nname_spec.entities = struct('sub', sub_label, ...\n                            'ses', ses_label, ...\n                            'recording', recording_label);\n\n% using the 'use_schema', true\n% ensures that the entities will be in the correct order\nbids_file = bids.File(name_spec, 'use_schema', true);\n\n% Contrust the fullpath version of the filename\ntsv_file_name = fullfile(root_dir, project, bids_file.bids_path, bids_file.filename);\njson_file_name = fullfile(root_dir, project, bids_file.bids_path, bids_file.json_filename);\n\n%% Write TSV\ntsv.time = 0;\ntsv.metabolite_parent_fraction = 0;\n\nbids.util.tsvwrite(tsv_file_name, tsv);\n\n%% Write JSON\n\n% get the definition of each column,\n% use the bids.Schema class from bids matlab\n% example:\n%\n% schema = bids.Schema;\n% def = schema.get_definition('metabolite_parent_fraction');\n\njson.PlasmaAvail = '';\njson.MetaboliteAvail = '';\njson.WholeBloodAvail = '';\njson.DispersionCorrected = '';\njson.MetaboliteMethod = '';\njson.MetaboliteRecoveryCorrectionApplied = '';\njson.time = struct('Description', ...\n                   'Time in relation to time zero defined by the _pet.json', ...\n                   'Units', 's');\njson.metabolite_parent_fraction = struct('Description', ...\n                                         'Parent fraction of the radiotracer.', ...\n                                         'Units', 'unitless');\n\n%% Write JSON\n% Make sure the directory exists\nbids.util.mkdir(fileparts(json_file_name));\nbids.util.jsonencode(json_file_name, json);\n"
  },
  {
    "path": "matlabCode/pet/createBIDS_pet_json_full.m",
    "content": "% Template Matlab script to create a BIDS compatible:\n%\n%   sub-01_ses-01_task-FullExample_pet.json\n%\n% This example lists all REQUIRED, RECOMMENDED and OPTIONAL fields.\n\n% Writing json files relies on the JSONio library\n% https://github.com/bids-standard/bids-matlab\n%\n% Make sure it is in the matab/octave path\ntry\n    bids.bids_matlab_version;\ncatch\n    warning('%s\\n%s\\n%s\\n%s', ...\n            'Writing the JSON file seems to have failed.', ...\n            'Make sure that the following library is in the matlab/octave path:', ...\n            'https://github.com/bids-standard/bids-matlab');\nend\n\nclear;\n\nthis_dir = fileparts(mfilename('fullpath'));\nroot_dir = fullfile(this_dir, '..', filesep, '..');\n\nproject = 'templates';\n\nsub_label = '01';\nses_label = '01';\ntask_label = 'FullExample';\n\nname_spec.modality = 'pet';\nname_spec.suffix = 'pet';\nname_spec.ext = '.json';\nname_spec.entities = struct('sub', sub_label, ...\n                            'ses', ses_label, ...\n                            'task', task_label);\n\n% using the 'use_schema', true\n% ensures that the entities will be in the correct order\nbids_file = bids.File(name_spec, 'use_schema', true);\n\n% Contrust the fullpath version of the filename\njson_name = fullfile(root_dir, project, bids_file.bids_path, bids_file.filename);\n\n% get the definition of each column,\n% use the bids.Schema class from bids matlab\n% example:\n%\n% schema = bids.Schema;\n% def = schema.get_definition('TaskName');\n\njson.TaskName = task_label;\njson.Manufacturer = '';\njson.ManufacturersModelName = '';\njson.Units = '';\njson.InstitutionName = '';\njson.InstitutionAddress = '';\njson.InstitutionalDepartmentName = '';\njson.BodyPart = '';\njson.TracerName = '';\njson.TracerRadionuclide = '';\njson.InjectedRadioactivity = '';\njson.InjectedRadioactivityUnits = '';\njson.InjectedMass = '';\njson.InjectedMassUnits = '';\njson.SpecificRadioactivity = '';\njson.SpecificRadioactivityUnits = '';\njson.ModeOfAdministration = '';\njson.TracerRadLex = '';\njson.TracerSNOMED = '';\njson.TracerMolecularWeight = '';\njson.TracerMolecularUnits = '';\njson.InjectedMassPerWeight = '';\njson.InjectedMassPerWeightUnits = '';\njson.SpecificRadioactivityMeasTime = '';\njson.MolarActivity = '';\njson.MolarActivityUnits = '';\njson.MolarActivityMeasTime = '';\njson.InfusionRadioActivity = '';\njson.InfusionStart = '';\njson.InfusionSpeed = '';\njson.InfusionSpeedUnits = '';\njson.InjectedVolume = '';\njson.Purity = '';\njson.PharamceuticalName = '';\njson.PharmaceuticalDoseAmount = [];\njson.PharmaceuticalDoseUnits = '';\njson.PharmaceuticalDoseRegimen = '';\njson.PharmaceuticalDoseTime = [];\njson.Anaesthesia = '';\njson.TimeZero = '';\njson.ScanStart = '';\njson.InjectionStart = '';\njson.FrameTimesStart = [];\njson.FrameDuration = [];\njson.ScanDate = '';\njson.InjectionEnd = '';\njson.AcquisitionMode = '';\njson.ImageDecayCorrected = '';\njson.ImageDecayCorrectionTime = '';\njson.ReconMethodName = '';\njson.ReconMethodParameterLabels = [];\njson.ReconMethodParameterUnits = [];\njson.ReconMethodParameterValues = [];\njson.ReconFilterType = [];\njson.ReconFilterSize = [];\njson.AttenuationCorrection = '';\njson.ReconMethodImplementationVersion = '';\njson.AttenuationCorrectionMethodReference = '';\njson.ScaleFactor = [];\njson.ScatterFraction = [];\njson.DecayCorrectionFactor = [];\njson.PromptRate = [];\njson.RandomRate = [];\njson.SinglesRate = [];\n\n%% Write JSON\n% Make sure the directory exists\nbids.util.mkdir(fileparts(json_name));\nbids.util.jsonencode(json_name, json);\n"
  },
  {
    "path": "matlabCode/pet/createBIDS_pet_json_short.m",
    "content": "% Template Matlab script to create a BIDS compatible:\n%\n%   sub-01_ses-01_task-ShortExample_pet.json\n%\n% This example lists all REQUIRED fields.\n\n% Writing json files relies on the JSONio library\n% https://github.com/bids-standard/bids-matlab\n%\n% Make sure it is in the matab/octave path\ntry\n    bids.bids_matlab_version;\ncatch\n    warning('%s\\n%s\\n%s\\n%s', ...\n            'Writing the JSON file seems to have failed.', ...\n            'Make sure that the following library is in the matlab/octave path:', ...\n            'https://github.com/bids-standard/bids-matlab');\nend\n\nclear;\n\nthis_dir = fileparts(mfilename('fullpath'));\nroot_dir = fullfile(this_dir, '..', filesep, '..');\n\nproject = 'templates';\n\nsub_label = '01';\nses_label = '01';\ntask_label = 'ShortExample';\n\nname_spec.modality = 'pet';\nname_spec.suffix = 'pet';\nname_spec.ext = '.json';\nname_spec.entities = struct('sub', sub_label, ...\n                            'ses', ses_label, ...\n                            'task', task_label);\n\n% using the 'use_schema', true\n% ensures that the entities will be in the correct order\nbids_file = bids.File(name_spec, 'use_schema', true);\n\n% Contrust the fullpath version of the filename\njson_name = fullfile(root_dir, project, bids_file.bids_path, bids_file.filename);\n\n% get the definition of each column,\n% use the bids.Schema class from bids matlab\n% example:\n%\n% schema = bids.Schema;\n% def = schema.get_definition('TaskName');\n\njson.TaskName = task_label;\njson.Manufacturer =  '';\njson.ManufacturersModelName =  '';\njson.Units =  '';\njson.TracerName =  '';\njson.TracerRadionuclide =  '';\njson.InjectedRadioactivity =  '';\njson.InjectedRadioactivityUnits =  '';\njson.InjectedMass =  '';\njson.InjectedMassUnits =  '';\njson.SpecificRadioactivity =  '';\njson.SpecificRadioactivityUnits =  '';\njson.ModeOfAdministration =  '';\njson.TimeZero =  '';\njson.ScanStart =  '';\njson.InjectionStart =  '';\njson.FrameTimesStart =  [];\njson.FrameDuration =  [];\njson.AcquisitionMode =  '';\njson.ImageDecayCorrected =  '';\njson.ImageDecayCorrectionTime =  '';\njson.ReconMethodName =  '';\njson.ReconMethodParameterLabels =  [];\njson.ReconMethodParameterUnits =  [];\njson.ReconMethodParameterValues =  [];\njson.ReconFilterType =  [];\njson.ReconFilterSize =  [];\njson.AttenuationCorrection =  '';\n\n%% Write JSON\n% Make sure the directory exists\nbids.util.mkdir(fileparts(json_name));\nbids.util.jsonencode(json_name, json);\n"
  },
  {
    "path": "pythonCode/createBIDS_MP2RAGE_json.py",
    "content": "\"\"\"\nWARNING:\nThis script was created in October 2018 when the specification\nfor MP2RAGE files was not fully finalized. Please double check with\nlatest version of the specs to make sure this is accurate.\n\nThis script will create the JSON files required for an MP2RAGE file.\nTo function it requires a BIDS data set with properly named image files:\nThe script will go through all the folders of a BIDS data set and will create\nthe JSON files in every folder where it finds a file ending\nwith '_inv-1_part-mag_MPRAGE.nii.gz'.\n\nCreated by RG 2018-10-03\n\"\"\"\n\nimport glob\nimport json\nimport os\nfrom collections import OrderedDict\n\nstart_dir = \"\"  # insert here path to your BIDS data set\n\n# DEFINE CONTENT OF JSON FILES\n\n# defining the content of the JSON file for the\n# first inversion image (sub-*_inv-1_MPRAGE.json)\ndata_inv_1 = OrderedDict([(\"InversionTime\", \"900\"), (\"FlipAngle\", \"5\")])  # ms\n\n# defining the content of the JSON file for the\n# second inversion image (sub-*_inv-2_MPRAGE.json)\ndata_inv_2 = OrderedDict([(\"InversionTime\", \"2750\"), (\"FlipAngle\", \"3\")])  # ms\n\n# defining the content of the JSON files for the\n# T1w (sub-*_T1w.json) and the T1map (sub-*_T1map.json)\ndata_T1 = OrderedDict(\n    [\n        (\"EstimationMethod\", \"Marques et al., 2013\"),\n    ]\n)\n\n# defining the content of the main JSON file (sub-*_MPRAGE.json)\ndata_MP2RAGE = OrderedDict(\n    [\n        (\"MagneticFieldStrength\", \"\"),\n        (\"ExcitationRepetitionTime\", \"\"),\n        (\"InversionRepetitionTime\", \"\"),\n        (\"NumberShots\", \"\"),\n        (\"Manufacturer\", \"\"),\n        (\"ManufacturersModelName\", \"\"),\n        (\"DeviceSerialNumber\", \"\"),\n        (\"SoftwareVersions\", \"\"),\n        (\"StationName\", \"\"),\n        (\"InstitutionName\", \"\"),\n        (\"InstitutionAddress\", \"\"),\n        (\"InstitutionalDepartmentName\", \"\"),\n        (\"ReceiveCoilName\", \"\"),\n        (\"ReceiveCoilActiveElements\", \"\"),\n        (\"GradientSetType\", \"\"),\n        (\"MRTransmitCoilSequence\", \"\"),\n        (\"MatrixCoilMode\", \"\"),\n        (\"CoilCombinationMethod\", \"\"),\n        (\"NonlinearGradientCorrection\", \"\"),\n        (\"WaterFatShift\", \"\"),\n        (\"EchoTrainLength\", \"\"),\n        (\"DwellTime\", \"\"),\n        (\"MultibandAccelerationFactor\", \"\"),\n        (\"AnatomicalLandmarkCoordinates\", \"\"),\n        (\"MRAcquisitionType\", \"\"),\n        (\"ScanningSequence\", \"\"),\n        (\"SequenceVariant\", \"\"),\n        (\"ScanOptions\", \"\"),\n        (\"SequenceName\", \"\"),\n        (\"PulseSequenceType\", \"MP2RAGE\"),\n        (\"PulseSequenceDetails\", \"\"),\n        (\"ParallelReductionFactorInPlane\", \"\"),\n        (\"ParallelAcquisitionTechnique\", \"\"),\n        (\"PartialFourier\", \"\"),\n        (\"PartialFourierDirection\", \"\"),\n        (\"EffectiveEchoSpacing\", \"\"),\n        (\"TotalReadoutTime\", \"\"),\n        (\"PhaseEncodingDirection\", \"\"),\n        (\"EchoTime1\", \"\"),  # sec\n        (\"EchoTime2\", \"\"),  # sec\n        (\"SliceThickness\", \"\"),  # mm\n    ]\n)\n\n# WRITE THEM\nindent = 4\n\n# list all subjects and  create iterator with full path for subjects folder\nfile_ls = glob.glob(\n    os.path.join(start_dir, \"sub*\", \"**\", \"*_inv-1_part-mag_MPRAGE.nii.gz\"),\n    recursive=True,\n)\n\nfor f in file_ls:\n    # creates the json files in the folder where the magnitude image\n    # of the first inversion is found\n    path, fname = os.path.split(f)\n\n    #  define filename, excluding last three key-value pairs\n    sid = \"_\".join(fname.split(\"_\")[:-3])\n\n    # adding content to JSON files for the T1w and T1map\n    # as its content is subject dependent\n    inv1_mag = os.path.join(\"anat\", f\"{sid}_inv1_part-mag_MPRAGE.nii.gz\")\n    inv1_phs = os.path.join(\"anat\", f\"{sid}_inv1_part-phase_MPRAGE.nii.gz\")\n    inv2_mag = os.path.join(\"anat\", f\"{sid}_inv2_part-mag_MPRAGE.nii.gz\")\n    inv2_phs = os.path.join(\"anat\", f\"{sid}_inv2_part-phase_MPRAGE.nii.gz\")\n\n    data_T1[\"BasedOn\"] = f\"{inv1_mag}, {inv1_phs}, {inv2_mag}, {inv2_phs}, \"\n\n    # define json files for all image types\n    json_names = [\n        \"{}_inv-1_MPRAGE.json\",\n        \"{}_inv-2_MPRAGE.json\",\n        \"{}_MPRAGE.json\",\n        \"{}_T1map.json\",\n        \"{}_T1w.json\",\n    ]\n    data_types = [data_inv_1, data_inv_2, data_MP2RAGE, data_T1, data_T1]\n    out_files = zip(json_names, data_types)\n\n    for out_file in out_files:\n        json_name, data_type = out_file[0], out_file[1]\n        with open(os.path.join(path, json_name.format(sid)), \"w\") as ff:\n            json.dump(data_type, ff, sort_keys=False, indent=indent)\n"
  },
  {
    "path": "pythonCode/createBIDS_dataset_description_json.py",
    "content": "import json\nfrom collections import OrderedDict\n\ndata = OrderedDict()\n# General fields, shared with MRI BIDS and MEG BIDS:\n# Required fields:\n# name of the dataset\ndata[\"Name\"] = \"\"\n\n# The version of the BIDS standard that was used\ndata[\"BIDSVersion\"] = \"1.0.2\"\n\n# Recommended fields:\n# what license is this dataset distributed under?\n# The use of license name abbreviations is suggested for specifying a license.\n# A list of common licenses with suggested abbreviations can be found in appendix III.\ndata[\"License\"] = \"\"\n\n\n# List of individuals who contributed to the creation/curation of the dataset\ndata[\"Authors\"] = [\"\", \"\", \"\"]\n\n# who should be acknowledged in helping to collect the data\ndata[\"Acknowledgements\"] = \"\"\n\n# Instructions how researchers using this dataset should acknowledge the original authors.\n# This field can also be used to define a publication that should be cited in publications that use the dataset\ndata[\"HowToAcknowledge\"] = \"\"\n\n# sources of funding (grant numbers)\ndata[\"Funding\"] = [\"\", \"\", \"\"]\n\n# a list of references to publication that contain information on the dataset, or links.\ndata[\"ReferencesAndLinks\"] = [\"\", \"\", \"\"]\n\n# the Document Object Identifier of the dataset (not the corresponding paper).\ndata[\"DatasetDOI\"] = \"\"\n\nroot_dir = \"\"\nproject_label = \"templates\"\n\ndataset_json_folder = root_dir + project_label\ndataset_json_name = f\"{dataset_json_folder}/dataset_description.json\"\n\nwith open(dataset_json_name, \"w\") as ff:\n    json.dump(data, ff, sort_keys=False, indent=4)\n"
  },
  {
    "path": "reports/Google-2018-report.md",
    "content": "This is Patrick Park's Google Summer of Code final report for his work on the\n[BIDS Starter Kit](https://github.com/bids-standard/bids-starter-kit).\n\nIf you have reached this page from a different source, and want an overview of\nthe project, please check out our README file at\n<https://github.com/bids-standard/bids-starter-kit>.\n\nThe work completed by Patrick Park during the Google Summer of Code is archived\non zenodo as v1.0.2 under DOI 1344669 at\n<https://doi.org/10.5281/zenodo.1344669>\n\n## The Big Picture\n\nAn open source project is one where code and some data is shared publicly.\nRather than the traditional approach of hiding processes and making them\nexclusive, open science principles prioritize transparency, diversity, and\nreproducibility to foster collaboration.\n\n<img align=\"right\" width=\"35%\" src=\"https://i.imgur.com/zxmd6W5.jpg\" alt=\"sharing-pot\"/>\n\nImagine you are a carrot farmer trying to make dinner. You could make carrot\nsoup by yourself, but you could also share ingredients with the neighbours to\nmake a much tastier soup with onions, greens, and some salt. Some people may be\nable to contribute more than others -- but everyone benefits.\n\nIn neuroscience, data such as magnetic resonance images and physiology readings\ncan be costly in both time and money to acquire. This creates a barrier for many\nunderfunded researchers without access to the required equipment. Responsible\ndata sharing can level the playing field, but incompatible specifications cause\nportability issues between different labs and scientists. The brain imaging data\nstandard (BIDS) is a framework for organizing data that standardizes datasets\nacross different researchers to enable easier sharing.\n\n## My role\n\nThe primary goal of this project was to simplify the process of learning about\nBIDS and engage more users. Well before it was funded by Google, the roots of\nthis initiative were being pioneered by a small group of people around the world\nthat were acting as local BIDS ambassadors in their communities. Many of us were\nalready giving presentations at every workshop and conference possible. However,\nthese were only for a limited audience, and there was a need for central\norganization of these resources. We hoped to create a central repository\naccessible to everyone that would contain easy to read documentation and a\ncollection of useful resources.\n\nIt was my responsibility over the Google Summer of Code to be the lead developer\nand maintainer of the repository. When responding to requests from both senior\ndevelopers and new contributors alike, this meant breaking down requested\nfeatures into action items that could be assigned to either myself or the\nrelevant expert. Periodically, I would then go through the list of issues to\nmake sure progress on them did not “die out”. As a content creator, my work was\nprimarily focused on the README and wiki. This included writing content and\nenhancing user experience by designing a clear framework. Although much of this\nwork was documentation, I had to be able to understand the specification to a\nhigh technical standard - including the\n[BIDS Apps software](http://bids-apps.neuroimaging.io/apps/) that are built from\ndocker images - in order to communicate the information to new users.\n\n## Problem definitions and solutions\n\nThe title of this project was called Easy BIDS: Starter Kit, and that’s exactly\nthe question that we started with:\n\nHow do we make this data standard easier to adopt?\n\nFrom there, we broke it down into a series of more discrete problems.\n\n<br>\n\n:o: **Problem** Which parts of BIDS are people finding most difficult?\n\n:heavy_check_mark: **Solution** Through both formal surveys and informal chats,\nI got feedback from the newcomers to BIDS. The results showed that people were\nmost confused by the technical jargon and metadata file formats.\n\n<br>\n\n:o: **Problem** The technical documentation about BIDS can be overwhelming.\n\n:heavy_check_mark: **Solution** I developed an easy to read reference called the\n[BIDS Starter Kit Wiki](https://github.com/bids-standard/bids-starter-kit/wiki).\nWhat started as a two page document quickly grew into a compilation of\ninformation, tutorials, examples, a glossary, publications, community resources,\nand many more.\n\n<br>\n\n:o: **Problem** Engage more users\n\n:heavy_check_mark: **Solution** In person, our team continued to spread the word\nabout the project during any relevant events. Online, we created an\n[animated video](https://camo.githubusercontent.com/aada478abaddf957a3622589a5c370f11bf67642/687474703a2f2f696d672e796f75747562652e636f6d2f76692f425964686a5675427347302f302e6a7067)\nto summarize the general idea and make the first step that much easier. We\ndeveloped\n[extensive contribution guidelines](https://github.com/bids-standard/bids-starter-kit/blob/main/CONTRIBUTING.md)\nto help new contributors add their expertise to the project. We include how to\n[get in touch](https://github.com/bids-standard/bids-starter-kit/blob/main/CONTRIBUTING.md#get-in-touch),\n[write in markdown](https://github.com/bids-standard/bids-starter-kit/blob/main/CONTRIBUTING.md#writing-in-markdown),\n[submit a pull request](https://github.com/bids-standard/bids-starter-kit/blob/main/CONTRIBUTING.md#making-a-change-with-a-pull-request)\nand explanations of where to put\n[useful code or links in the wiki](https://github.com/bids-standard/bids-starter-kit/blob/main/CONTRIBUTING.md#where-to-start-wiki-code-and-templates).\nThe licence on our repository is CC-BY and these guidelines have already been\nincorporated into other open source neuroimaging projects such as\n[NiBetaSeries](https://nibetaseries.readthedocs.io/en/stable/). We also used the\n[“good-first-issue” principle](https://github.com/bids-standard/bids-starter-kit/blob/main/CONTRIBUTING.md#where-to-start-issue-labels)\nto periodically leave small mistakes in our repository unfixed, such as a typo\nor an undefined term in the glossary. Then, we would send out a request and\nguide a new contributor through the process of using the repository.\n\nAs a result, the number of unique visitors grew from less than 5 to peaks of\nover 50 per day.\n\n<br>\n\n:o: **Problem** International project management and communication\n\n:heavy_check_mark: **Solution** The members of this project were located in\nCanada ([Elizabeth DuPre](https://github.com/emdupre)), Britain\n([Kirstie Whitaker](https://github.com/KirstieJane)), the Netherlands\n([Dora Hermes](https://github.com/dorahermes)), the USA\n([Chris Gorgolewski](https://github.com/chrisgorgo) and\n[Chris Holdgraf](https://github.com/choldgraf/)), as well as a collaborator from\nIndia ([Madhur Tandon](https://github.com/madhur-tandon)). The strategy for this\nproblem was to work publicly and to demonstrate best practise in open source\nproject leadership. This meant rather than waiting until completion to share\nsomething, we would continuously post our work in progress and incorporate\nfeedback. Specifically, Github milestones and “closing soon” tags on issues were\nhelpful to highlight weekly tasks and mark them for review.\n\nDespite these strategies, I still felt that the turning point of the project was\nin June when some of our team finally met in person at the\n[Organization for Human Brain Mapping Hackathon](https://ohbm.github.io/hackathon2018/).\nI was a recipient of a travel award ($500) for this event and it really made a\nhuge difference in my effectiveness as maintainer and content creator for BIDS\nStarter Kit. Summarizing an unnecessary meeting into a message is efficient, but\nfamiliarity is really important too.\n\n## Personal notes\n\nAs my first foray into community development and international project handling,\nthe toughest part at first was definitely the uncertainty -- a document doesn’t\nhave errors and nobody leaves detailed feedback about why they _didn’t_ feel\nwelcomed. But I’m glad to have finally learned the natural continuation of what\nhappens as a tool reaches maturity. To every mentor, collaborator,\nadministrator, and user that has been a part of this project so far, thank you\nfor all the help and feel free to message because I’ll still be staying\ninvolved!\n\n<br>\n\nPatrick J. Park\n\nSenior undergraduate student in Electrical Engineering (BESc) at Western\nUniversity, Canada\n\nEmail: parkpatrickj@gmail.com\n\nGithub: [Park-Patrick](https://github.com/Park-Patrick)\n"
  },
  {
    "path": "src/CONTRIBUTING.md",
    "content": "# Contributing\n\n🐣 **We're so excited you're here and want to contribute.** 🐣\n\nThe point of this starter kit is to **welcome new users and contributors to the BIDS community**.\nWe hope that these guidelines are designed to make it as easy as possible to get involved.\nIf you have any questions that aren't discussed below,\nplease let us know through one of the many ways to [get in touch](https://bids.neuroimaging.io/contact/).\n\n### Writing in markdown\n\nGitHub has a helpful page on\n[getting started with writing and formatting on GitHub](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github).\n\nMost of the writing that you'll do will be in [Markdown][markdown].\nYou can think of Markdown as a few little symbols around your text\nthat will allow GitHub to render the text with a little bit of formatting.\nFor example you could write words as bold (`**bold**`),\nor in italics (`*italics*`),\nor as a [link][rick-roll] (`[link](https://https://youtu.be/dQw4w9WgXcQ)`)\nto another webpage.\n\n### Matlab / Octave\n\nWe are using the Miss_hit linter to help us keep out matlab \"clean\".\nYou can find more information on how to set it up and use it on the bids-matlab\n[contributing guidelines](https://github.com/bids-standard/bids-matlab/blob/master/CONTRIBUTING.md#matlab-code-style-guide-and-quality).\n\n### Templates\n\nThis repository is under development, but we aim to have two templates for each\nBIDS sidecar file:\n\n-   one with a `full` example (all required/recommended/optional fields),\n-   one with a `short` example (only required fields).\n\nIf possible try to provide a script (python, octave, matlab)\nto generate those templates.\n\nTry to name your script as follow: `createBIDS_<suffix>_<extension>_*.[py|m]`\n\n```\ncreateBIDS_T1w_json_short.m\n```\n\nTo contribute a template you'll need to submit a pull request.\n\n<br>\n\n[all-contributors]: https://github.com/kentcdodds/all-contributors#emoji-key\n[bids]: http://bids.neuroimaging.io\n[bids-specification]: https://bids-specification.readthedocs.io/en/latest/\n[bids-mailinglist]: https://groups.google.com/forum/#!forum/bids-discussion\n[bids-starterkit-issues]: https://github.com/bids-standard/bids-starter-kit/issues\n[bids-starterkit-labels]: https://github.com/bids-standard/bids-starter-kit/labels\n[bids-starterkit-repo]: https://github.com/bids-standard/bids-starter-kit\n[bids-starterkit-book]: https://bids-standard.github.io/bids-starter-kit/\n[brainhack-slack-starterkit]: https://brainhack.slack.com/messages/C8RG7F6PN\n[brainhack-slack-invite]: https://brainhack-slack-invite.herokuapp.com\n[dont-push-pull-request]: https://www.igvita.com/2011/12/19/dont-push-your-pull-requests\n[git]: https://git-scm.com\n[github]: https://github.com\n[github-branches]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-and-deleting-branches-within-your-repository\n[github-fork]: https://docs.github.com/en/get-started/quickstart/fork-a-repo\n[github-flow]: https://guides.github.com/introduction/flow\n[github-mergeconflicts]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/addressing-merge-conflicts/about-merge-conflicts\n[github-pullrequest]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request\n[github-review]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/about-pull-request-reviews\n[github-syncfork]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork\n[gitter]: https://gitter.im/INCF/bids-starter-kit\n[gsoc]: https://summerofcode.withgoogle.com\n[labels-link]: https://github.com/bids-standard/bids-starter-kit/labels\n[labels-bug]: https://github.com/bids-standard/bids-starter-kit/labels/bug\n[labels-closingsoon]: https://github.com/bids-standard/bids-starter-kit/labels/closing%20soon\n[labels-community]: https://github.com/bids-standard/bids-starter-kit/labels/community\n[labels-documentation]: https://github.com/bids-standard/bids-starter-kit/labels/documentation\n[labels-enhancement]: https://github.com/bids-standard/bids-starter-kit/labels/enhancement\n[labels-firstissue]: https://github.com/bids-standard/bids-starter-kit/labels/good%20first%20issue\n[labels-funding]: https://github.com/bids-standard/bids-starter-kit/labels/funding\n[labels-helpwanted]: https://github.com/bids-standard/bids-starter-kit/labels/help%20wanted\n[labels-logistics]: https://github.com/bids-standard/bids-starter-kit/labels/logistics\n[labels-question]: https://github.com/bids-standard/bids-starter-kit/labels/question\n[jerry-maguire]: https://media.giphy.com/media/uRb2p09vY8lEs/giphy.gif\n[markdown]: https://daringfireball.net/projects/markdown\n[neurostars-forum]: https://neurostars.org/tags/bids\n[patrick-github]: https://github.com/Park-Patrick\n[rick-roll]: https://www.youtube.com/watch?v=dQw4w9WgXcQ\n[stemm-role-models]: https://github.com/KirstieJane/STEMMRoleModels\n"
  },
  {
    "path": "src/_config.yml",
    "content": "---\n#######################################################################################\n# A default configuration that will be loaded for all jupyter books\n# Users are expected to override these values in their own `_config.yml` file.\n# This is also the \"master list\" of all allowed keys and values.\n\n#######################################################################################\n# Book settings\ntitle: BIDS starter kit                           # The title of the book. Will be placed in the left navbar.\nauthor: The BIDS community                         # The author of the book\ncopyright: ''                     # Copyright year to be placed in the footer\nlogo: https://github.com/bids-standard/bids-specification/blob/master/BIDS_logo/BIDS_logo_black_transparent_background_crop.png    # A path to the book logo\nexclude_patterns: ['**README.md', epilepsy_phenotype.rst, questions]                  # Patterns to skip when building the book. Can be glob-style (for example \"*skip.ipynb\")\n\n#######################################################################################\n# Execution settings\nexecute:\n  execute_notebooks: auto           # Whether to execute notebooks at build time. Must be one of (\"auto\", \"force\", \"cache\", \"off\")\n  cache: ''                       # A path to the jupyter cache that will be used to store execution artifacts. Defaults to `_build/.jupyter_cache/`\n  exclude_patterns: []            # A list of patterns to *skip* in execution (for example a notebook that takes a really long time)\n\n#######################################################################################\n# Parse and render settings\nparse:\n  myst_enable_extensions:  # default extensions to enable in the myst parser. See https://myst-parser.readthedocs.io/en/latest/using/syntax-optional.html\n    # - amsmath\n  - colon_fence\n    # - deflist\n  - dollarmath\n    # - html_admonition\n    # - html_image\n  - linkify\n    # - replacements\n    # - smartquotes\n  - substitution\n    # - tasklist\n  myst_url_schemes: [mailto, http, https] # URI schemes that will be recognised as external URLs in Markdown links\n  myst_dmath_double_inline: true  # Allow display math ($$) within an inline context\n\n#######################################################################################\n# HTML-specific settings\nhtml:\n  favicon: images/favicon.ico                       # A path to a favicon image\n  use_edit_page_button: false        # Whether to add an \"edit this page\" button to pages. If `true`, repository information in repository: must be filled in\n  use_repository_button: false       # Whether to add a link to your repository button\n  use_issues_button: false           # Whether to add an \"open an issue\" button\n  extra_navbar:                      # Will be displayed underneath the left navbar.\n  extra_footer: ''                # Will be displayed underneath the footer.\n  google_analytics_id: G-VZJHGNQV6D           # A GA id that can be used to track book views.\n  home_page_in_navbar: true         # Whether to include your home page in the left Navigation Bar\n  baseurl: ''                     # The base URL where your book will be hosted. Used for creating image previews and social links.for example: https://mypage.com/mybook/\n  comments:\n    hypothesis: false\n  announcement: |\n    <div style=\"display: flex: flex-direction: column; text-align: center\">\n      <h3>\n        The Starter-kit has moved to the <a href=\"bids.neuroimaging.io\" target=\"_blank\">new BIDS website</a>.\n      </h3>\n      <p style=\"text-align: center\">Go and check it out and let us know what you think.</p>\n    </div>\n#######################################################################################\n# Launch button settings\nlaunch_buttons:\n  notebook_interface: classic            # The interface interactive links will activate [\"classic\", \"jupyterlab\"]\n  binderhub_url: https://mybinder.org                 # The URL of the BinderHub (for example, https://mybinder.org)\n  thebe: false                       # Add a thebe button to pages (requires the repository to run on Binder)\n\nrepository:\n  url: https://github.com/bids-standard/bids-starter-kit                         # The URL to your book's repository\n  path_to_book: src                  # A path to your book's folder, relative to the repository root.\n  branch: main                      # Which branch of the repository should be used when creating links\n\n#######################################################################################\n# Advanced and power-user settings\nsphinx:\n\n  extra_extensions:\n  - sphinxcontrib.bibtex\n  - IPython.sphinxext.ipython_console_highlighting\n  - sphinx_reredirects\n\n  config:\n    bibtex_bibfiles:\n    - references.bib\n    \n    linkcheck_ignore:\n    - .*/10.1186/s13742-016-0121-x    # for some reason, it returns forbidden\n    - .*/10.1093/gigascience/giy082    # for some reason, it returns forbidden\n    - https?://brainhack.org/LA    # need to fix to \"LA2016\" in OSF\n    \n    suppress_warnings:\n    - myst.domains    # domain method not implemented for `cite`\n    \n    redirects:\n      contact: https://bids.neuroimaging.io/contact/\n      dataset_examples: https://bids.neuroimaging.io/datasets/\n      folders_and_files/folders: https://bids.neuroimaging.io/getting_started/folders_and_files/folders.html\n      folders_and_files/files: https://bids.neuroimaging.io/getting_started/folders_and_files/files.html\n      folders_and_files/metadata: https://bids.neuroimaging.io/getting_started/folders_and_files/metadata.html\n      folders_and_files/derivatives: https://bids.neuroimaging.io/getting_started/folders_and_files/derivatives.html\n      tutorials/annotations: https://bids.neuroimaging.io/getting_started/tutorials/annotation.html\n      tutorials/ieeg: https://bids.neuroimaging.io/getting_started/tutorials/conversion/ieeg.html \n      tutorials/asl: https://bids.neuroimaging.io/getting_started/tutorials/conversion/asl.html\n      tutorials/pet: https://bids.neuroimaging.io/getting_started/tutorials/conversion/pet.html\n      tutorials/mri: https://bids.neuroimaging.io/getting_started/tutorials/conversion/mri.html\n      tutorials/tutorials: https://bids.neuroimaging.io/getting_started/tutorials/index.html\n      datasets: https://bids.neuroimaging.io/datasets/\n      talks: https://bids.neuroimaging.io/getting_started/resources/talks.html\n      publications: https://bids.neuroimaging.io/getting_started/resources/publications.html\n      dependencies: https://bids.neuroimaging.io/getting_started/resources/dependencies.html\n      links: https://bids.neuroimaging.io/getting_started/resources/links.html\n      FAQ: https://bids.neuroimaging.io/faq/\n      validator: https://bids.neuroimaging.io/tools/validator.html\n      glossary: https://bids.neuroimaging.io/getting_started/resources/glossary.html"
  },
  {
    "path": "src/_toc.yml",
    "content": "---\nformat: jb-book\nroot: index.md\nparts:\n- caption: Folders and files\n  chapters:\n  - title: Folders\n    url: https://bids.neuroimaging.io/getting_started/folders_and_files/folders.html\n  - title: Filenames\n    url: https://bids.neuroimaging.io/getting_started/folders_and_files/files.html\n  - title: Metadata and file formats\n    url: https://bids.neuroimaging.io/getting_started/folders_and_files/metadata.html\n  - title: BIDS files templates\n    url: https://github.com/bids-standard/bids-starter-kit/tree/main/templates\n  - title: Derivatives\n    url: https://bids.neuroimaging.io/getting_started/folders_and_files/derivatives.html\n- caption: Tutorials\n  chapters:\n  - title: Annotating a BIDS dataset\n    url: https://bids.neuroimaging.io/getting_started/tutorials/annotation.html\n  - title: iEEG data conversion\n    url: https://bids.neuroimaging.io/getting_started/tutorials/conversion/ieeg.html \n  - title: ASL data conversion\n    url: https://bids.neuroimaging.io/getting_started/tutorials/conversion/asl.html\n  - title: PET data conversion\n    url: https://bids.neuroimaging.io/getting_started/tutorials/conversion/pet.html\n  - title: MRI data conversion\n    url: https://bids.neuroimaging.io/getting_started/tutorials/conversion/mri.html\n  - title: Tutorials\n    url: https://bids.neuroimaging.io/getting_started/tutorials/index.html\n- caption: Resources\n  chapters:\n  - title: Dataset examples\n    url: https://bids.neuroimaging.io/datasets/\n  - title: Talks\n    url: https://bids.neuroimaging.io/getting_started/resources/talks.html\n  - title: Publications\n    url: https://bids.neuroimaging.io/getting_started/resources/publications.html\n  - title: Dependencies\n    url: https://bids.neuroimaging.io/getting_started/resources/dependencies.html\n  - title: Links\n    url: https://bids.neuroimaging.io/getting_started/resources/links.html\n- caption: Others\n  chapters:\n  - title: FAQ\n    url: https://bids.neuroimaging.io/faq/\n  - title: Validator\n    url: https://bids.neuroimaging.io/tools/validator.html\n  - title: Glossary\n    url: https://bids.neuroimaging.io/getting_started/resources/glossary.html\n  - title: Contact\n    url: https://bids.neuroimaging.io/contact/\n  - file: CONTRIBUTING.md\n  - file: CODE_OF_CONDUCT.md\n"
  },
  {
    "path": "src/epilepsy_phenotype.rst",
    "content": ".. only:: html\n\n    ===================\n    Epilepsy phenotypes\n    ===================\n\n    .. raw:: html\n        :file: tree.html\n"
  },
  {
    "path": "src/index.md",
    "content": "---\njupyter:\n    jupytext:\n        text_representation:\n        format_name: myst\n    kernelspec:\n        display_name: Python 3\n        language: python\n        name: python3\n    repository:\n        url: https://github.com/bids-standard/BIDS-Starter-Kit\n---\n\n# Getting started with BIDS\n\n\n<div align=\"center\" style=\"padding:10px\">\n  <strong>How to get started with the Brain Imaging Data Structure</strong>\n</div>\n\n## Motivation\n\nThe primary goal of this project is to simplify the process of learning about\nthe Brain Imaging Data Structure (BIDS). We hope that the resources in this\nwiki, such as links to tutorials, easy-to-read documentation, and code will make\nBIDS easier to adopt. In order to remain up to date with the continuously\nchanging BIDS specifications, we have adopted a similarly open model to allow\n[contributions](https://github.com/bids-standard/bids-starter-kit/blob/main/CONTRIBUTING.md)\nfrom the community.\n\n## Project Summary\n\nNeuroimaging and neurophysiology data can be costly in both time and money to\nacquire. This creates a barrier for many underfunded researchers without access\nto the required equipment. Responsible data sharing can level the playing field,\nbut the many different specifications of these acquired images cause portability\nissues between different labs and scientists. BIDS is a framework for organizing\ndata that standardizes file organization and dataset description between\ndifferent researchers.\n\n### How do I find information?\n\nFor general information to help you get started with BIDS, we recommend browsing\nthis book. It includes pages such as an overall introduction to the BIDS folder\nstructure, links to tutorials, and a glossary to help you with some of the\ntechnical terms.\n\nFor metadata file templates or code to help you get started, please scroll up to\nfind the appropriate files that are available in your language of choice.\n\nFinally, for more advanced knowledge that may pertain to specific use cases for\nyour data, please refer to the full\n[BIDS Specification](https://bids-specification.readthedocs.io/en/stable/)\n\n## Users\n\nBIDS is for everyone! Programming is not required, it simply makes some\nprocesses more efficient. All users can take part in the benefits such as\norganized data, reproducible research, and data sharing.\n\n<br>\n\n[gsoc]: https://summerofcode.withgoogle.com\n[patrick-github]: https://github.com/Park-Patrick\n[contributing]:\n    https://github.com/bids-standard/bids-starter-kit/blob/main/CONTRIBUTING.md\n"
  },
  {
    "path": "src/references.bib",
    "content": ""
  },
  {
    "path": "src/tree.html",
    "content": "<div class=\"App\">\n\n    <style>\n        .node {\n            cursor: pointer;\n        }\n\n        .node circle {\n            fill: #fff;\n            stroke: steelblue;\n            stroke-width: 3px;\n        }\n\n        .node text {\n            font: 12px sans-serif;\n        }\n\n        .link {\n            fill: none;\n            stroke: #ccc;\n            stroke-width: 3px;\n        }\n\n        .button {\n            background-color: #ccc;\n            color: black;\n            border: none;\n            padding: 15px 32px;\n            border-radius: 8px;\n            text-align: center;\n            text-decoration: none;\n            display: inline-block;\n            font-size: 14px;\n            transition-duration: 0.4s;\n            cursor: pointer;\n        }\n\n        .button:hover {\n            background-color:steelblue;\n        }\n    </style>\n\n    <h1 align=\"center\">ILAE classification of the epilepsies</h1>\n\n    <p align=\"center\">Scheffer, I. E., Berkovic, S., Capovilla, G., Connolly, M. B., French, J., Guilhoto, L., ... &\n        Nordli, D. R. (2017). ILAE classification of the epilepsies: position paper of the ILAE Commission for\n        Classification and Terminology. Epilepsia, 58(4), 512-521.</p>\n\n    <p align=\"center\">\n        <button class=\"button\" onclick=\"expandAll()\">Expand All</button>\n        &nbsp;&nbsp;&nbsp;&nbsp;\n        <button class=\"button\" onclick=\"collapseAll()\">Collapse All</button>\n    </p>\n\n\n\n    <!-- load the d3.js library -->\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.min.js\"></script>\n\n    <!-- load tree data -->\n    <script type=\"module\" src=\"_static/js/treeData.js\"></script>\n\n    <!-- load tree functions -->\n    <script type=\"module\" src=\"_static/js/treeFunctions.js\"></script>\n\n    <!--\n        References:\n\n        Scheffer, I. E., Berkovic, S., Capovilla, G., Connolly, M. B., French, J., Guilhoto, L., ... & Nordli, D. R. (2017). ILAE classification of the epilepsies: position paper of the ILAE Commission for Classification and Terminology. Epilepsia, 58(4), 512-521.\n            https://onlinelibrary.wiley.com/doi/full/10.1111/epi.13709\n\n        Simple d3.js tree diagram -\n            https://bl.ocks.org/d3noob/8323795\n\n        Interactive d3.js tree diagram -\n            https://bl.ocks.org/d3noob/8375092\n\n        Export SVG D3 visualization to PNG or JPEG -\n            http://bl.ocks.org/Rokotyan/0556f8facbaf344507cdc45dc3622177\n\n        d3-hierarchy -\n            https://github.com/d3/d3-hierarchy/blob/v1.1.8/README.md#tree\n\n    -->\n\n\n</div>\n"
  },
  {
    "path": "templates/participants.json",
    "content": "{\n  \"age\": {\n    \"LongName\": \"\",\n    \"Description\": \"age of the participant\",\n    \"Levels\": {\n    },\n    \"Units\": \"years\",\n    \"TermURL\": \"https://www.todo.com/fixme\",\n    \"HED\": \"Age/#\"\n  },\n  \"sex\": {\n    \"LongName\": \"\",\n    \"Description\": \"sex of the participant as reported by the participant\",\n    \"Levels\": {\n      \"m\": \"male\",\n      \"f\": \"female\"\n    },\n    \"HED\": {\n      \"m\": \"Male\",\n      \"f\": \"Female\"\n    },\n    \"TermURL\": \"https://www.todo.com/fixme\"\n  },\n  \"handedness\": {\n    \"LongName\": \"\",\n    \"Description\": \"handedness of the participant as reported by the participant\",\n    \"Levels\": {\n      \"l\": \"left\",\n      \"r\": \"right\"\n    },\n    \"TermURL\": \"https://www.todo.com/fixme\",\n    \"HED\": {\n      \"l\": \"Left-handed\",\n      \"r\": \"Right-handed\"\n    }\n  }\n}\n"
  },
  {
    "path": "templates/participants.tsv",
    "content": "participant_id\tage\tsex\thandedness\nsub-01\t0\tm\tl\nsub-epilepsy01\t10\tf\tr\n"
  },
  {
    "path": "templates/phenotype/EpilepsyClassification.tsv",
    "content": "participant_id\tseizure_type\tepilepsy_type\tepilepsy_syndrome\tetiology\nsub-01\t/Generalised/NonMotor/AtypicalAbsence, /Generalised/Motor/GeneralizedTonic, /Generalised/Motor/GeneralizedAtonic\t/Generalised\t/Childhood/LennoxGastautSyndrome\t/Structural/TraumaticBrainInjury\nsub-02\t/Focal/Motor/FocalClonicSeizure, /Generalised/Motor/Myoclonic\t/Combined\t/NeonatalInfantile/DravetSyndrome\t/Genetic/GeneAbnormalities\n"
  },
  {
    "path": "templates/phenotype/EpilepsyClassification2017.json",
    "content": "{\n    \"epilepsy_classification\": {\n        \"LongName\": \"Epilepsy Classification\",\n        \"Description\": \"ILAE classification of the epilepsies\",\n        \"TermURL\": \"\",\n        \"Citation\": \"Scheffer, I. E., Berkovic, S., Capovilla, G., Connolly, M. B., French, J., Guilhoto, L., ... & Nordli, D. R. (2017). ILAE classification of the epilepsies: position paper of the ILAE Commission for Classification and Terminology. Epilepsia, 58(4), 512-521.\",\n        \"Levels\": {\n            \"seizure_type\": {\n                \"LongName\": \"Seizure type\",\n                \"Description\": \"Seizures are classified by onset: Generalised, Focal and Unknown\",\n                \"Levels\": {\n                    \"Generalised\": {\n                        \"Levels\": {\n                            \"Motor\": [\n                                \"GeneralizedTonicClonicAndVariants\",\n                                \"GeneralizedTonic\",\n                                \"GeneralizedAtonic\",\n                                \"Myoclonic\",\n                                \"MyoclonicAtonic\",\n                                \"EpilepticSpasms\"\n                            ],\n                            \"NonMotor\": [\n                                \"TypicalAbsence\",\n                                \"AtypicalAbsence\",\n                                \"MyoclonicAbsence\",\n                                \"AbsenceWithEyelidMyoclonia\"\n                            ]\n                        }\n                    },\n                    \"Focal\": {\n                        \"Levels\": {\n                            \"Awareness\": [\n                                \"Aware\",\n                                \"ImpairedAwareness\"\n                            ],\n                            \"Motor\": [\n                                \"FocalClonicSeizure\",\n                                \"FocalTonicSeizure\",\n                                \"FocalMotorSeizureWithDystonia\",\n                                \"FocalMyoclonicSeizure\",\n                                \"FocalAtonicSeizure\",\n                                \"FocalMotorSeizureWithParesisOrParalysis\",\n                                \"FocalEpilepticSpasms\",\n                                \"FocalHyperkineticSeizure\",\n                                \"FocalAutomatismSeizure\",\n                                \"FocalMotorSeizureWithDysarthriaOrAnarthria\",\n                                \"FocalMotorSeizureWithNegativeMyoclonus\",\n                                \"FocalMotorSeizureWithVersion\",\n                                \"FocalBilateralMotorSeizure\"\n                            ],\n                            \"NonMotor\": {\n                                \"Levels\": {\n                                    \"FocalSensorySeizure\": [\n                                        \"FocalSomatosensorySeizure\",\n                                        \"FocalSensoryVisualSeizure\",\n                                        \"FocalSensoryAuditorySeizure\",\n                                        \"FocalSensoryOlfactorySeizure\",\n                                        \"FocalSensoryGustatorySeizure\",\n                                        \"FocalSensoryVestibularSeizure\",\n                                        \"FocalSensorySeizureWithHotOrColdSensations\",\n                                        \"FocalSensorySeizureWithCephalicSensation\"\n                                    ],\n                                    \"FocalCognitiveSeizure\": [\n                                        \"FocalCognitiveSeizureWithExpressiveDysphasiaOrAphasia\",\n                                        \"FocalCognitiveSeizureWithAnomia\",\n                                        \"FocalCognitiveSeizureWithReceptiveDysphasiaOrAphasia\",\n                                        \"FocalCognitiveSeizureWithAuditoryAgnosia\",\n                                        \"FocalCognitiveSeizureWithConductionDysphasiaOrAphasia\",\n                                        \"FocalCognitiveSeizureWithDyslexiaOrAlexia\",\n                                        \"FocalCognitiveSeizureWithMemoryIpairment\",\n                                        \"FocalCognitiveSeizureWithDejaVuOrJamaisVu\",\n                                        \"FocalCognitiveSeizureWithHallucination\",\n                                        \"FocalCognitiveSeizureWithIllusion\",\n                                        \"FocalCognitiveSeizureWithDissociation\",\n                                        \"FocalCognitiveSeizureWithForcedThinking\",\n                                        \"FocalCognitiveSeizureWithDyscalculiaOrAcalculia\",\n                                        \"FocalCognitiveSeizureWithDysgraphiaOrAgraphia\",\n                                        \"FocalCognitiveSeizureWithLeftRightConfusion\",\n                                        \"FocalCognitiveSeizureWithNeglect\"\n                                    ],\n                                    \"FocalEmotionalSeizure\": [\n                                        \"FocalEmotionalSeizureWithFearOrAnxietyOrPanic\",\n                                        \"FocalEmotionalSeizureWithLaughingGelastic\",\n                                        \"FocalEmotionalSeizureWithCryingDacrystic\",\n                                        \"FocalEmotionalSeizureWithPleasure\",\n                                        \"FocalEmotionalSeizureWithAnger\"\n                                    ],\n                                    \"FocalAutonomicSeizure\": [\n                                        \"FocalAutonomicSeizureWithPalpitationsOrTachycardiaOrBradycardiaOrAsystole\",\n                                        \"FocalAutonomicSeizureWithEpigastricSensation\",\n                                        \"FocalAutonomicSeizureWithPallorOrFlushing\",\n                                        \"FocalAutonomicSeizureWithHypoventilationOrHyperventilationOrAlteredRespiration\",\n                                        \"FocalAutonomicSeizureWithPiloerection\",\n                                        \"FocalAutonomicSeizureWithErection\",\n                                        \"FocalAutonomicSeizureWithUrgeToUrinateOrDefecate\",\n                                        \"FocalAutonomicSeizureWithLacrimation\",\n                                        \"FocalAutonomicSeizureWithPupillaryDilationOrConstriction\"\n                                    ],\n                                    \"FocalBehaviouralArrestSeizure\": [\n                                        \"FocalBehaviouralArrestSeizure\"\n                                    ]\n                                }\n                            },\n                            \"FocalToBilateralTonicClonicSeizure\": [\n                                \"FocalToBilateralTonicClonicSeizure\"\n                            ]\n                        }\n                    },\n                    \"Unknown\": {\n                        \"Levels\": {\n                            \"Motor\": [\n                                \"TonicClonic\",\n                                \"EpilepticSpasms\"\n                            ],\n                            \"NonMotor\": [\n                                \"BehaviourArrest\",\n                                \"Unclassified\"\n                            ]\n                        }\n                    }\n                }\n            },\n            \"epilepsy_type\": {\n                \"LongName\": \"Epilepsy type\",\n                \"Description\": \"Epilepsy types are divided into four categories: Generalised Epilepsy, Focal Epilepsy, Combined generalised and focal Epilepsy and Unknown Epilepsy\",\n                \"Levels\": {\n                    \"Generalised\": {\n                        \"LongName\": \"Generalised Epilepsy\",\n                        \"Description\": \"Patients with generalized epilepsy have generalized seizure types, and may have typical interictal and/or ictal EEG findings that accompany generalized seizure types (for example generalized spike and wave).\"\n                    },\n                    \"Focal\": {\n                        \"LongName\": \"Focal Epilepsy\",\n                        \"Description\": \"Patients with focal epilepsy have focal seizure types, and may have typical interictal and/or ictal EEG findings that accompany focal seizure types (such as focal sharp waves or focal interictal slowing).\"\n                    },\n                    \"Combined\": {\n                        \"LongName\": \"Combined generalised and focal Epilepsy\",\n                        \"Description\": \"Patients may have both generalized and focal seizure types, with interictal and/or ictal EEG findings that accompany both seizure types.\"\n                    },\n                    \"Unknown\": {\n                        \"LongName\": \"Unknown Epilepsy\",\n                        \"Description\": \"The term 'unknown' is used to denote where it is understood that the patient has epilepsy, but it is not possible to denote whether it is focal, generalized, or combined focal and generalized. This may occur due to insufficient information to classify the epilepsy, for example if the EEG is normal/uninformative.\"\n                    }\n                }\n            },\n            \"epilepsy_syndrome\": {\n                \"LongName\": \"Epilepsy Syndrome\",\n                \"Description\": \"Epilepsies are organized by reliably identifying common clinical and electrical characteristics into epilepsy syndromes. Such syndromes have a typical age of seizure onset, specific seizure types and EEG characteristics and often other features which when taken together allow the specific epilepsy syndrome diagnosis.\",\n                \"Levels\": {\n                    \"NeonatalInfantile\": [\n                        \"SelfLimitedNeonatalSeizuresAndSelfLimitedFamilialNeonatalEpilepsy\",\n                        \"SelfLimitedFamilialAndNonFamilialInfantileEpilepsy\",\n                        \"EarlyMyoclonicEncephalopathy\",\n                        \"OhtaharaSyndrome\",\n                        \"WestSyndrome\",\n                        \"DravetSyndrome\",\n                        \"MyoclonicEpilepsyInInfancy\",\n                        \"EpilepsyOfInfancyWithMigratingFocalSeizures\",\n                        \"MyoclonicEncephalopathyInNonProgressiveDisorders\",\n                        \"FebrileSeizuresPlusGeneticEpilepsyWithFebrileSeizuresPlus\"\n                    ],\n                    \"Childhood\": [\n                        \"EpilepsyWithMyoclonicAtonicSeizures\",\n                        \"EpilepsyWithEyelidMyoclonias\",\n                        \"LennoxGastautSyndrome\",\n                        \"ChildhoodAbsenceEpilepsy\",\n                        \"EpilepsyWithMyoclonicAbsences\",\n                        \"PanayiotopoulosSyndrome\",\n                        \"ChildhoodOccipitalEpilepsyGastautType\",\n                        \"PhotosensitiveOccipitalLobeEpilepsy\",\n                        \"ChildhoodEpilepsyWithCentrotemporalSpikes\",\n                        \"AtypicalChildhoodEpilepsyWithCentrotemporalSpikes\",\n                        \"EpilepticEncephalopathyWithContinuousSpikeAndWaveDuringSleep\",\n                        \"LandauKleffnerSyndrome\",\n                        \"AutosomalDominantNocturnalFrontalLobeEpilepsy\"\n                    ],\n                    \"AdolescentAdult\": [\n                        \"JuvenileAbsenceEpilepsy\",\n                        \"JuvenileMyoclonicEpilepsy\",\n                        \"EpilepsyWithGeneralizedTonicClonicSeizuresAlone\",\n                        \"AutosomalDominantEpilepsyWithAuditoryFeatures\",\n                        \"OtherFamilialTemporalLobeEpilepsies\"\n                    ],\n                    \"AnyAge\": [\n                        \"FamilialFocalEpilepsyWithVariableFoci\",\n                        \"ReflexEpilepsies\",\n                        \"ProgressiveMyoclonusEpilepsies\"\n                    ]\n                }\n            },\n            \"etiology\": {\n                \"LongName\": \"Epilepsy etiology\",\n                \"Description\": \"At each stage, etiology (cause and comorbidities) should be identified. These are divided into six categories.\",\n                \"Levels\": {\n                    \"Genetic\": {\n                        \"LongName\": \"Genetic Etiology\",\n                        \"Description\": \"The concept of genetic epilepsy is that the epilepsy is, as best we understand, the direct result of a known or presumed genetic defect(s) in which seizures are the core symptom of the disorder.\",\n                        \"Levels\": [\n                            \"ChromosomalAbnormalities\",\n                            \"GeneAbnormalities\"\n                        ]\n                    },\n                    \"Structural\": {\n                        \"LongName\": \"Structural Etiology\",\n                        \"Description\": \"Structural epilepsies are conceptualized as having a distinct structural brain abnormality that has been demonstrated to be associated with a substantially increased risk of epilepsy in appropriately designed studies.\",\n                        \"Levels\": [\n                            \"MalformationsOfCorticalDevelopment\",\n                            \"VascularMalformations\",\n                            \"HippocampalSclerosis\",\n                            \"HypoxicIschemicStructuralAbnormalities\",\n                            \"TraumaticBrainInjury\",\n                            \"Tumors\",\n                            \"PorencephalicCyst\"\n                        ]\n                    },\n                    \"Metabolic\": {\n                        \"LongName\": \"Metabolic Etiology\",\n                        \"Description\": \"Metabolic epilepsies are conceptualized as having a distinct metabolic abnormality that has been demonstrated to be associated with a substantially increased risk of developing epilepsy in appropriately designed studies.\",\n                        \"Levels\": [\n                            \"BiotinidaseAndHolocarboxylaseSynthaseDeficiency\",\n                            \"CerebralFolateDeficiency\",\n                            \"CreatineDisorders\",\n                            \"FolinicAcidResponsiveSeizures\",\n                            \"GlucoseTransporter1Deficiency\",\n                            \"MitochondrialDisorders\",\n                            \"PeroxisomalDisorders\",\n                            \"PyridoxineDependentEpilepsy\"\n                        ]\n                    },\n                    \"Immune\": {\n                        \"LongName\": \"Immune Etiology\",\n                        \"Description\": \"Immune epilepsies are conceptualized as having a distinct immune-mediated etiology with evidence of central nervous system inflammation, that has been demonstrated to be associated with a substantially increased risk of developing epilepsy.\",\n                        \"Levels\": [\n                            \"RasmussenSyndrome\",\n                            \"AntibodyMediatedEtiologies\"\n                        ]\n                    },\n                    \"Infectious\": {\n                        \"LongName\": \"Infectious Etiology\",\n                        \"Description\": \"The commonest etiology for epilepsy worldwide is infectious, especially in developing countries. Infections in the central nervous system can cause both acute symptomatic seizures (which occur closely related to the timing of the initial infection) and epilepsy.\",\n                        \"Levels\": [\n                            \"BacterialMeningitis\",\n                            \"CerebralMalaria\",\n                            \"CerebralToxoplasmosis\",\n                            \"CMV\",\n                            \"HIV\",\n                            \"Neurocysticercosis\",\n                            \"Tuberculosis\",\n                            \"ViralEncephalitis\",\n                            \"OtherInfections\"\n                        ]\n                    },\n                    \"Unknown\": {\n                        \"LongName\": \"Unknown Etiology\",\n                        \"Description\": \"'Unknown' is meant to be viewed neutrally and to designate that the nature of the underlying cause of the epilepsy is as yet unknown; it may have a fundamental genetic defect at its core or there may be a separate as yet unrecognized disorder.\",\n                        \"Levels\": [\n                            \"FebrileInfectionRelatedEpilepsySyndrome\"\n                        ]\n                    }\n                }\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "templates/samples.json",
    "content": "{\n  \"sample_id\": {\n    \"LongName\": \"Sample ID\",\n    \"Description\": \"A sample identifier of the form `sample-<label>`,\\nmatching a sample entity found in the dataset.\\n\"\n  },\n  \"participant_id\": {\n    \"LongName\": \"Participant ID\",\n    \"Description\": \"A participant identifier of the form `sub-<label>`,\\nmatching a participant entity found in the dataset.\\n\"\n  },\n  \"sample_type\": {\n    \"LongName\": \"Sample type\",\n    \"Description\": \"Biosample type defined by\\n[ENCODE Biosample Type](https://www.encodeproject.org/profiles/biosample_type).\\n\"\n  }\n}\n"
  },
  {
    "path": "templates/samples.tsv",
    "content": "sample_id\tparticipant_id\tsample_type\nsample-01\tsub-01\ttissue\nsample-02\tsub-epilepsy01\ttissue\n"
  },
  {
    "path": "templates/sub-01/ses-01/anat/sub-01_ses-01_acq-FullExample_run-01_T1w.json",
    "content": "{\n  \"Manufacturer\": \" \",\n  \"ManufacturersModelName\": \" \",\n  \"MagneticFieldStrength\": \" \",\n  \"DeviceSerialNumber\": \" \",\n  \"StationName\": \" \",\n  \"SoftwareVersions\": \" \",\n  \"HardcopyDeviceSoftwareVersion\": \" \",\n  \"ReceiveCoilName\": \" \",\n  \"ReceiveCoilActiveElements\": \" \",\n  \"GradientSetType\": \" \",\n  \"MRTransmitCoilSequence\": \" \",\n  \"MatrixCoilMode\": \" \",\n  \"CoilCombinationMethod\": \" \",\n  \"PulseSequenceType\": \" \",\n  \"ScanningSequence\": \" \",\n  \"SequenceVariant\": \" \",\n  \"ScanOptions\": \" \",\n  \"SequenceName\": \" \",\n  \"PulseSequenceDetails\": \" \",\n  \"NonlinearGradientCorrection\": \" \",\n  \"NumberShots\": \" \",\n  \"ParallelReductionFactorInPlane\": \" \",\n  \"ParallelAcquisitionTechnique\": \" \",\n  \"PartialFourier\": \" \",\n  \"PartialFourierDirection\": \" \",\n  \"WaterFatShift\": \" \",\n  \"EchoTrainLength\": \" \",\n  \"EchoTime\": \" \",\n  \"InversionTime\": \" \",\n  \"SliceEncodingDirection\": \" \",\n  \"DwellTime\": \" \",\n  \"FlipAngle\": \" \",\n  \"MultibandAccelerationFactor\": \" \",\n  \"AnatomicalLandmarkCoordinates\": \" \",\n  \"InstitutionName\": \" \",\n  \"InstitutionAddress\": \" \",\n  \"InstitutionalDepartmentName\": \" \"\n}\n"
  },
  {
    "path": "templates/sub-01/ses-01/anat/sub-01_ses-01_acq-ShortExample_run-01_T1w.json",
    "content": "{\n  \"PhaseEncodingDirection\": \" \",\n  \"EffectiveEchoSpacing\": \" \",\n  \"TotalReadoutTime\": \" \",\n  \"EchoTime\": \" \"\n}\n"
  },
  {
    "path": "templates/sub-01/ses-01/eeg/sub-01_ses-01_task-FilterExample_eeg.json",
    "content": "{\n    \"HardwareFilters\": {\n        \"Highpass RC filter\": {\n            \"Half amplitude cutoff (Hz)\": 0.0159,\n            \"Roll-off\": \"6dB/Octave\"\n        }\n    },\n    \"SoftwareFilters\": \"n/a\",\n    \"TaskName\": \"FilterExample\"\n}\n"
  },
  {
    "path": "templates/sub-01/ses-01/eeg/sub-01_ses-01_task-FullExample_eeg.json",
    "content": "{\n    \"TaskName\": \"FullExample\",\n    \"TaskDescription\": \"\",\n    \"Instructions\": \"\",\n    \"CogAtlasID\": \"https://www.cognitiveatlas.org/FIXME\",\n    \"CogPOID\": \"http://www.cogpo.org/ontologies/CogPOver1.owl#FIXME\",\n    \"InstitutionName\": \"\",\n    \"InstitutionalDepartmentName\": \"\",\n    \"InstitutionAddress\": \"\",\n    \"Manufacturer\": \"\",\n    \"ManufacturersModelName\": \"\",\n    \"DeviceSerialNumber\": \"\",\n    \"SoftwareVersions\": \"\",\n    \"PowerLineFrequency\": 50,\n    \"SamplingFrequency\": [],\n    \"EEGChannelCount\": [],\n    \"EOGChannelCount\": [],\n    \"ECGChannelCount\": [],\n    \"EMGChannelCount\": [],\n    \"MiscChannelCount\": [],\n    \"TriggerChannelCount\": [],\n    \"EEGPlacementScheme\": \"\",\n    \"EEGReference\": \"\",\n    \"EEGGround\": \"\",\n    \"CapManufacturer\": \"\",\n    \"CapManufacturersModelName\": \"\",\n    \"HardwareFilters\": \"\",\n    \"SoftwareFilters\": \"\",\n    \"RecordingDuration\": [],\n    \"RecordingType\": \"\",\n    \"SubjectArtefactDescription\": \"\"\n}\n"
  },
  {
    "path": "templates/sub-01/ses-01/eeg/sub-01_ses-01_task-MinimalExample_eeg.json",
    "content": "{\n    \"TaskName\": \"MinimalExample\",\n    \"SamplingFrequency\": [],\n    \"EEGChannelCount\": [],\n    \"EOGChannelCount\": [],\n    \"ECGChannelCount\": [],\n    \"EMGChannelCount\": [],\n    \"EEGReference\": \"\",\n    \"PowerLineFrequency\": 50\n}\n"
  },
  {
    "path": "templates/sub-01/ses-01/eeg/sub-01_ses-01_task-ReferenceExample_eeg.json",
    "content": "{\n    \"Manufacturer\": \"Biosemi\",\n    \"ManufacturersModelName\": \"ActiveTwo\",\n    \"EEGReference\": \"CMS, placed on Cz\",\n    \"EEGGround\": \"DRL, placed on Fz\",\n    \"TaskName\": \"ReferenceExample\"\n}\n"
  },
  {
    "path": "templates/sub-01/ses-01/fmap/sub-01_ses-01_acq-Case1_run-01_phasediff.json",
    "content": "{\n  \"EchoTime1\": \"\",\n  \"EchoTime2\": \"\",\n  \"IntendedFor\": [\n    \"sub-01/ses-01/func/...\",\n    \"sub-01/ses-01/func/...\"\n  ]\n}\n"
  },
  {
    "path": "templates/sub-01/ses-01/fmap/sub-01_ses-01_acq-Case2_run-01_phase1.json",
    "content": "{\n  \"EchoTime\": \"\",\n  \"IntendedFor\": [\n    \"sub-01/ses-01/func/...\",\n    \"sub-01/ses-01/func/...\"\n  ]\n}\n"
  },
  {
    "path": "templates/sub-01/ses-01/fmap/sub-01_ses-01_acq-Case2_run-01_phase2.json",
    "content": "{\n  \"EchoTime\": \"\",\n  \"IntendedFor\": [\n    \"sub-01/ses-01/func/...\",\n    \"sub-01/ses-01/func/...\"\n  ]\n}\n"
  },
  {
    "path": "templates/sub-01/ses-01/fmap/sub-01_ses-01_acq-Case3_run-01_fieldmap.json",
    "content": "{\n  \"Units\": \"\",\n  \"IntendedFor\": [\n    \"sub-01/ses-01/func/...\",\n    \"sub-01/ses-01/func/...\"\n  ]\n}\n"
  },
  {
    "path": "templates/sub-01/ses-01/fmap/sub-01_ses-01_acq-Case4_dir-LR_run-01_epi.json",
    "content": "{\n  \"PhaseEncodingDirection\": \"\",\n  \"TotalReadoutTime\": \"\",\n  \"IntendedFor\": [\n    \"sub-01/ses-01/func/...\",\n    \"sub-01/ses-01/func/...\"\n  ]\n}\n"
  },
  {
    "path": "templates/sub-01/ses-01/func/sub-01_ses-01_task-FullExample_run-01_bold.json",
    "content": "{\n  \"TaskName\": \"FullExample\",\n  \"RepetitionTime\": [],\n  \"PhaseEncodingDirection\": \"\",\n  \"EffectiveEchoSpacing\": [],\n  \"EchoTime\": [],\n  \"Manufacturer\": \"\",\n  \"ManufacturersModelName\": \"\",\n  \"MagneticFieldStrength\": [],\n  \"DeviceSerialNumber\": \"\",\n  \"StationName\": \" \",\n  \"SoftwareVersions\": \" \",\n  \"HardcopyDeviceSoftwareVersion\": \"\",\n  \"ReceiveCoilName\": \" \",\n  \"ReceiveCoilActiveElements\": \"\",\n  \"GradientSetType\": \"\",\n  \"MRTransmitCoilSequence\": \"\",\n  \"MatrixCoilMode\": \"\",\n  \"CoilCombinationMethod\": \"\",\n  \"PulseSequenceType\": \"\",\n  \"ScanningSequence\": \"\",\n  \"SequenceVariant\": \"\",\n  \"ScanOptions\": \"\",\n  \"SequenceName\": \"\",\n  \"PulseSequenceDetails\": \"\",\n  \"NonlinearGradientCorrection\": \"\",\n  \"NumberShots\": [],\n  \"ParallelReductionFactorInPlane\": \"\",\n  \"ParallelAcquisitionTechnique\": \"\",\n  \"PartialFourier\": \"\",\n  \"PartialFourierDirection\": \"\",\n  \"WaterFatShift\": \"\",\n  \"EchoTrainLength\": \"\",\n  \"InversionTime\": [],\n  \"SliceEncodingDirection\": \"\",\n  \"DwellTime\": [],\n  \"TotalReadoutTime\": [],\n  \"DelayAfterTrigger\": [],\n  \"NumberOfVolumesDiscardedByScanner\": [],\n  \"NumberOfVolumesDiscardedByUser\": [],\n  \"FlipAngle\": [],\n  \"MultibandAccelerationFactor\": [],\n  \"Instructions\": \"\",\n  \"TaskDescription\": \"\",\n  \"CogAtlasID\": \"https://www.cognitiveatlas.org/FIXME\",\n  \"CogPOID\": \"http://www.cogpo.org/ontologies/CogPOver1.owl#FIXME\",\n  \"InstitutionName\": \"\",\n  \"InstitutionAddress\": \"\",\n  \"InstitutionalDepartmentName\": \"\"\n}\n"
  },
  {
    "path": "templates/sub-01/ses-01/func/sub-01_ses-01_task-FullExample_run-01_events.json",
    "content": "{\n  \"trial_type\": {\n    \"LongName\": \"\",\n    \"Description\": \"Emotion image type\",\n    \"Levels\": {\n      \"afraid\": \"A face showing fear is displayed\",\n      \"angry\": \"A face showing anger is displayed\"\n    },\n    \"Units\": \"\",\n    \"TermURL\": \"\"\n  },\n  \"identifier\": {\n    \"LongName\": \"Unique identifier from Karolinska (KDEF) database\",\n    \"Description\": \"ID from KDEF database used to identify the displayed image\"\n  },\n  \"StimulusPresentation\": {\n    \"OperatingSystem\": \"Linux Ubuntu 18.04.5\",\n    \"SoftwareName\": \"Psychtoolbox\",\n    \"SoftwareRRID\": \"SCR_002881\",\n    \"SoftwareVersion\": \"3.0.14\",\n    \"Code\": \"doi:10.5281/zenodo.3361717\"\n  }\n}\n"
  },
  {
    "path": "templates/sub-01/ses-01/func/sub-01_ses-01_task-FullExample_run-01_events.tsv",
    "content": "onset\tduration\ttrial_type\tresponse_time\tstim_file\tHED\n0\t0\tafraid\t0\n"
  },
  {
    "path": "templates/sub-01/ses-01/func/sub-01_ses-01_task-ShortExample_run-01_bold.json",
    "content": "{\n  \"TaskName\": \"ShortExample\",\n  \"RepetitionTime\": [],\n  \"VolumeTiming\": [],\n  \"DelayTime\": [],\n  \"SliceTiming\": [],\n  \"AcquisitionDuration\": [],\n  \"PhaseEncodingDirection\": \"\",\n  \"EffectiveEchoSpacing\": [],\n  \"EchoTime\": []\n}\n"
  },
  {
    "path": "templates/sub-01/ses-01/ieeg/sub-01_ses-01_coordsystem.json",
    "content": "{\n  \"iEEGCoordinateSystem\": \"\",\n  \"iEEGCoordinateUnits\": \"\",\n  \"iEEGCoordinateProcessingDescripton\": \"\",\n  \"IndendedFor\": \"\",\n  \"iEEGCoordinateProcessingDescription\": \"\",\n  \"iEEGCoordinateProcessingReference\": \"\"\n}\n"
  },
  {
    "path": "templates/sub-01/ses-01/ieeg/sub-01_ses-01_electrodes.tsv",
    "content": "name\tx\ty\tz\tsize\tmaterial\tmanufacturer\tgroup\themisphere\ttype\timpedance\nn/a\t0\t0\t0\t0\tn/a\tn/a\tn/a\tn/a\tn/a\tn/a\n"
  },
  {
    "path": "templates/sub-01/ses-01/ieeg/sub-01_ses-01_task-LongExample_run-01_channels.tsv",
    "content": "name\ttype\tunits\tlow_cutoff\thigh_cutoff\treference\tgroup\tsampling_frequency\tdescription\tnotch\tstatus\tstatus_description\nn/a\tn/a\tn/a\t0\t0\tn/a\tn/a\t0\tn/a\t0\tbad\tn/a\n"
  },
  {
    "path": "templates/sub-01/ses-01/ieeg/sub-01_ses-01_task-LongExample_run-01_ieeg.json",
    "content": "{\n  \"TaskName\": \"LongExample\",\n  \"SamplingFrequency\": [],\n  \"PowerLineFrequency\": [],\n  \"SoftwareFilters\": \"\",\n  \"HardwareFilters\": {\n    \"HighpassFilter\": {\n      \"CutoffFrequency\": []\n    },\n    \"LowpassFilter\": {\n      \"CutoffFrequency\": []\n    }\n  },\n  \"Manufacturer\": \"\",\n  \"ManufacturersModelName\": \"\",\n  \"TaskDescription\": \"\",\n  \"Instructions\": \"\",\n  \"CogAtlasID\": \"https://www.cognitiveatlas.org/FIXME\",\n  \"CogPOID\": \"http://www.cogpo.org/ontologies/CogPOver1.owl#FIXME\",\n  \"InstitutionName\": \"\",\n  \"InstitutionAddress\": \"\",\n  \"DeviceSerialNumber\": \"\",\n  \"ECOGChannelCount\": [],\n  \"SEEGChannelCount\": [],\n  \"EEGChannelCount\": [],\n  \"EOGChannelCount\": [],\n  \"ECGChannelCount\": [],\n  \"EMGChannelCount\": [],\n  \"MiscChannelCount\": [],\n  \"TriggerChannelCount\": [],\n  \"RecordingDuration\": [],\n  \"RecordingType\": \"\",\n  \"EpochLength\": [],\n  \"SubjectArtefactDescription\": \"\",\n  \"SoftwareVersions\": \"\",\n  \"iEEGReference\": \"\",\n  \"ElectrodeManufacturer\": \"\",\n  \"ElectrodeManufacturersModelName\": \"\",\n  \"iEEGGround\": \"\",\n  \"iEEGPlacementScheme\": \"\",\n  \"iEEGElectrodeGroups\": \"\",\n  \"ElectricalStimulation\": \"\",\n  \"ElectricalStimulationParameters\": \"\"\n}\n"
  },
  {
    "path": "templates/sub-01/ses-01/meg/sub-01_ses-01_task-FullExample_acq-CTF_run-1_proc-sss_meg.json",
    "content": "{\n  \"TaskName\": \"FullExample\",\n  \"InstitutionName\": \"\",\n  \"InstitutionAddress\": \"\",\n  \"Manufacturer\": \"\",\n  \"ManufacturersModelName\": \"\",\n  \"SoftwareVersions\": \"\",\n  \"TaskDescription\": \"\",\n  \"Instructions\": \"\",\n  \"CogPOID\": \"http://www.cogpo.org/ontologies/CogPOver1.owl#FIXME\",\n  \"DeviceSerialNumber\": \"\",\n  \"SamplingFrequency\": \"\",\n  \"PowerLineFrequency\": \"\",\n  \"DewarPosition\": \"\",\n  \"SoftwareFilters\": \"\",\n  \"DigitizedLandmarks\": \"\",\n  \"DigitizedHeadPoints\": \"\",\n  \"MEGChannelCount\": [],\n  \"MEGREFChannelCount\": [],\n  \"EEGChannelCount\": [],\n  \"ECOGChannelCount\": [],\n  \"SEEGChannelCount\": [],\n  \"EOGChannelCount\": [],\n  \"ECGChannelCount\": [],\n  \"EMGChannelCount\": [],\n  \"MiscChannelCount\": [],\n  \"TriggerChannelCount\": [],\n  \"RecordingDuration\": [],\n  \"RecordingType\": \"\",\n  \"EpochLength\": \"\",\n  \"ContinuousHeadLocalization\": \"\",\n  \"HeadCoilFrequency\": [],\n  \"MaxMovement\": \"\",\n  \"SubjectArtefactDescription\": \"\",\n  \"AssociatedEmptyRoom\": \"\",\n  \"EEGSamplingFrequency\": [],\n  \"EEGPlacementScheme\": \"\",\n  \"ManufacturersAmplifierModelName\": \"\",\n  \"EEGReference\": \"\"\n}\n"
  },
  {
    "path": "templates/sub-01/ses-01/meg/sub-01_ses-01_task-ShortExample_acq-CTF_run-1_proc-sss_meg.json",
    "content": "{\n  \"TaskName\": \"ShortExample\",\n  \"InstitutionName\": \"\",\n  \"InstitutionAddress\": \"\",\n  \"Manufacturer\": \"\",\n  \"ManufacturersModelName\": \"\",\n  \"SoftwareVersions\": \"\",\n  \"TaskDescription\": \"\",\n  \"Instructions\": \"\",\n  \"CogPOID\": \"http://www.cogpo.org/ontologies/CogPOver1.owl#FIXME\",\n  \"DeviceSerialNumber\": \"\",\n  \"SamplingFrequency\": [],\n  \"PowerLineFrequency\": [],\n  \"DewarPosition\": \"\",\n  \"SoftwareFilters\": \"\",\n  \"DigitizedLandmarks\": \"\",\n  \"DigitizedHeadPoints\": \"\",\n  \"MEGChannelCount\": [],\n  \"MEGREFChannelCount\": [],\n  \"EEGChannelCount\": [],\n  \"ECOGChannelCount\": [],\n  \"SEEGChannelCount\": [],\n  \"EOGChannelCount\": [],\n  \"ECGChannelCount\": [],\n  \"EMGChannelCount\": [],\n  \"MiscChannelCount\": [],\n  \"TriggerChannelCount\": [],\n  \"RecordingDuration\": [],\n  \"RecordingType\": \"\",\n  \"EpochLength\": \"\",\n  \"ContinuousHeadLocalization\": \"\",\n  \"HeadCoilFrequency\": [],\n  \"MaxMovement\": \"\",\n  \"SubjectArtefactDescription\": \"\",\n  \"AssociatedEmptyRoom\": \"\",\n  \"EEGSamplingFrequency\": [],\n  \"EEGPlacementScheme\": \"\",\n  \"ManufacturersAmplifierModelName\": \"\",\n  \"EEGReference\": \"\"\n}\n"
  },
  {
    "path": "templates/sub-01/ses-01/micr/sub-01_ses-01_sample-01_acq-Full_stain-03_chunk-01_SEM.json",
    "content": "{\n  \"Manufacturer\": \"RECOMMENDED\",\n  \"ManufacturersModelName\": \"RECOMMENDED\",\n  \"DeviceSerialNumber\": \"RECOMMENDED\",\n  \"StationName\": \"RECOMMENDED\",\n  \"SoftwareVersions\": \"RECOMMENDED\",\n  \"InstitutionName\": \"RECOMMENDED\",\n  \"InstitutionAddress\": \"RECOMMENDED\",\n  \"InstitutionalDepartmentName\": \"RECOMMENDED\",\n  \"PixelSize\": \"REQUIRED\",\n  \"PixelSizeUnits\": \"REQUIRED\",\n  \"Immersion\": \"OPTIONAL\",\n  \"NumericalAperture\": \"OPTIONAL\",\n  \"Magnification\": \"OPTIONAL\",\n  \"ImageAcquisitionProtocol\": \"OPTIONAL\",\n  \"OtherAcquisitionParameters\": \"OPTIONAL\",\n  \"BodyPart\": \"RECOMMENDED\",\n  \"BodyPartDetails\": \"RECOMMENDED\",\n  \"SampleEnvironment\": \"RECOMMENDED\",\n  \"SampleStaining\": \"RECOMMENDED\",\n  \"SamplePrimaryAntibody\": \"RECOMMENDED\",\n  \"SampleSecondaryAntibody\": \"RECOMMENDED\",\n  \"BodyPartDetailsOntology\": \"OPTIONAL\",\n  \"SampleEmbedding\": \"OPTIONAL\",\n  \"SampleFixation\": \"OPTIONAL\",\n  \"SliceThickness\": \"OPTIONAL\",\n  \"TissueDeformationScaling\": \"OPTIONAL\",\n  \"SampleExtractionProtocol\": \"OPTIONAL\",\n  \"SampleExtractionInstitution\": \"OPTIONAL\",\n  \"ChunkTransformationMatrix\": \"RECOMMENDED if <chunk-index> is used in filenames\",\n  \"ChunkTransformationMatrixAxis\": \"REQUIRED if ChunkTransformationMatrix is present\"\n}\n"
  },
  {
    "path": "templates/sub-01/ses-01/micr/sub-01_ses-01_sample-01_acq-Short_stain-03_chunk-01_SEM.json",
    "content": "{\n  \"PixelSize\": \"REQUIRED\",\n  \"PixelSizeUnits\": \"REQUIRED\"\n}\n"
  },
  {
    "path": "templates/sub-01/ses-01/pet/sub-01_ses-01_recording-AutosamplerShortExample_blood.json",
    "content": "{\n  \"PlasmaAvail\": false,\n  \"WholeBloodAvail\": true,\n  \"MetaboliteMethod\": false,\n  \"DispersionCorrected\": false,\n  \"time\": {\n    \"Description\": \"Time in relation to time zero defined by the _pet.json\",\n    \"Units\": \"s\"\n  },\n  \"whole_blood_radioactivity\": {\n    \"Description\": \"Radioactivity in uncorrected whole blood samples from Allogg autosampler.\",\n    \"Units\": \"kBq/ml\"\n  }\n}\n"
  },
  {
    "path": "templates/sub-01/ses-01/pet/sub-01_ses-01_recording-AutosamplerShortExample_blood.tsv",
    "content": "time\twhole_blood_radioactivity\n0\t0\n"
  },
  {
    "path": "templates/sub-01/ses-01/pet/sub-01_ses-01_recording-ManualFullExample_blood.json",
    "content": "{\n  \"PlasmaAvail\": \"\",\n  \"MetaboliteAvail\": \"\",\n  \"WholeBloodAvail\": \"\",\n  \"DispersionCorrected\": \"\",\n  \"WithdrawalRate\": \"\",\n  \"TubingType\": \"\",\n  \"TubingLength\": \"\",\n  \"DispersionConstant\": \"\",\n  \"Haematocrit\": \"\",\n  \"BloodDensity\": \"\",\n  \"PlasmaFreeFraction\": \"\",\n  \"PlasmaFreeFractionMethod\": \"\",\n  \"MetaboliteMethod\": \"\",\n  \"MetaboliteRecoveryCorrectionApplied\": \"\",\n  \"time\": {\n    \"Description\": \"Time, in seconds, relative to `TimeZero` defined by the `*_pet.json`.\\nFor example, 5.\\n\",\n    \"Unit\": \"s\"\n  },\n  \"plasma_radioactivity\": {\n    \"Description\": \"Radioactivity in plasma, in unit of plasma radioactivity (for example, `kBq/mL`).\\n\",\n    \"unit\": \"kBq/ml\"\n  },\n  \"metabolite_parent_fraction\": {\n    \"Description\": \"Parent fraction of the radiotracer (0-1).\\n\",\n    \"unit\": \"unitless\"\n  },\n  \"metabolite_polar_fraction\": {\n    \"Description\": \"Polar metabolite fraction of the radiotracer (0-1).\\n\",\n    \"unit\": \"unitless\"\n  },\n  \"hplc_recovery_fractions\": {\n    \"Description\": \"HPLC recovery fractions (the fraction of activity that gets loaded onto the HPLC).\\n\",\n    \"Unit\": \"arbitrary\"\n  },\n  \"whole_blood_radioactivity\": {\n    \"Description\": \"Radioactivity in whole blood samples,\\nin unit of radioactivity measurements in whole blood samples (for example, `kBq/mL`).\\n\",\n    \"unit\": \"kBq/ml\"\n  }\n}\n"
  },
  {
    "path": "templates/sub-01/ses-01/pet/sub-01_ses-01_recording-ManualFullExample_blood.tsv",
    "content": "time\tplasma_radioactivity\tmetabolite_parent_fraction\tmetabolite_polar_fraction\thplc_recovery_fractions\twhole_blood_radioactivity\n0\t0\t0\t0\t0\t0\n"
  },
  {
    "path": "templates/sub-01/ses-01/pet/sub-01_ses-01_recording-ManualShortExample_blood.json",
    "content": "{\n  \"PlasmaAvail\": \"\",\n  \"MetaboliteAvail\": \"\",\n  \"WholeBloodAvail\": \"\",\n  \"DispersionCorrected\": \"\",\n  \"MetaboliteMethod\": \"\",\n  \"MetaboliteRecoveryCorrectionApplied\": \"\",\n  \"time\": {\n    \"Description\": \"Time in relation to time zero defined by the _pet.json\",\n    \"Units\": \"s\"\n  },\n  \"metabolite_parent_fraction\": {\n    \"Description\": \"Parent fraction of the radiotracer.\",\n    \"Units\": \"unitless\"\n  }\n}\n"
  },
  {
    "path": "templates/sub-01/ses-01/pet/sub-01_ses-01_recording-ManualShortExample_blood.tsv",
    "content": "time\tmetabolite_parent_fraction\n0\t0\n"
  },
  {
    "path": "templates/sub-01/ses-01/pet/sub-01_ses-01_task-FullExample_pet.json",
    "content": "{\n  \"TaskName\": \"FullExample\",\n  \"Manufacturer\": \"\",\n  \"ManufacturersModelName\": \"\",\n  \"Units\": \"\",\n  \"InstitutionName\": \"\",\n  \"InstitutionAddress\": \"\",\n  \"InstitutionalDepartmentName\": \"\",\n  \"BodyPart\": \"\",\n  \"TracerName\": \"\",\n  \"TracerRadionuclide\": \"\",\n  \"InjectedRadioactivity\": \"\",\n  \"InjectedRadioactivityUnits\": \"\",\n  \"InjectedMass\": \"\",\n  \"InjectedMassUnits\": \"\",\n  \"SpecificRadioactivity\": \"\",\n  \"SpecificRadioactivityUnits\": \"\",\n  \"ModeOfAdministration\": \"\",\n  \"TracerRadLex\": \"\",\n  \"TracerSNOMED\": \"\",\n  \"TracerMolecularWeight\": \"\",\n  \"TracerMolecularUnits\": \"\",\n  \"InjectedMassPerWeight\": \"\",\n  \"InjectedMassPerWeightUnits\": \"\",\n  \"SpecificRadioactivityMeasTime\": \"\",\n  \"MolarActivity\": \"\",\n  \"MolarActivityUnits\": \"\",\n  \"MolarActivityMeasTime\": \"\",\n  \"InfusionRadioActivity\": \"\",\n  \"InfusionStart\": \"\",\n  \"InfusionSpeed\": \"\",\n  \"InfusionSpeedUnits\": \"\",\n  \"InjectedVolume\": \"\",\n  \"Purity\": \"\",\n  \"PharamceuticalName\": \"\",\n  \"PharmaceuticalDoseAmount\": [],\n  \"PharmaceuticalDoseUnits\": \"\",\n  \"PharmaceuticalDoseRegimen\": \"\",\n  \"PharmaceuticalDoseTime\": [],\n  \"Anaesthesia\": \"\",\n  \"TimeZero\": \"\",\n  \"ScanStart\": \"\",\n  \"InjectionStart\": \"\",\n  \"FrameTimesStart\": [],\n  \"FrameDuration\": [],\n  \"ScanDate\": \"\",\n  \"InjectionEnd\": \"\",\n  \"AcquisitionMode\": \"\",\n  \"ImageDecayCorrected\": \"\",\n  \"ImageDecayCorrectionTime\": \"\",\n  \"ReconMethodName\": \"\",\n  \"ReconMethodParameterLabels\": [],\n  \"ReconMethodParameterUnits\": [],\n  \"ReconMethodParameterValues\": [],\n  \"ReconFilterType\": [],\n  \"ReconFilterSize\": [],\n  \"AttenuationCorrection\": \"\",\n  \"ReconMethodImplementationVersion\": \"\",\n  \"AttenuationCorrectionMethodReference\": \"\",\n  \"ScaleFactor\": [],\n  \"ScatterFraction\": [],\n  \"DecayCorrectionFactor\": [],\n  \"PromptRate\": [],\n  \"RandomRate\": [],\n  \"SinglesRate\": []\n}\n"
  },
  {
    "path": "templates/sub-01/ses-01/pet/sub-01_ses-01_task-ShortExample_pet.json",
    "content": "{\n  \"TaskName\": \"ShortExample\",\n  \"Manufacturer\": \"\",\n  \"ManufacturersModelName\": \"\",\n  \"Units\": \"\",\n  \"TracerName\": \"\",\n  \"TracerRadionuclide\": \"\",\n  \"InjectedRadioactivity\": \"\",\n  \"InjectedRadioactivityUnits\": \"\",\n  \"InjectedMass\": \"\",\n  \"InjectedMassUnits\": \"\",\n  \"SpecificRadioactivity\": \"\",\n  \"SpecificRadioactivityUnits\": \"\",\n  \"ModeOfAdministration\": \"\",\n  \"TimeZero\": \"\",\n  \"ScanStart\": \"\",\n  \"InjectionStart\": \"\",\n  \"FrameTimesStart\": [],\n  \"FrameDuration\": [],\n  \"AcquisitionMode\": \"\",\n  \"ImageDecayCorrected\": \"\",\n  \"ImageDecayCorrectionTime\": \"\",\n  \"ReconMethodName\": \"\",\n  \"ReconMethodParameterLabels\": [],\n  \"ReconMethodParameterUnits\": [],\n  \"ReconMethodParameterValues\": [],\n  \"ReconFilterType\": [],\n  \"ReconFilterSize\": [],\n  \"AttenuationCorrection\": \"\"\n}\n"
  },
  {
    "path": "templates/sub-epilepsy01/ses-01/ieeg/sub-epilepsy01_ses-01_electrodes.json",
    "content": "{\n    \"name\": {\n        \"Description\": \"REQUIRED. Name of the electrode contact point.\"\n    },\n    \"x\": {\n        \"Description\": \"REQUIRED. X position. The positions of the center of each electrode in xyz space. Units are specified in space-<label>_coordsystem.json.\"\n    },\n    \"y\": {\n        \"Description\": \"REQUIRED. Y position.\"\n    },\n    \"z\": {\n        \"Description\": \"REQUIRED. Z position. If electrodes are in 2D space this should be a column of n/a values.\"\n    },\n    \"size\": {\n        \"Description\": \"REQUIRED. Surface area of the electrode, units MUST be in mm^2.\"\n    },\n    \"seizure_zone\": {\n        \"LongName\": \"Seizure onset zone\",\n        \"Description\": \"final conclusion drawn by an epileptologist on the electrodes involved in the seizures\",\n        \"Levels\": {\n            \"SOZ\": \"Seizure Onset Zone, the region where the recorded clinical seizures originated during the recording period.\",\n            \"IrritativeZone\": \"Region of cortex that generates interictal epileptiform discharges, but not seizures\",\n            \"EarlyPropagationZone\": \"Region of cortex that generates the initial seizure symptoms. Not seizure onset, but the propagation of seizure from SOZ into this region within first 3 seconds from seizure onset.\",\n            \"Resected\": \"Region of cortex that was resected\",\n            \"ResectedEdge\": \"Region of cortex that is within 1 cm of the edge of the resected area.\"\n        }\n    }\n}\n"
  },
  {
    "path": "templates/sub-epilepsy01/ses-01/ieeg/sub-epilepsy01_ses-01_electrodes.tsv",
    "content": "name\tx\ty\tz\tsize\tseizure_zone\nTO1\t0\t0\t0\t5\tNonSOZ\nTO2\t0\t0\t0\t5\tSOZ, Resected\n"
  }
]