Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
markmikkelsen committed Mar 14, 2024
2 parents e19c9fc + 3a5cb8e commit eb1c602
Show file tree
Hide file tree
Showing 12 changed files with 99 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ repos:
- id: codespell
args: ["--config=.codespellrc", "--dictionary=-", "--dictionary=.codespell_dict"]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
rev: v1.9.0
hooks:
- id: mypy
# Sync with project.optional-dependencies.typing
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Attribution 4.0 International

Copyright (c) 2018-2022, BIDS Contributors.
Copyright (c) 2018, BIDS Contributors.

=======================================================================

Expand Down
37 changes: 28 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[![Validation](https://github.com/bids-standard/bids-specification/actions/workflows/validation.yml/badge.svg)](https://github.com/bids-standard/bids-specification/actions/workflows/validation.yml)
[![CircleCI](https://circleci.com/gh/bids-standard/bids-specification.svg?style=shield)](https://circleci.com/gh/bids-standard/bids-specification)
[![Mastodon Follow](https://img.shields.io/mastodon/follow/109520103085644521?domain=https%3A%2F%2Ffosstodon.org%2F)](https://fosstodon.org/@bidsstandard)
[![@BIDSstandard](http://img.shields.io/twitter/follow/bidsstandard.svg?style=social)](https://twitter.com/BIDSstandard)
[![@BIDSstandard](https://img.shields.io/twitter/follow/bidsstandard.svg?style=social)](https://x.com/BIDSstandard)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3686061.svg)](https://doi.org/10.5281/zenodo.3686061)

<img src="./BIDS_logo/BIDS_logo_white_transparent_background_crop.png#gh-dark-mode-only" alt="bids-logo" width="600"/>
Expand All @@ -13,7 +13,6 @@ organization of neuroimaging data.
In this repository, we develop the
[BIDS specification](https://bids-specification.readthedocs.io/en/latest/).


# When to use BIDS

To organize your data in BIDS, all you need is neuro data, a computer, and the
Expand Down Expand Up @@ -44,10 +43,7 @@ The specification is provided in the form of a webpage, built using
1. Read some introductory material, most likely the very basic problems have already been addressed!
- [BIDS Starter Kit](https://github.com/bids-standard/bids-starter-kit) for tutorials, wikis, templates, ...
2. Post your question in one of several channels where BIDS members are active
- the [NeuroStars](https://neurostars.org/tags/bids) discourse forum
- the [BrainHack Mattermost](https://mattermost.brainhack.org), for instant messaging (see also this [news item](https://bids.neuroimaging.io/2020/06/24/Join-the-BIDS-community-on-the-BrainHack-Mattermost.html))
- the [Google group](https://groups.google.com/forum/#!forum/bids-discussion), for broader discussions surrounding BIDS
- the [specification repository issue page](https://github.com/bids-standard/bids-specification/issues), if you found inconsistencies, typos, or other issues with the BIDS specification itself
- see: [BIDS communication channels](#bids-communication-channels)

# Contributing to BIDS

Expand All @@ -58,11 +54,34 @@ For a current list of our contributors, please see our [Contributors appendix](h

When you're ready to get started, check out [our contributing guidelines](https://github.com/bids-standard/bids-specification/blob/master/CONTRIBUTING.md).

We ask that all contributions to BIDS across all project-related spaces (including but not limited to:
[GitHub](https://github.com/bids-standard),
the [Google group](https://groups.google.com/forum/#!forum/bids-discussion), and newsletter emails),
We ask that all contributions to BIDS across all project-related spaces
(including but not limited to:
[GitHub](https://github.com/bids-standard), and the
[Google group](https://groups.google.com/forum/#!forum/bids-discussion); see
[BIDS communication channels](#bids-communication-channels))
adhere to our [code of conduct](https://github.com/bids-standard/bids-specification/blob/master/CODE_OF_CONDUCT.md).

# BIDS communication channels

## Main communication channels

- "Issue" pages on the different GitHub repositories of the [`bids-standard` GitHub organization](https://github.com/bids-standard),
such as the [BIDS specification repository](https://github.com/bids-standard/bids-specification/issues),
for reporting problems or making suggestions
- The [NeuroStars Discourse forum](https://neurostars.org/tags/bids), for asking usage questions
- The [BrainHack Mattermost](https://mattermost.brainhack.org), for instant messaging
(see also this [news item](https://bids.neuroimaging.io/2020/06/24/Join-the-BIDS-community-on-the-BrainHack-Mattermost.html))
- The [Google group](https://groups.google.com/forum/#!forum/bids-discussion), for broader discussions and announcements surrounding BIDS
- The [BIDS website "news"](https://bids.neuroimaging.io/news.html), similar to the Google group, for broader discussions and announcements

## Social media channels

- [X](https://x.com/BIDSstandard)
- [Mastodon](https://fosstodon.org/@bidsstandard)
- [Bluesky](https://bsky.app/profile/bidsstandard.bsky.social)
- [Youtube](https://www.youtube.com/channel/UCxZUcYfd_nvIVWAbzRB1tlw)
- [Instagram](https://www.instagram.com/bidsstandard/)

## Contributors

Thanks goes to these wonderful people.
Expand Down
8 changes: 6 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,16 @@ extra:
social:
- icon: fontawesome/brands/github
link: https://github.com/bids-standard/bids-specification/
- icon: fontawesome/brands/twitter
link: https://twitter.com/BIDSstandard/
- icon: fontawesome/brands/x-twitter
link: https://x.com/BIDSstandard/
- icon: fontawesome/brands/mastodon
link: https://fosstodon.org/@bidsstandard
- icon: fontawesome/brands/google
link: https://groups.google.com/g/bids-discussion
- icon: fontawesome/brands/instagram
link: https://www.instagram.com/bidsstandard/
- icon: fontawesome/brands/youtube
link: https://www.youtube.com/channel/UCxZUcYfd_nvIVWAbzRB1tlw

extra_javascript:
- js/jquery-3.6.0.min.js
Expand Down
3 changes: 3 additions & 0 deletions readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ version: 2

build:
os: ubuntu-22.04
apt_packages:
- jq
tools:
python: "3.11"
jobs:
pre_build:
- bst -v export --output src/schema.json
- tools/no-bad-schema-paths.sh src/schema.json # README.md might need fixing

mkdocs:
configuration: mkdocs.yml
Expand Down
3 changes: 2 additions & 1 deletion src/modality-specific-files/microscopy.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
-->
{{ MACROS___make_filename_template("raw", datatypes=["micr"], suffixes=["TEM", "SEM", "uCT", "BF", "DF",
"PC", "DIC", "FLUO", "CONF", "PLI", "CARS", "2PE", "MPE", "SR", "NLO", "OCT", "SPIM"], n_dupes_to_combine=4) }}
"PC", "DIC", "FLUO", "CONF", "PLI", "CARS", "2PE", "MPE", "SR", "NLO", "OCT", "SPIM", "hipCT"], n_dupes_to_combine=4) }}

Microscopy data MUST be stored in the `micr` directory.

Expand Down Expand Up @@ -89,6 +89,7 @@ and a guide for using macros can be found at
"NLO",
"OCT",
"SPIM",
"hipCT",
]
)
}}
Expand Down
2 changes: 1 addition & 1 deletion src/modality-specific-files/near-infrared-spectroscopy.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ and a guide for using macros can be found at
{{ MACROS___make_filename_template(
"raw",
datatypes=["nirs"],
suffixes=["nirs", "events", "physio", "stim"])
suffixes=["nirs", "events", "channels", "optodes", "coordsystem", "physio", "stim"])
}}

Only the *Shared Near Infrared Spectroscopy Format* ([SNIRF](https://github.com/fNIRS/snirf))
Expand Down
37 changes: 21 additions & 16 deletions src/schema/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,20 @@ with the object being referenced.
The following two prototypical examples are presented to clarify the semantics of
references (the cases in which they are used will be presented later):

1. In `objects.metadata`:
1. In `objects.enums`:
```YAML
_GeneticLevelEnum:
type: string
enum:
- Genetic
- Genomic
- Epigenomic
- Transcriptomic
- Metabolomic
- Proteomic
- $ref: objects.enums.Genetic.value
- $ref: objects.enums.Genomic.value
- $ref: objects.enums.Epigenomic.value
- $ref: objects.enums.Transcriptomic.value
- $ref: objects.enums.Metabolomic.value
- $ref: objects.enums.Proteomic.value
```
and in `objects.metadata`:
```YAML
GeneticLevel:
name: GeneticLevel
display_name: Genetic Level
Expand All @@ -156,29 +158,29 @@ references (the cases in which they are used will be presented later):
Values MUST be one of `"Genetic"`, `"Genomic"`, `"Epigenomic"`,
`"Transcriptomic"`, `"Metabolomic"`, or `"Proteomic"`.
anyOf:
- $ref: objects.metadata._GeneticLevelEnum
- $ref: objects.enums._GeneticLevelEnum
- type: array
items:
$ref: objects.metadata._GeneticLevelEnum
$ref: objects.enums._GeneticLevelEnum
```
Here `_GeneticLevelEnum` is used to describe the valid values of `GeneticLevel`,
and the references inside `GeneticLevel.anyOf` indicate that there may be a single
(which are in turn references to individual values), and the references inside `GeneticLevel.anyOf` indicate that there may be a single
such value or a list of values.

1. In `rules.datatypes.derivatives.common_derivatives`:
1. In [`rules.files.deriv.preprocessed_data`](./rules/files/deriv/preprocessed_data.yaml):
```YAML
anat_nonparametric_common:
$ref: rules.datatypes.anat.nonparametric
$ref: rules.files.raw.anat.nonparametric
entities:
$ref: rules.datatypes.anat.nonparametric.entities
$ref: rules.files.raw.anat.nonparametric.entities
space: optional
description: optional
```
Here, the derivative datatype rule starts by copying the raw datatype rule
`rules.datatypes.anat.nonparametric`.
`rules.files.raw.anat.nonparametric`.
It then *overrides* the `entities` portion of that rule with a new object.
To *extend* the original `entities`, it again begins
by referencing `rules.datatypes.anat.nonparametric.entities`,
by referencing `rules.files.raw.anat.nonparametric.entities`,
and adding the new entities `space` and `description`.

### Expressions
Expand Down Expand Up @@ -229,7 +231,10 @@ which (currently) contains at the top level:
- `associations`: associated files, discovered by the inheritance principle
- `columns`: the columns in the current TSV file
- `json`: the contents of the current JSON file
- `gzip`: the contents of the current file GZIP header
- `nifti_header`: selected contents of the current NIfTI file's header
- `ome`: the contents of the current OME-XML metadata
- `tiff`: the contents of the current TIFF file's header

Some of these are strings, while others are nested objects.
These are to be populated by an *interpreter* of the schema,
Expand Down
2 changes: 1 addition & 1 deletion src/schema/objects/columns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ reference_frame:
description: |
Specification of a reference frame in which the motion data are to be interpreted.
The description of the levels in `*_channels.json` SHOULD use `RotationRule`,
`RotationOrder`, and `SpatialAxis`, and MAY use `Description` for the specification.
`RotationOrder`, and `SpatialAxes`, and MAY use `Description` for the specification.
anyOf:
- type: string
- type: string
Expand Down
5 changes: 5 additions & 0 deletions src/schema/objects/suffixes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,11 @@ headshape:
description: |
The 3-D locations of points that describe the head shape and/or electrode
locations can be digitized and stored in separate files.
hipCT:
value: hipCT
display_name: HiP-CT
description: |
Hierarchical Phase-Contrast Tomography imaging data
ieeg:
value: ieeg
display_name: Intracranial Electroencephalography
Expand Down
1 change: 1 addition & 0 deletions src/schema/rules/files/raw/micr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ microscopy:
- NLO
- OCT
- SPIM
- hipCT
extensions:
- .ome.tif
- .ome.btf
Expand Down
29 changes: 29 additions & 0 deletions tools/no-bad-schema-paths.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

set -eu -o pipefail

schema_json=$(readlink -f "$1")

cd "$(dirname "$(readlink -f "$0")")/../src/schema"

# Create a temporary file and ensure it gets deleted on exit
tmpfile=$(mktemp)
trap 'rm -f "$tmpfile"' EXIT

grep -oE '(://)?([-_A-Za-z]+\.)+[-_A-Za-z]+' README.md \
| grep -v -e :// -e '\.\(md\|html\|json\|tsv\|yaml\)$' \
| grep -e '^\(meta\|objects\|rules\)' \
| grep -v 'objects.metadata.OtherObjectName' \
| sort | uniq | \
while IFS= read -r p; do
v=$(jq ".$p" < "$schema_json" | grep -v '^null$' || echo "fail")
if [ -z "$v" ] || [ "$v" = "fail" ]; then
echo "$p: not reachable" >> "$tmpfile"
fi
done

# Check if the temporary file is empty
if [ -s "$tmpfile" ]; then
cat "$tmpfile" # Display the not reachable paths
exit 1
fi

0 comments on commit eb1c602

Please sign in to comment.