├── .all-contributorsrc ├── .circleci └── config.yml ├── .codecov.yml ├── .codespell_dict ├── .codespellrc ├── .editorconfig ├── .git-blame-ignore-revs ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── blank.md │ ├── bug_report.yml │ ├── config.yml │ └── feature_request.yml ├── dependabot.yml ├── labeler.yml ├── pull_request_template.md └── workflows │ ├── changelog_generator.yml │ ├── labeler.yml │ ├── publish_schema.yml │ ├── redirect_circleci_artifacts.yml │ ├── schemacode_ci.yml │ ├── shellcheck.yml │ └── validation.yml ├── .gitignore ├── .mailmap ├── .pre-commit-config.yaml ├── .remarkrc ├── .tributors ├── .yamllint.yml ├── BIDS_logo ├── BIDS_logo.eps ├── BIDS_logo.jpg ├── BIDS_logo_black.svg ├── BIDS_logo_black_transparent_background_crop.png ├── BIDS_logo_white.svg ├── BIDS_logo_white_transparent_background_crop.png ├── README.md ├── bids-animated.webm └── favicon_package_v0.16.zip ├── CITATION.cff ├── CODEOWNERS ├── CONTRIBUTING.md ├── DECISION-MAKING.md ├── LICENSE ├── Maintainers_Guide.md ├── Makefile ├── README.md ├── Release_Guideline.md ├── Release_Protocol.md ├── commenting_images ├── BIDS_GitHub_mainpage.png ├── BIDS_comment.png ├── BIDS_comment_block.png ├── BIDS_file_comment.png ├── BIDS_pr.png ├── BIDS_pr_accept_comment.png ├── BIDS_pr_commit_batch.png ├── BIDS_pr_files_changed.png ├── BIDS_pr_list.png ├── BIDS_pr_reviewer_credit.png ├── BIDS_suggest.png ├── BIDS_suggest_change.png └── BIDS_suggest_text.png ├── macros_doc.md ├── mkdocs.yml ├── npm-requirements.txt ├── pdf_build_src ├── README.md ├── build_pdf.sh ├── check_pandoc_log.py ├── cover.tex ├── header.tex ├── header_setup.tex ├── metadata.yml ├── pandoc_script.py ├── process_markdowns.py ├── remove_admonitions.py ├── test_remove_admonitions.py └── tests │ └── data │ ├── expected │ ├── README.md │ └── modality-specific-files │ │ └── magnetic-resonance-imaging-data.md │ └── input │ ├── README.md │ └── modality-specific-files │ └── magnetic-resonance-imaging-data.md ├── readthedocs.yml ├── release_images ├── GH-release_1.png ├── GH-release_2.png ├── GH-release_3.png ├── GitHub_to_RTD_spec_rendering.png ├── Unreleased-to-Version.png ├── merge_commit.png ├── site_name_2dev-3.png ├── site_name_3-3dev.png ├── site_name_release_1.2-1.3dev.png └── site_name_release_1.2dev-1.2.png ├── requirements.txt ├── scripts └── test_tag ├── src ├── CHANGES.md ├── appendices │ ├── arterial-spin-labeling.md │ ├── contributors.md │ ├── coordinate-systems.md │ ├── cross-modality-correspondence.md │ ├── entities.md │ ├── entity-table.md │ ├── file-collections.md │ ├── hed.md │ ├── licenses.md │ ├── meg-file-formats.md │ ├── meg-systems.md │ ├── qmri.md │ ├── schema.md │ └── units.md ├── common-principles.md ├── css │ ├── tsv.css │ └── watermark.css ├── derivatives │ ├── common-data-types.md │ ├── imaging.md │ └── introduction.md ├── extensions.md ├── glossary.md ├── images │ ├── draft_watermark.png │ ├── draft_watermark_dark.png │ ├── favicon.png │ └── logo.png ├── index.md ├── introduction.md ├── js │ └── jquery-3.6.0.min.js ├── longitudinal-and-multi-site-studies.md ├── metaschema.json ├── modality-agnostic-files │ ├── code.md │ ├── data-summary-files.md │ ├── dataset-description.md │ └── phenotypic-and-assessment-data.md ├── modality-specific-files │ ├── behavioral-experiments.md │ ├── electroencephalography.md │ ├── genetic-descriptor.md │ ├── images │ │ ├── PET_scan_overview.png │ │ ├── PET_scan_overview.svg │ │ ├── asl_flowchart.png │ │ ├── asl_pasl_boluscutoff_false.png │ │ ├── asl_pasl_boluscutoff_true_q2tips.png │ │ ├── asl_pasl_boluscutoff_true_quipssII.png │ │ ├── asl_pcasl_labeling_pulses.png │ │ ├── asl_pcasl_sequence.png │ │ ├── ieeg_electrodes1.png │ │ ├── ieeg_electrodes2.png │ │ ├── microscopy_chunks1.png │ │ ├── microscopy_chunks2.png │ │ ├── microscopy_sem_overview.jpg │ │ └── sub-0001_ses-001_acq-NAS_photo.jpg │ ├── intracranial-electroencephalography.md │ ├── magnetic-resonance-imaging-data.md │ ├── magnetic-resonance-spectroscopy.md │ ├── magnetoencephalography.md │ ├── microscopy.md │ ├── motion.md │ ├── near-infrared-spectroscopy.md │ ├── physiological-recordings.md │ ├── positron-emission-tomography.md │ └── task-events.md ├── pregh-changes.md └── schema │ ├── BIDS_VERSION │ ├── README.md │ ├── SCHEMA_VERSION │ ├── meta │ ├── associations.yaml │ ├── context.yaml │ ├── expression_tests.yaml │ └── versions.yaml │ ├── objects │ ├── columns.yaml │ ├── common_principles.yaml │ ├── datatypes.yaml │ ├── entities.yaml │ ├── enums.yaml │ ├── extensions.yaml │ ├── files.yaml │ ├── formats.yaml │ ├── metadata.yaml │ ├── metaentities.yaml │ ├── modalities.yaml │ └── suffixes.yaml │ └── rules │ ├── checks │ ├── anat.yaml │ ├── asl.yaml │ ├── channels.yaml │ ├── common_derivatives.yaml │ ├── dataset.yaml │ ├── deprecations.yml │ ├── dwi.yaml │ ├── eeg.yaml │ ├── events.yaml │ ├── fmap.yaml │ ├── func.yaml │ ├── general.yaml │ ├── hints.yaml │ ├── ieeg.yaml │ ├── micr.yaml │ ├── mri.yaml │ ├── mrs.yaml │ ├── nifti.yaml │ ├── nirs.yaml │ ├── pet.yaml │ ├── phenotype.yaml │ ├── privacy.yaml │ └── references.yaml │ ├── common_principles.yaml │ ├── dataset_metadata.yaml │ ├── directories.yaml │ ├── entities.yaml │ ├── errors.yaml │ ├── files │ ├── common │ │ ├── core.yaml │ │ └── tables.yaml │ ├── deriv │ │ ├── imaging.yaml │ │ ├── preprocessed_data.yaml │ │ └── tables.yaml │ └── raw │ │ ├── anat.yaml │ │ ├── beh.yaml │ │ ├── channels.yaml │ │ ├── dwi.yaml │ │ ├── eeg.yaml │ │ ├── fmap.yaml │ │ ├── func.yaml │ │ ├── ieeg.yaml │ │ ├── meg.yaml │ │ ├── micr.yaml │ │ ├── motion.yaml │ │ ├── mrs.yaml │ │ ├── nirs.yaml │ │ ├── perf.yaml │ │ ├── pet.yaml │ │ ├── photo.yaml │ │ └── task.yaml │ ├── json │ ├── eeg.yaml │ ├── ieeg.yaml │ ├── meg.yaml │ └── nirs.yaml │ ├── metaentities.yaml │ ├── modalities.yaml │ ├── sidecars │ ├── anat.yaml │ ├── asl.yaml │ ├── beh.yaml │ ├── continuous.yaml │ ├── derivatives │ │ └── common_derivatives.yaml │ ├── dwi.yaml │ ├── eeg.yaml │ ├── entity_rules.yaml │ ├── events.yaml │ ├── fmap.yaml │ ├── func.yaml │ ├── ieeg.yaml │ ├── meg.yaml │ ├── micr.yaml │ ├── motion.yaml │ ├── mri.yaml │ ├── mrs.yaml │ ├── nirs.yaml │ ├── pet.yaml │ └── qmri.yaml │ └── tabular_data │ ├── derivatives │ └── common_derivatives.yaml │ ├── eeg.yaml │ ├── ieeg.yaml │ ├── meg.yaml │ ├── modality_agnostic.yaml │ ├── motion.yaml │ ├── nirs.yaml │ ├── perf.yaml │ ├── pet.yaml │ ├── physio.yaml │ └── task.yaml └── tools ├── .gitignore ├── add_contributors.py ├── entities_order.py ├── examplecode ├── __init__.py └── example.py ├── filetree_example.ipynb ├── make_changelog.py ├── mkdocs_macros_bids ├── __init__.py ├── macros.py └── main.py ├── new_contributors.tsv ├── no-bad-latin.py ├── no-bad-schema-paths.sh ├── print_contributors.py ├── pull_files.py ├── requirements.txt ├── schemacode ├── .readthedocs.yaml ├── JsonschemaValidator ├── LICENSE ├── README.md ├── docs │ ├── .gitignore │ ├── Makefile │ ├── _static │ │ ├── black_logo.svg │ │ └── white_logo.svg │ ├── _templates │ │ └── module.rst │ ├── api.rst │ ├── conf.py │ ├── description.md │ ├── index.rst │ ├── make.bat │ └── requirements.txt ├── pdm_build.py ├── pyproject.toml ├── src │ └── bidsschematools │ │ ├── __init__.py │ │ ├── __main__.py │ │ ├── conftest.py │ │ ├── data │ │ ├── __init__.py │ │ ├── metaschema.json │ │ ├── schema │ │ └── tests │ │ │ └── test_rules.py │ │ ├── expressions.py │ │ ├── py.typed │ │ ├── render │ │ ├── __init__.py │ │ ├── tables.py │ │ ├── text.py │ │ ├── tsv.py │ │ └── utils.py │ │ ├── rules.py │ │ ├── schema.py │ │ ├── tests │ │ ├── __init__.py │ │ ├── data │ │ │ ├── __init__.py │ │ │ ├── broken_dataset_description.json │ │ │ └── expected_bids_validator_xs_write.log │ │ ├── test_expressions.py │ │ ├── test_make_testdata.py │ │ ├── test_render_tables.py │ │ ├── test_render_text.py │ │ ├── test_render_utils.py │ │ ├── test_rules.py │ │ ├── test_schema.py │ │ ├── test_utils.py │ │ └── test_validator.py │ │ ├── types │ │ ├── __init__.py │ │ └── namespace.py │ │ ├── utils.py │ │ └── validator.py └── tests │ └── data │ └── .gitignore └── typescript ├── .gitignore ├── README.md ├── build-schema-types.ts ├── generate.test.ts └── generate.ts /.codecov.yml: -------------------------------------------------------------------------------- 1 | ignore: 2 | - "*/*/tests/*" 3 | - "**/tests/*" 4 | codecov: 5 | token: 7e84a7fb-8f7e-45f5-8dcc-9f5219fa3855 6 | -------------------------------------------------------------------------------- /.codespell_dict: -------------------------------------------------------------------------------- 1 | sub-directory->subdirectory 2 | Sub-directory->Subdirectory 3 | sub-directories->subdirectories 4 | Sub-directories->Subdirectories 5 | file name->filename 6 | File name->Filename 7 | file names->filenames 8 | File names->Filenames 9 | folder->directory 10 | Folder->Directory 11 | Folders->Directories 12 | -------------------------------------------------------------------------------- /.codespellrc: -------------------------------------------------------------------------------- 1 | [codespell] 2 | skip = *.js,*.svg,*.eps,.git,node_modules,env,venv,.mypy_cache,package-lock.json,CITATION.cff,tools/new_contributors.tsv,./tools/schemacode/docs/build,venvs 3 | ignore-regex = \bHEP\b 4 | ignore-words-list = acknowledgements,als,bu,fo,te,weill,winn 5 | builtin = clear,rare,en-GB_to_en-US 6 | # this overloads default dictionaries and I have not yet figured out 7 | # how to have multiple https://github.com/codespell-project/codespell/issues/2727 8 | # dictionary = .codespell_dict 9 | exclude-file = src/CHANGES.md 10 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.yaml] 2 | max_line_length = 120 3 | indent_style = space 4 | indent_size = 2 5 | insert_final_newline = true 6 | quote_type = single 7 | -------------------------------------------------------------------------------- /.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | # 2022-08-19 12:59:40 -0400 - markiewicz@stanford.edu - [git-blame-ignore-rev] prettified schema files. 2 | aaccb5ffc10e7f9460bbe9eb8c246872de167543 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | *.png -text 3 | *.jpg -text 4 | *.webm -text 5 | tools/schemacode/schemacode/_version.py export-subst 6 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/blank.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Blank issue 3 | about: Create an issue without a template. 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | --- 8 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: Bug report 2 | 3 | # See the json schema to help you create / update this form 4 | # https://json.schemastore.org/github-issue-forms.json 5 | 6 | description: Create a report to help us improve 7 | 8 | title: "[BUG] " 9 | 10 | labels: ["bug"] 11 | 12 | body: 13 | 14 | - type: markdown 15 | attributes: 16 | value: | 17 | Please use the [NeuroStars forum](https://neurostars.org/) to ask (and answer) 18 | concrete technical questions or about implementation details around BIDS. 19 | 20 | Please use the [BIDS mailing list](https://groups.google.com/forum/#!forum/bids-discussion), 21 | for announcements, and to draw attention to any item related to BIDS 22 | 23 | - type: textarea 24 | attributes: 25 | label: Describe your problem in detail. 26 | 27 | - type: textarea 28 | attributes: 29 | label: Describe what you expected. 30 | 31 | - type: textarea 32 | attributes: 33 | label: BIDS specification section 34 | description: Provide a link to the part of the BIDS specification that is relevant. 35 | value: https://bids-specification.readthedocs.io/en/latest/... 36 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: BIDS NeuroStars forum 4 | url: https://neurostars.org/ 5 | about: Ask (and answer) concrete technical questions or about implementation details around BIDS. 6 | - name: BIDS mailing list 7 | url: https://groups.google.com/forum/#!forum/bids-discussion 8 | about: Use the BIDS mailing list for announcements, and to draw attention to any item related to BIDS 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: Feature request 2 | 3 | # See the json schema to help you create / update this form 4 | # https://json.schemastore.org/github-issue-forms.json 5 | 6 | description: Suggest an idea for this project 7 | 8 | body: 9 | 10 | - type: markdown 11 | attributes: 12 | value: | 13 | - Have you checked our [contributing guide](https://github.com/bids-standard/bids-specification/blob/master/CONTRIBUTING.md)? 14 | It's a helpful resource. 15 | 16 | - Is your idea backwards compatible? 17 | If not, please open an issue in the [bids-2-devel repository](https://github.com/bids-standard/bids-2-devel) instead. 18 | 19 | - Is there already a group working on your idea? 20 | Check the [BIDS extension proposals](https://bids.neuroimaging.io/extensions/index.html) 21 | 22 | - Will your idea potentially require a large effort? 23 | Read [BEP lead guidelines](https://docs.google.com/document/d/1pWmEEY-1-WuwBPNy5tDAxVJYQ9Een4hZJM06tQZg8X4/). 24 | 25 | 26 | - type: textarea 27 | attributes: 28 | label: Your idea 29 | description: When you suggest your idea, please try to supply (mock) examples! 30 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # Documentation 2 | # https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file 3 | version: 2 4 | updates: 5 | - package-ecosystem: "github-actions" 6 | directory: "/" 7 | schedule: 8 | interval: "weekly" 9 | labels: 10 | - "exclude-from-changelog" 11 | -------------------------------------------------------------------------------- /.github/labeler.yml: -------------------------------------------------------------------------------- 1 | # labeler "full" schema 2 | # https://github.com/marketplace/actions/auto-labeler 3 | 4 | # enable labeler on issues, prs, or both. 5 | enable: 6 | issues: false 7 | prs: true 8 | # comments object allows you to specify a different message for issues and prs 9 | 10 | comments: 11 | prs: | 12 | I have applied any labels matching special text in your title and description. 13 | 14 | Please review the labels and make any necessary changes. 15 | 16 | # Labels is an object where: 17 | # - keys are labels 18 | # - values are objects of { include: [ pattern ], exclude: [ pattern ] } 19 | # - pattern must be a valid regex, and is applied globally to 20 | # title + description of issues and/or prs (see enabled config above) 21 | # - 'include' patterns will associate a label if any of these patterns match 22 | # - 'exclude' patterns will ignore this label if any of these patterns match 23 | labels: 24 | exclude-from-changelog: 25 | include: 26 | - 'pre-commit\.ci' 27 | exclude: [] 28 | -------------------------------------------------------------------------------- /.github/workflows/labeler.yml: -------------------------------------------------------------------------------- 1 | name: "Label PRs" 2 | # See https://github.com/marketplace/actions/auto-labeler 3 | 4 | on: 5 | 6 | pull_request_target: 7 | types: [opened] 8 | 9 | jobs: 10 | 11 | labeler: 12 | runs-on: ubuntu-latest 13 | 14 | if: github.repository_owner == 'bids-standard' 15 | 16 | steps: 17 | - name: Check Labels 18 | id: labeler 19 | uses: jimschubert/labeler-action@v2 20 | with: 21 | GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} 22 | -------------------------------------------------------------------------------- /.github/workflows/redirect_circleci_artifacts.yml: -------------------------------------------------------------------------------- 1 | on: [status] 2 | 3 | jobs: 4 | circleci_artifacts_redirector_job: 5 | runs-on: ubuntu-latest 6 | if: "${{ startsWith(github.event.context, 'ci/circleci: build_docs_pdf') }}" 7 | permissions: 8 | statuses: write 9 | name: Run CircleCI artifacts redirector 10 | steps: 11 | - name: GitHub Action step 12 | uses: larsoner/circleci-artifacts-redirector-action@master 13 | with: 14 | repo-token: ${{ secrets.GITHUB_TOKEN }} 15 | api-token: ${{ secrets.CIRCLECI_TOKEN }} 16 | artifact-path: 0/bids-spec.pdf 17 | circleci-jobs: build_docs_pdf 18 | job-title: Check the rendered PDF version here! 19 | -------------------------------------------------------------------------------- /.github/workflows/shellcheck.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Shellcheck 3 | 4 | on: 5 | push: 6 | branches: [master] 7 | pull_request: 8 | branches: [master] 9 | 10 | permissions: 11 | contents: read 12 | 13 | jobs: 14 | shellcheck: 15 | name: Check shell scripts 16 | runs-on: ubuntu-latest 17 | 18 | steps: 19 | - name: Checkout 20 | uses: actions/checkout@v4 21 | - name: Install dependencies 22 | run: | 23 | sudo apt update && sudo apt install -y shellcheck 24 | - name: shellcheck 25 | run: | 26 | git grep -l '^#\( *shellcheck \|!\(/bin/\|/usr/bin/env \)\(sh\|bash\|dash\|ksh\)\)' | xargs shellcheck 27 | -------------------------------------------------------------------------------- /.github/workflows/validation.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Validation 3 | 4 | on: 5 | push: 6 | branches: [master] 7 | pull_request: 8 | branches: [master] 9 | 10 | concurrency: 11 | group: ${{ github.workflow }}-${{ github.ref }} 12 | cancel-in-progress: true 13 | 14 | jobs: 15 | # Check for common misspellings 16 | codespell: 17 | runs-on: ubuntu-latest 18 | steps: 19 | - uses: actions/checkout@v4 20 | - uses: codespell-project/actions-codespell@master 21 | 22 | # Markdown formatting 23 | remark: 24 | runs-on: ubuntu-latest 25 | steps: 26 | - uses: actions/checkout@v4 27 | - uses: actions/setup-node@v4 28 | with: 29 | node-version: 22 30 | - name: Install dependencies 31 | run: npm install `cat npm-requirements.txt` 32 | - name: Run style checks 33 | run: npx remark src/**/*.md --frail --rc-path .remarkrc 34 | 35 | # YAML 36 | yamllint: 37 | runs-on: ubuntu-latest 38 | steps: 39 | - uses: actions/checkout@v4 40 | - uses: astral-sh/setup-uv@v6 41 | - name: Lint yml files in src/schema 42 | run: uvx yamllint -f standard src/schema/ -c .yamllint.yml 43 | 44 | # Python best practices 45 | python-style: 46 | runs-on: ubuntu-latest 47 | steps: 48 | - uses: actions/checkout@v4 49 | - uses: astral-sh/setup-uv@v6 50 | - run: uvx ruff format --diff 51 | - run: uvx ruff check 52 | 53 | # Avoid Latin phrases to improve readability 54 | latin-phrases: 55 | runs-on: ubuntu-latest 56 | steps: 57 | - uses: actions/checkout@v4 58 | - uses: astral-sh/setup-uv@v6 59 | - name: Check for Latin phrases 60 | run: uv run tools/no-bad-latin.py 61 | 62 | # Validate CITATION.cff 63 | validate_cff: 64 | runs-on: ubuntu-latest 65 | steps: 66 | - uses: actions/checkout@v4 67 | - uses: astral-sh/setup-uv@v6 68 | - name: Validate CITATION.cff 69 | run: uvx cffconvert --validate 70 | -------------------------------------------------------------------------------- /.mailmap: -------------------------------------------------------------------------------- 1 | Adam Li 2 | 3 | Thomas Nichols 4 | Thomas Nichols 5 | Thomas Nichols 6 | 7 | Chris Gorgolewski 8 | Chris Gorgolewski 9 | Chris Gorgolewski 10 | Chris Gorgolewski 11 | 12 | Christopher J. Markiewicz 13 | Christopher J. Markiewicz 14 | Christopher J. Markiewicz 15 | 16 | Franklin Feingold 17 | Franklin Feingold <35307458+franklin-feingold@users.noreply.github.com> 18 | 19 | Satrajit Ghosh 20 | Satrajit Ghosh 21 | 22 | Remi Gau 23 | Remi Gau <6961185+Remi-Gau@users.noreply.github.com> 24 | 25 | Horea Christian 26 | Horea Christian 27 | 28 | Franco Pestilli 29 | Franco Pestilli <2119795+francopestilli@users.noreply.github.com> 30 | 31 | Chris Holdgraf 32 | Chris Holdgraf 33 | 34 | Alex Rockhill 35 | Alex Rockhill Alex 36 | 37 | Cyril Pernet 38 | Cyril Pernet 39 | 40 | Dora Hermes 41 | Dora Hermes Dora 42 | 43 | Oscar Esteban 44 | 45 | bids-maintenance 46 | bids-maintenance Changelog-bot 47 | 48 | Agah Karakuzu 49 | 50 | Wouter Potters 51 | 52 | Hugo Boniface 53 | 54 | Jose Manuel Saborit Torres 55 | 56 | Matt Sanderson 57 | 58 | Melanie Ganz 59 | 60 | Kay Robbins <1189050+VisLab@users.noreply.github.com> 61 | 62 | Patrick Park 63 | 64 | Ezequiel Mikulan 65 | 66 | Guillaume Flandin 67 | 68 | Dimitri Papadopoulos Orfanos <3234522+DimitriPapadopoulos@users.noreply.github.com> 69 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | # See https://pre-commit.com for more information 2 | # See https://pre-commit.com/hooks.html for more hooks 3 | ci: 4 | skip: [shellcheck] 5 | exclude: 'tools/schemacode/src/bidsschematools/tests/data/broken_dataset_description.json' 6 | repos: 7 | - repo: https://github.com/pre-commit/pre-commit-hooks 8 | rev: v5.0.0 9 | hooks: 10 | - id: trailing-whitespace 11 | - id: end-of-file-fixer 12 | - id: check-yaml 13 | args: [--unsafe] 14 | - id: check-json 15 | - id: check-toml 16 | - id: check-ast 17 | - id: check-added-large-files 18 | - id: check-case-conflict 19 | - repo: https://github.com/python-jsonschema/check-jsonschema 20 | rev: 0.33.0 21 | hooks: 22 | - id: check-dependabot 23 | - id: check-github-workflows 24 | args: ["--verbose"] 25 | - id: check-metaschema 26 | files: src/metaschema.json 27 | - id: check-readthedocs 28 | files: readthedocs.yml 29 | - repo: https://github.com/pre-commit/mirrors-prettier 30 | rev: v4.0.0-alpha.8 31 | hooks: 32 | - id: prettier 33 | entry: env PRETTIER_LEGACY_CLI=1 prettier # temporary fix for https://github.com/prettier/prettier/issues/15742 34 | files: src/schema/.*/.*\.yaml 35 | - repo: https://github.com/adrienverge/yamllint 36 | rev: v1.37.1 37 | hooks: 38 | - id: yamllint 39 | args: [-f=standard, -c=.yamllint.yml] 40 | files: src/schema/.*/.*\.yaml 41 | - repo: https://github.com/ComPWA/taplo-pre-commit 42 | rev: v0.9.3 43 | hooks: 44 | - id: taplo-format 45 | args: [-o, 'array_auto_collapse=false'] 46 | - repo: https://github.com/codespell-project/codespell 47 | rev: v2.4.1 48 | hooks: 49 | - id: codespell 50 | args: ["--config=.codespellrc", "--dictionary=-", "--dictionary=.codespell_dict"] 51 | - repo: https://github.com/pre-commit/mirrors-mypy 52 | rev: v1.16.0 53 | hooks: 54 | - id: mypy 55 | # Sync with project.optional-dependencies.typing 56 | additional_dependencies: 57 | - acres 58 | - click 59 | - markdown-it-py 60 | - pandas-stubs 61 | - pyparsing 62 | - pytest 63 | - types-PyYAML 64 | - types-tabulate 65 | - types-jsonschema 66 | - jsonschema 67 | - httpx 68 | args: ["tools/schemacode/src"] 69 | pass_filenames: false 70 | - repo: https://github.com/koalaman/shellcheck-precommit 71 | rev: v0.10.0 72 | hooks: 73 | - id: shellcheck 74 | -------------------------------------------------------------------------------- /.remarkrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "preset-lint-markdown-style-guide", 4 | "preset-lint-recommended", 5 | "remark-gfm", 6 | ["lint-no-duplicate-headings", false], 7 | ["lint-list-item-indent", "tab"], 8 | ["lint-emphasis-marker", "consistent"], 9 | ["lint-maximum-line-length", false], 10 | ["lint-maximum-heading-length", false], 11 | ["lint-no-shortcut-reference-link", false], 12 | ["lint-no-trailing-spaces"], 13 | ["remark-lint-code-block-style", false], 14 | ["lint-no-undefined-references", false] 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /.yamllint.yml: -------------------------------------------------------------------------------- 1 | extends: default 2 | 3 | rules: 4 | line-length: 5 | max: 120 6 | indentation: 7 | # See https://github.com/yaml/pyyaml/issues/545 for why 8 | spaces: 2 9 | indent-sequences: true 10 | comments: 11 | level: error 12 | min-spaces-from-content: 1 13 | -------------------------------------------------------------------------------- /BIDS_logo/BIDS_logo.eps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bids-standard/bids-specification/d776b638899ae16fba673a2d597a0844eec2ee64/BIDS_logo/BIDS_logo.eps -------------------------------------------------------------------------------- /BIDS_logo/BIDS_logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bids-standard/bids-specification/d776b638899ae16fba673a2d597a0844eec2ee64/BIDS_logo/BIDS_logo.jpg -------------------------------------------------------------------------------- /BIDS_logo/BIDS_logo_black_transparent_background_crop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bids-standard/bids-specification/d776b638899ae16fba673a2d597a0844eec2ee64/BIDS_logo/BIDS_logo_black_transparent_background_crop.png -------------------------------------------------------------------------------- /BIDS_logo/BIDS_logo_white_transparent_background_crop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bids-standard/bids-specification/d776b638899ae16fba673a2d597a0844eec2ee64/BIDS_logo/BIDS_logo_white_transparent_background_crop.png -------------------------------------------------------------------------------- /BIDS_logo/README.md: -------------------------------------------------------------------------------- 1 | # BIDS logo 2 | 3 | The BIDS logo originates from a 4 | [design competition](https://en.99designs.de/logo-design/contests/design-brain-imaging-data-standard-logo-916110). 5 | 6 | See the related discussion here: https://github.com/bids-standard/bids-specification/issues/216 7 | 8 | All static versions of the logo are shared under a CC BY 4.0 license, see 9 | [LICENSE](../LICENSE) 10 | in the root of the repository. 11 | 12 | The animated version of the logo is shared under a CC BY-SA 4.0 license, 13 | copyright Adina Wagner, 14 | please see the source: 15 | [github.com/adswa/animated-bids-logo](https://github.com/adswa/animated-bids-logo). 16 | 17 | # Files 18 | 19 | - Standard formats 20 | - `BIDS_logo.jpg` 21 | - Transparent background 22 | - `BIDS_logo_black_transparent_background_crop.png` 23 | - `BIDS_logo_white_transparent_background_crop.png` 24 | - Vector graphics 25 | - `BIDS_logo.eps` 26 | - Transparent background 27 | - `BIDS_logo_black.svg` 28 | - `BIDS_logo_white.svg` 29 | - Animated logo 30 | - `bids_animated.webm` 31 | -------------------------------------------------------------------------------- /BIDS_logo/bids-animated.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bids-standard/bids-specification/d776b638899ae16fba673a2d597a0844eec2ee64/BIDS_logo/bids-animated.webm -------------------------------------------------------------------------------- /BIDS_logo/favicon_package_v0.16.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bids-standard/bids-specification/d776b638899ae16fba673a2d597a0844eec2ee64/BIDS_logo/favicon_package_v0.16.zip -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | # This files DOES NOT list people responsible for maintenance of different parts of 2 | # the specification. It merely serves the purpose of notifying interested 3 | # contributors when a new Pull Request that proposes changes to a particular file 4 | # is submitted. If you would like to subscribe to such notifications (in a form of a 5 | # Request for Review) please add your GitHub username next to the file you want to 6 | # monitor below. 7 | 8 | # Individual sections 9 | /src/common-principles.md @chrisgorgo @DimitriPapadopoulos 10 | /src/modality-specific-files/magnetic-resonance-imaging-data.md @chrisgorgo 11 | /src/modality-specific-files/electroencephalography.md @sappelhoff @ezemikulan 12 | /src/modality-specific-files/intracranial-electroencephalography.md @ezemikulan 13 | /src/derivatives/imaging.md @effigies 14 | /src/derivatives/structural-derivatives.md @edickie @ahoopes 15 | /src/derivatives/functional-derivatives.md @effigies 16 | /src/derivatives/diffusion-derivatives.md @francopestilli @oesteban @Lestropie 17 | 18 | # The schema 19 | /src/schema/ @erdalkaraca 20 | /tools/schemacode/ @erdalkaraca 21 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: tools/contributors.tsv 2 | 3 | validate_citation_cff: CITATION.cff 4 | cffconvert --validate 5 | 6 | update_contributors: 7 | python tools/add_contributors.py 8 | python tools/print_contributors.py 9 | yarn all-contributors generate 10 | 11 | runprettier: 12 | prettier --write "src/schema/**/*.yaml" 13 | python3 -m yamllint -f standard src/schema/ -c .yamllint.yml 14 | 15 | SCHEMA_CHANGES := $(shell git diff --name-only | grep src/schema/*.yaml) 16 | 17 | commitschema: 18 | @echo SCHEMA_CHANGES $(SCHEMA_CHANGES) 19 | git add src/schema/*.yaml && \ 20 | git commit -m "[git-blame-ignore-rev] prettified schema files." && \ 21 | git log --grep "\[git-blame-ignore-rev\]" --pretty=format:"# %ai - %ae - %s%n%H" >> .git-blame-ignore-revs \ 22 | || true 23 | 24 | formatschema: runprettier commitschema 25 | 26 | all: 27 | 28 | .PHONY: runprettier commitschema 29 | -------------------------------------------------------------------------------- /Release_Guideline.md: -------------------------------------------------------------------------------- 1 | # Release Guidelines 2 | 3 | This document captures guidelines to follow when considering a new release of the BIDS specification. 4 | 5 | ## Background 6 | 7 | BIDS has generally followed a semantic versioning (semver) approach. 8 | The canonical semver text can be found at https://semver.org/, and an adaptation to documents can be found at https://semverdoc.org/. 9 | A specification falls somewhere between these two, as documentation does not require 10 | backwards compatibility, while software has notions of bugs and features which do not 11 | map to the reasons for updating a specification. 12 | 13 | In both cases, edition numbers are specified as MAJOR.MINOR.PATCH, and the difference is in the rules for incrementing each edition number. 14 | 15 | In BIDS, we have considered a major release version (the next being 2.0.0) to indicate 16 | backwards-incompatible changes, while minor and patch releases must be backwards compatible. 17 | 18 | ## Guidelines 19 | 20 | Once a decision for a release has been established, the rules of [decision-making](DECISION-MAKING.md) 21 | govern the mechanism of doing the release, meaning, waiting 5 business days and obtaining 22 | the approval of at least one maintainer before merging. 23 | 24 | ### Minor (1.X.0) releases 25 | 26 | A minor release should be made when a BEP (BIDS Extension Proposal) has been merged into the 27 | specification. 28 | The BIDS Maintainers have discretion to identify other cases justifying a minor release. 29 | 30 | ### Patch (1.X.Y) releases 31 | 32 | Patch releases will generally be more frequent, and indicate less significant changes to the specification. 33 | The following is a non-exhaustive set of justifications for a patch release: 34 | 35 | - A modality field has changed and the [bids-validator](https://github.com/bids-standard/bids-validator) has been updated to reflect this change. 36 | - Links or information in the specification are no longer accurate, for example if a BEP document is added or moved 37 | - The rendering of the [specification](https://bids-specification.readthedocs.io/en/stable/) has changed 38 | - A metadata field or file type is added at the request of a curator attempting to release BIDS-compliant data 39 | 40 | Ultimately, all releases are a matter of maintainer discretion, but patch release frequency should 41 | balance community needs for stability and responsiveness. 42 | -------------------------------------------------------------------------------- /commenting_images/BIDS_GitHub_mainpage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bids-standard/bids-specification/d776b638899ae16fba673a2d597a0844eec2ee64/commenting_images/BIDS_GitHub_mainpage.png -------------------------------------------------------------------------------- /commenting_images/BIDS_comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bids-standard/bids-specification/d776b638899ae16fba673a2d597a0844eec2ee64/commenting_images/BIDS_comment.png -------------------------------------------------------------------------------- /commenting_images/BIDS_comment_block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bids-standard/bids-specification/d776b638899ae16fba673a2d597a0844eec2ee64/commenting_images/BIDS_comment_block.png -------------------------------------------------------------------------------- /commenting_images/BIDS_file_comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bids-standard/bids-specification/d776b638899ae16fba673a2d597a0844eec2ee64/commenting_images/BIDS_file_comment.png -------------------------------------------------------------------------------- /commenting_images/BIDS_pr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bids-standard/bids-specification/d776b638899ae16fba673a2d597a0844eec2ee64/commenting_images/BIDS_pr.png -------------------------------------------------------------------------------- /commenting_images/BIDS_pr_accept_comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bids-standard/bids-specification/d776b638899ae16fba673a2d597a0844eec2ee64/commenting_images/BIDS_pr_accept_comment.png -------------------------------------------------------------------------------- /commenting_images/BIDS_pr_commit_batch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bids-standard/bids-specification/d776b638899ae16fba673a2d597a0844eec2ee64/commenting_images/BIDS_pr_commit_batch.png -------------------------------------------------------------------------------- /commenting_images/BIDS_pr_files_changed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bids-standard/bids-specification/d776b638899ae16fba673a2d597a0844eec2ee64/commenting_images/BIDS_pr_files_changed.png -------------------------------------------------------------------------------- /commenting_images/BIDS_pr_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bids-standard/bids-specification/d776b638899ae16fba673a2d597a0844eec2ee64/commenting_images/BIDS_pr_list.png -------------------------------------------------------------------------------- /commenting_images/BIDS_pr_reviewer_credit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bids-standard/bids-specification/d776b638899ae16fba673a2d597a0844eec2ee64/commenting_images/BIDS_pr_reviewer_credit.png -------------------------------------------------------------------------------- /commenting_images/BIDS_suggest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bids-standard/bids-specification/d776b638899ae16fba673a2d597a0844eec2ee64/commenting_images/BIDS_suggest.png -------------------------------------------------------------------------------- /commenting_images/BIDS_suggest_change.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bids-standard/bids-specification/d776b638899ae16fba673a2d597a0844eec2ee64/commenting_images/BIDS_suggest_change.png -------------------------------------------------------------------------------- /commenting_images/BIDS_suggest_text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bids-standard/bids-specification/d776b638899ae16fba673a2d597a0844eec2ee64/commenting_images/BIDS_suggest_text.png -------------------------------------------------------------------------------- /npm-requirements.txt: -------------------------------------------------------------------------------- 1 | remark-cli@12 2 | remark-gfm@4 3 | remark-preset-lint-recommended@7 4 | remark-preset-lint-markdown-style-guide@6 5 | remark-lint-no-trailing-spaces@2 6 | -------------------------------------------------------------------------------- /pdf_build_src/README.md: -------------------------------------------------------------------------------- 1 | # pdf-version of BIDS specification 2 | 3 | The `pdf_build_src` directory contains the scripts and `.tex` files required to build a pdf document of the BIDS specification from multiple markdown files using the pandoc library. 4 | 5 | [Pandoc](https://pandoc.org/index.html) is command line tool which is also a Haskell library that converts files from one markup format to another. 6 | 7 | ## Requirements 8 | 9 | For the pdf build to be successful, the following need to be installed: 10 | 11 | - Python 3.6 or higher 12 | - several Python packages (see `/requirements.txt`) 13 | - pandoc 14 | - Latest version of LaTeX: By default, Pandoc creates PDFs using LaTeX. 15 | Because a full MacTeX installation uses four gigabytes of disk space, 16 | pandoc recommends BasicTeX or TinyTeX and using the tlmgr tool to install additional packages as needed. 17 | - The [Symbola font](https://packages.ubuntu.com/search?keywords=fonts-symbola) that provides all emoji unicodes necessary to render the contributor icons in the PDF 18 | 19 | Installation instructions for both pandoc and LaTeX: https://pandoc.org/installing.html 20 | 21 | ## Building pdf document 22 | 23 | Run the `build_pdf.sh` from the `pdf_build_src` with the command `sh build_pdf.sh` from the command line terminal 24 | 25 | ## Technical Overview 26 | 27 | Pandoc comes with a plethora of options to format the resulting document. 28 | For building a pdf from multiple markdowns, a consolidated intermediate tex file is first built, 29 | which is then converted to a pdf document. 30 | To achieve the desired formatting in the final pdf, 31 | additional tex files are used with options offered by pandoc. 32 | 33 | ### Formatting files 34 | 35 | - `metadata.yml` - Contains formatting options for the PDF. 36 | 37 | - `header_setup.tex` - This file sets up the packages to suit our needs. 38 | 39 | - `cover.tex` - BIDS Logo is used as a cover page for the document. `cover.tex` is used with the option `--include-before-body` 40 | 41 | - `header.tex` - Header tex file that's updated with the latest version number and date when `build_pdf.sh` is run. Used with the `-include-in-header` (or `-H`) option. 42 | 43 | ### Scripts 44 | 45 | - `process_markdowns.py` - Script that processes markdown files in the `src` directory that are duplicated and modified for the needs of the pdf. 46 | 47 | - `pandoc_script.py` - Prepares and runs the final pandoc command through the `build_pdf.sh` script 48 | 49 | - `build_pdf.sh` - Shell script that organizes the directory structure and runs the above two python scripts 50 | 51 | - `check_pandoc_log.py` - Script that checks the pandoc log for warnings that should be raised as errors in the continuous integration services 52 | -------------------------------------------------------------------------------- /pdf_build_src/build_pdf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Shell script that runs process_markdowns.py and pandoc_script.py in sequence to build the pdf document 3 | 4 | set -eu 5 | 6 | # prepare the copied src directory 7 | python3 process_markdowns.py 8 | 9 | # copy pandoc_script into the temp src_copy directory 10 | cp pandoc_script.py header.tex cover.tex header_setup.tex src_copy/src 11 | 12 | # run pandoc_script from src_copy directory 13 | pushd src_copy/src 14 | python3 pandoc_script.py 15 | mv bids-spec.pdf ../.. 16 | mv bids-spec_pandoc_log.json ../.. 17 | popd 18 | 19 | # Do a check on the pandoc log file 20 | python3 check_pandoc_log.py 21 | 22 | # delete the duplicated src directory 23 | rm -rf src_copy 24 | -------------------------------------------------------------------------------- /pdf_build_src/check_pandoc_log.py: -------------------------------------------------------------------------------- 1 | """Inspect the pandoc log for warnings that should be raised as errors.""" 2 | 3 | # %% 4 | import json 5 | 6 | # see pandoc_script.py 7 | LOGFILE = "bids-spec_pandoc_log.json" 8 | 9 | # read the log file 10 | with open(LOGFILE, "r") as fin: 11 | logs = json.load(fin) 12 | 13 | # go through the logs (list of dicts) 14 | duplicate_link_refs = [] 15 | for log_dict in logs: 16 | # Check for DuplicateLinkReference 17 | logtype = log_dict.get("type", None) 18 | logverbosity = log_dict.get("verbosity", None) 19 | 20 | if logtype == "DuplicateLinkReference" and logverbosity == "WARNING": 21 | duplicate_link_refs.append(log_dict) 22 | 23 | # raise errors if appropriate 24 | if len(duplicate_link_refs) > 0: 25 | msg = "\n\nFound duplicate link references. Please make them unique.\n" 26 | for log_dict in duplicate_link_refs: 27 | msg += "\n" + json.dumps(log_dict, indent=4) 28 | raise RuntimeError(msg) 29 | -------------------------------------------------------------------------------- /pdf_build_src/cover.tex: -------------------------------------------------------------------------------- 1 | % adds the bids logo as the cover page of the pdf 2 | \begin{titlepage} 3 | 4 | \newcommand{\HRule}{\rule{\linewidth}{0.5mm}} % Defines a new command for the horizontal lines, change thickness here 5 | 6 | \center % Center everything on the page 7 | 8 | 9 | 10 | %---------------------------------------------------------------------------------------- 11 | % LOGO SECTION 12 | %---------------------------------------------------------------------------------------- 13 | 14 | \includegraphics[width=0.6\textwidth]{images/BIDS_logo.jpg}\\[-5cm] 15 | 16 | %---------------------------------------------------------------------------------------- 17 | % TITLE SECTION 18 | %---------------------------------------------------------------------------------------- 19 | 20 | \HRule \\[0.4cm] 21 | { \huge \bfseries Brain Imaging Data Structure Specification}\\[0.4cm] % Title of your document 22 | \HRule \\[1.5cm] 23 | 24 | % \vfill % Fill the rest of the page with whitespace 25 | % \textsc{\large v1.2.1}\\[0.5cm]{\large 2019-08-14}\\[2cm]\vfill\end{titlepage} 26 | -------------------------------------------------------------------------------- /pdf_build_src/header.tex: -------------------------------------------------------------------------------- 1 | % DO NOT EDIT THE 4 LINES BELOW THIS LINE (see `add_header` in process_markdowns.py) 2 | \usepackage{fancyhdr} 3 | \pagestyle{fancy} 4 | \fancyhf{} 5 | \fancyhead[L]{ Brain Imaging Data Structure v1.4.1-dev 2020-09-16 } 6 | % Edit from here below 7 | \fancyfoot[L]{\thepage} 8 | -------------------------------------------------------------------------------- /pdf_build_src/header_setup.tex: -------------------------------------------------------------------------------- 1 | \usepackage{fontspec} 2 | \setmainfont{Symbola} 3 | 4 | \usepackage[a4paper,margin=0.75in,landscape]{geometry} 5 | 6 | \rowcolors{1}{}{gray!10} 7 | -------------------------------------------------------------------------------- /pdf_build_src/metadata.yml: -------------------------------------------------------------------------------- 1 | --- 2 | documentclass: report 3 | classoption: table 4 | colorlinks: true 5 | linkcolor: blue 6 | toc: true 7 | listings: true 8 | ... 9 | -------------------------------------------------------------------------------- /pdf_build_src/pandoc_script.py: -------------------------------------------------------------------------------- 1 | """Use the pandoc library as a final step to build the pdf. 2 | 3 | This is done once the duplicate src directory is processed. 4 | """ 5 | 6 | import subprocess 7 | import yaml 8 | from pathlib import Path 9 | 10 | HERE = Path(__file__).absolute() 11 | 12 | 13 | def _find(path, filename): 14 | return next( 15 | parent / filename for parent in path.parents if Path.is_file(parent / filename) 16 | ) 17 | 18 | 19 | def build_pdf(filename="bids-spec.pdf", logfile="bids-spec_pandoc_log.json"): 20 | """Construct command with required pandoc flags and run using subprocess. 21 | 22 | Parameters 23 | ---------- 24 | filename : str 25 | Name of the output file. Defaults to "bids-spec.pdf". 26 | logfile : str 27 | Name of the log file. Defaults to "bids-spec_pandoc_log.json". 28 | """ 29 | 30 | def _flatten_values(lst): 31 | """Flatten a list of dicts of lists to a list of values.""" 32 | for obj in lst: 33 | for val in obj.values(): 34 | if isinstance(val, str): 35 | yield val 36 | else: 37 | yield from _flatten_values(val) 38 | 39 | fname_mkdocs_yml = _find(HERE, "mkdocs.yml") 40 | 41 | with open(fname_mkdocs_yml, "r") as stream: 42 | mkdocs_yml = yaml.load(stream, yaml.Loader) 43 | 44 | sections = mkdocs_yml["nav"][0]["The BIDS Specification"] 45 | 46 | # special files 47 | index_page = "./index.md" 48 | pandoc_metadata = _find(HERE, "metadata.yml") 49 | 50 | # Prepare the command options 51 | cmd = [ 52 | "pandoc", 53 | "--from=markdown_github+yaml_metadata_block", 54 | "--include-before-body=./cover.tex", 55 | "--include-in-header=./header.tex", 56 | "--include-in-header=./header_setup.tex", 57 | "--pdf-engine=xelatex", 58 | f"--log={logfile}", 59 | f"--output={filename}", 60 | ] 61 | 62 | # Resources are searched relative to the working directory, but 63 | # we can add additional search paths using :, ... 64 | # When in one of the appendices/ files there is a reference to 65 | # "../04-modality-specific-files/images/...", then we need to use 66 | # appendices/ as a resource-path so that the relative files can 67 | # be found. 68 | build_root = HERE.parent 69 | cmd += [f"--resource-path=.:{build_root / 'appendices'}"] 70 | 71 | # Add input files to command 72 | # The filenames in `markdown_list` will ensure correct order when sorted 73 | cmd += [str(build_root / index_page)] 74 | cmd += [str(pandoc_metadata)] 75 | cmd += [str(build_root / md) for md in _flatten_values(sections)] 76 | 77 | # print and run 78 | print("pandoc command being run: \n\n" + "\n".join(cmd)) 79 | subprocess.run(cmd) 80 | 81 | 82 | if __name__ == "__main__": 83 | build_pdf() 84 | -------------------------------------------------------------------------------- /pdf_build_src/remove_admonitions.py: -------------------------------------------------------------------------------- 1 | """Script to remove all mkdocs admonition from the markdown files in a directory. 2 | 3 | See the pdf_build_src/tests/data/input directory to see what admonitions look like. 4 | """ 5 | 6 | from __future__ import annotations 7 | 8 | import shutil 9 | from pathlib import Path 10 | 11 | INDENT = " " 12 | 13 | ADMONITION_DELIMITERS = ["!!!", "???", "???+"] 14 | 15 | 16 | def remove_admonitions( 17 | input_folder: str | Path, output_folder: str | Path, indent: str = None 18 | ): 19 | if indent is None: 20 | indent = INDENT 21 | 22 | md_files = Path(input_folder).glob("**/*.md") 23 | 24 | for file in md_files: 25 | with open(file, "r", encoding="utf8") as f: 26 | content = f.readlines() 27 | 28 | output_file = Path(output_folder) / file.relative_to(input_folder) 29 | output_file.parent.mkdir(parents=True, exist_ok=True) 30 | print(f"processing: {file}\n to: {output_file}") 31 | 32 | with open(output_file, "w", encoding="utf8") as f: 33 | is_admonition = False 34 | counter = 0 35 | for line in content: 36 | if any(line.startswith(x) for x in ADMONITION_DELIMITERS): 37 | is_admonition = True 38 | counter = 0 39 | continue 40 | 41 | # skip first line after admonition 42 | if is_admonition and counter == 0: 43 | counter += 1 44 | continue 45 | 46 | if line != "\n" and not line.startswith(indent): 47 | is_admonition = False 48 | 49 | if is_admonition: 50 | line = line.lstrip(indent) 51 | 52 | f.write(line) 53 | 54 | 55 | if __name__ == "__main__": 56 | """If run as a script this will just run the main function on test data.""" 57 | input_folder = Path(__file__).parent / "tests" / "data" / "input" 58 | output_folder = Path(__file__).parent / "tests" / "data" / "output" 59 | shutil.rmtree(output_folder) 60 | remove_admonitions(input_folder, output_folder) 61 | -------------------------------------------------------------------------------- /pdf_build_src/test_remove_admonitions.py: -------------------------------------------------------------------------------- 1 | from pathlib import Path 2 | 3 | from remove_admonitions import remove_admonitions 4 | 5 | 6 | def test_remove_admonitions(tmp_path): 7 | input_folder = Path(__file__).parent / "tests" / "data" / "input" 8 | expected_folder = Path(__file__).parent / "tests" / "data" / "expected" 9 | 10 | remove_admonitions(input_folder, tmp_path) 11 | 12 | generated_files = list(tmp_path.glob("**/*.md")) 13 | 14 | for file in generated_files: 15 | expected = expected_folder / file.relative_to(tmp_path) 16 | 17 | with open(expected, "r", encoding="utf8") as f: 18 | expected_content = f.readlines() 19 | 20 | with open(file, "r", encoding="utf8") as f: 21 | generated_content = f.readlines() 22 | 23 | for expected_line, generated_line in zip(expected_content, generated_content): 24 | assert generated_line == expected_line 25 | -------------------------------------------------------------------------------- /pdf_build_src/tests/data/expected/README.md: -------------------------------------------------------------------------------- 1 | # Test inputs 2 | 3 | This input directory contains data to use for testing the pdf build code of the BIDS specification. 4 | 5 | For example the following admonition should be removed by `pdf_build_src/remove_admonitions.py`. 6 | 7 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. 8 | Nulla et euismod nulla. 9 | Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, 10 | nec semper lorem quam in massa. 11 | 12 | The `expected` directory should contain the documents 13 | as they should look like after processing. 14 | 15 | [Mkdocs admonitions](https://squidfunk.github.io/mkdocs-material/reference/admonitions/#inline-blocks-inline-end) 16 | come in different type. In aaddtion of the classical admonitions show above you have also: 17 | 18 | Collapsible admonitions start with 3 questions marks (`???`). 19 | 20 | Collapsible admonitions that will be shown as expanded 21 | start with 3 questions marks and a plus sign (`???+`). 22 | 23 | 24 | 25 | Let's see 26 | 27 | - [`UK biobank`](https://github.com/bids-standard/bids-examples/tree/master/genetics_ukbb) 28 | - foo bar [`UK biobank`](https://github.com/bids-standard/bids-examples/tree/master/genetics_ukbb) 29 | 30 | More of the admonition 31 | 32 | And here we resume normal thing. 33 | -------------------------------------------------------------------------------- /pdf_build_src/tests/data/expected/modality-specific-files/magnetic-resonance-imaging-data.md: -------------------------------------------------------------------------------- 1 | # Magnetic Resonance Imaging 2 | 3 | ## Common metadata fields 4 | 5 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. 6 | Nulla et euismod nulla. 7 | Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, 8 | nec semper lorem quam in massa. 9 | -------------------------------------------------------------------------------- /pdf_build_src/tests/data/input/README.md: -------------------------------------------------------------------------------- 1 | # Test inputs 2 | 3 | This input directory contains data to use for testing the pdf build code of the BIDS specification. 4 | 5 | For example the following admonition should be removed by `pdf_build_src/remove_admonitions.py`. 6 | 7 | !!! note 8 | 9 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. 10 | Nulla et euismod nulla. 11 | Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, 12 | nec semper lorem quam in massa. 13 | 14 | The `expected` directory should contain the documents 15 | as they should look like after processing. 16 | 17 | [Mkdocs admonitions](https://squidfunk.github.io/mkdocs-material/reference/admonitions/#inline-blocks-inline-end) 18 | come in different type. In aaddtion of the classical admonitions show above you have also: 19 | 20 | ??? note "Collapsible admonitions" 21 | 22 | Collapsible admonitions start with 3 questions marks (`???`). 23 | 24 | ???+ note "Expanded collapsible admonitions" 25 | 26 | Collapsible admonitions that will be shown as expanded 27 | start with 3 questions marks and a plus sign (`???+`). 28 | 29 | 30 | 31 | !!! example "non ordered list should be handle propeler" 32 | 33 | Let's see 34 | 35 | - [`UK biobank`](https://github.com/bids-standard/bids-examples/tree/master/genetics_ukbb) 36 | - foo bar [`UK biobank`](https://github.com/bids-standard/bids-examples/tree/master/genetics_ukbb) 37 | 38 | More of the admonition 39 | 40 | And here we resume normal thing. 41 | -------------------------------------------------------------------------------- /pdf_build_src/tests/data/input/modality-specific-files/magnetic-resonance-imaging-data.md: -------------------------------------------------------------------------------- 1 | # Magnetic Resonance Imaging 2 | 3 | ## Common metadata fields 4 | 5 | !!! warning "foo bar" 6 | 7 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. 8 | Nulla et euismod nulla. 9 | Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, 10 | nec semper lorem quam in massa. 11 | -------------------------------------------------------------------------------- /readthedocs.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | build: 4 | os: ubuntu-lts-latest 5 | tools: 6 | python: latest 7 | jobs: 8 | # The *_create_environment and post_install steps replace RTD's virtual environment 9 | # steps with uv, a much faster alternative to virtualenv+pip. 10 | pre_create_environment: 11 | # Install jq and uv 12 | - asdf plugin add jq https://github.com/lsanwick/asdf-jq.git 13 | - asdf plugin add uv https://github.com/asdf-community/asdf-uv.git 14 | - asdf install jq latest 15 | - asdf install uv latest 16 | - asdf global jq latest 17 | - asdf global uv latest 18 | # Turn `python -m virtualenv` into `python -c pass` 19 | - truncate --size 0 $( dirname $( uv python find ) )/../lib/python3*/site-packages/virtualenv/__main__.py 20 | post_create_environment: 21 | - uv venv $READTHEDOCS_VIRTUALENV_PATH 22 | # Turn `python -m pip` into `python -c pass` 23 | - truncate --size 0 $( ls -d $READTHEDOCS_VIRTUALENV_PATH/lib/python3* )/site-packages/pip.py 24 | # post_install replaces the top-level {python: {install: [{requirements: requirements.txt}]}} 25 | post_install: 26 | # Use a cache dir in the same mount to halve the install time 27 | - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install --cache-dir $READTHEDOCS_VIRTUALENV_PATH/../../uv_cache -r requirements.txt 28 | # Normal pre-build step to inject schema.json into the source directory 29 | # so schema.json is hosted alongside the specification documents 30 | pre_build: 31 | - bst -v export --output src/schema.json 32 | - tools/no-bad-schema-paths.sh src/schema.json # README.md might need fixing 33 | 34 | mkdocs: 35 | configuration: mkdocs.yml 36 | fail_on_warning: true 37 | -------------------------------------------------------------------------------- /release_images/GH-release_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bids-standard/bids-specification/d776b638899ae16fba673a2d597a0844eec2ee64/release_images/GH-release_1.png -------------------------------------------------------------------------------- /release_images/GH-release_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bids-standard/bids-specification/d776b638899ae16fba673a2d597a0844eec2ee64/release_images/GH-release_2.png -------------------------------------------------------------------------------- /release_images/GH-release_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bids-standard/bids-specification/d776b638899ae16fba673a2d597a0844eec2ee64/release_images/GH-release_3.png -------------------------------------------------------------------------------- /release_images/GitHub_to_RTD_spec_rendering.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bids-standard/bids-specification/d776b638899ae16fba673a2d597a0844eec2ee64/release_images/GitHub_to_RTD_spec_rendering.png -------------------------------------------------------------------------------- /release_images/Unreleased-to-Version.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bids-standard/bids-specification/d776b638899ae16fba673a2d597a0844eec2ee64/release_images/Unreleased-to-Version.png -------------------------------------------------------------------------------- /release_images/merge_commit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bids-standard/bids-specification/d776b638899ae16fba673a2d597a0844eec2ee64/release_images/merge_commit.png -------------------------------------------------------------------------------- /release_images/site_name_2dev-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bids-standard/bids-specification/d776b638899ae16fba673a2d597a0844eec2ee64/release_images/site_name_2dev-3.png -------------------------------------------------------------------------------- /release_images/site_name_3-3dev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bids-standard/bids-specification/d776b638899ae16fba673a2d597a0844eec2ee64/release_images/site_name_3-3dev.png -------------------------------------------------------------------------------- /release_images/site_name_release_1.2-1.3dev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bids-standard/bids-specification/d776b638899ae16fba673a2d597a0844eec2ee64/release_images/site_name_release_1.2-1.3dev.png -------------------------------------------------------------------------------- /release_images/site_name_release_1.2dev-1.2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bids-standard/bids-specification/d776b638899ae16fba673a2d597a0844eec2ee64/release_images/site_name_release_1.2dev-1.2.png -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | mkdocs>=1.1.0 2 | mkdocs-material>=5.4 3 | pymdown-extensions>=7.0.0 4 | mkdocs-branchcustomization-plugin~=0.1.3 5 | mkdocs-macros-plugin 6 | mkdocs-redirects 7 | numpy 8 | tools/schemacode/[render] 9 | -------------------------------------------------------------------------------- /scripts/test_tag: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # Execute this script from anywhere in the repository to push to a new unique testing tag. 4 | # This is a script which automates creation and pushing of unique tags for github actions. 5 | # It is particularly useful when debugging the upload hooks for pypi. 6 | # The workflow for that is to edit `.github/workflows/schemacode_ci.yml` and add a secondary branch name to the `on` section right after master. 7 | # This will allow you to keep pushing to the branch as if it were master and unix-time tagged archives being uploaded to test.pypi. 8 | 9 | EPOCH="$(date +%s)" 10 | 11 | GIT_DIR=$( git rev-parse --git-dir ) 12 | REPO_ROOT=$( ls -d "${GIT_DIR%.git}" ) 13 | 14 | VERSION_FILE="$REPO_ROOT/src/schema/SCHEMA_VERSION" 15 | 16 | REAL_VERSION=$(cat "${VERSION_FILE}") 17 | DUMMY_VERSION="0.0.${EPOCH}-dev" 18 | 19 | echo "${DUMMY_VERSION}" > "${VERSION_FILE}" 20 | git commit -a -m "Test release $DUMMY_VERSION" 21 | git tag -a "schema-$DUMMY_VERSION" -m "Test release $DUMMY_VERSION" 22 | 23 | echo "${REAL_VERSION}" > "${VERSION_FILE}" 24 | -------------------------------------------------------------------------------- /src/appendices/cross-modality-correspondence.md: -------------------------------------------------------------------------------- 1 | # Cross modality correspondence 2 | 3 | ## PET-MRI correspondence 4 | 5 | When sharing MRI data alongside with PET data, 6 | please pay specific attention to the format the MR images are in. 7 | It is important to note whether the MR images have been unwarped 8 | in order to correct for gradient non-linearities, 9 | indicated by the `NonlinearGradientCorrection` metadata field 10 | (see [Magnetic Resonance Imaging Data - Sequence Specifics](../modality-specific-files/magnetic-resonance-imaging-data.md#sequence-specifics)). 11 | The reason for this is that the MRI needs to be corrected for nonlinear gradients 12 | in order to fit the accompanying PET scans for co-registration 13 | (Knudsen et al. 2020, [doi:10.1177/0271678X20905433](https://doi.org/10.1177/0271678X20905433); 14 | Norgaard et al. 2019, [doi:10.1016/j.neuroimage.2019.05.055](https://doi.org/10.1016/j.neuroimage.2019.05.055)). 15 | 16 | ## MRS-MRI correspondence 17 | 18 | It is typical to acquire high-resolution 3D anatomical MR images alongside MRS data for 19 | voxel/slab placement, co-registration, and partial-volume tissue correction of metabolite concentrations. 20 | To avoid incorrectly matching an MRS dataset with a corresponding anatomical MR image, 21 | it is RECOMMENDED that the field `AnatomicalImage` be included in the MRS sidecar JSON files. 22 | -------------------------------------------------------------------------------- /src/appendices/entities.md: -------------------------------------------------------------------------------- 1 | # Entities 2 | 3 | This section compiles the entities (key-value pairs within filenames) 4 | described throughout this specification, and describes each. 5 | 6 | A general introduction to entities is given in the section on 7 | [filename structure](../common-principles.md#filenames). 8 | 9 | The ordering of entities, and whether each is OPTIONAL, REQUIRED, or MUST NOT 10 | be specified for a given file type, is specified in the [Entity Table](entity-table.md). 11 | 12 | 18 | {{ MACROS___make_entity_definitions() }} 19 | -------------------------------------------------------------------------------- /src/appendices/entity-table.md: -------------------------------------------------------------------------------- 1 | --- 2 | hide: 3 | - toc 4 | --- 5 | 6 | # Entity table 7 | 8 | This section compiles the entities (key-value pairs within filenames) 9 | described throughout this specification, 10 | and establishes a common order within a filename. 11 | For example, if a file has an acquisition and reconstruction label, the 12 | acquisition entity must precede the reconstruction entity. 13 | REQUIRED and OPTIONAL entities for a given file type are denoted; 14 | empty cells imply that entities MUST NOT be specified. 15 | Entity formats indicate whether the value is alphanumeric (and possibly including `+` character(s)) 16 | (`