Skip to content

Commit 64f31ab

Browse files
authored
Merge branch 'master' into bep022
2 parents b110114 + ace8d7d commit 64f31ab

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+995
-583
lines changed

.github/workflows/schemacode_ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: "Install build dependencies"
3434
run: pip install --upgrade build twine
3535
- name: "Install test dependencies on tag"
36-
run: pip install --upgrade tools/schemacode[test]
36+
run: pip install --upgrade tools/schemacode[tests]
3737
if: ${{ startsWith(github.ref, 'refs/tags/schema-') }}
3838
- name: "Build archive on tag"
3939
run: pytest tools/schemacode/bidsschematools -k make_archive

src/appendices/arterial-spin-labeling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ For (P)CASL, specifying the `LabelingDuration` and the `PostLabelingDelay` is re
7979
The `LabelingDuration` is defined as the total duration of the labeling pulse train in seconds.
8080
`PostLabelingDelay` is the time in seconds after the end of the labeling until the middle of the excitation pulse applied
8181
to the imaging slab (for 3D acquisition) or first slice (for 2D acquisition).
82-
Additionally, the `BackgroundSuppressionPulseTime`'s is required in case `BackgroundSuppression` was applied.
82+
Additionally, the `BackgroundSuppressionPulseTime` is RECOMMENDED if `BackgroundSuppression` was applied.
8383
This an array of numbers containing the timing in seconds of the background suppression pulses
8484
with respect to the start of the labeling.
8585
In the case of `PCASL`, the recommended `PCASLType` field defines the type of the gradient pulses

src/appendices/contributors.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ If you contributed to the BIDS ecosystem and your name is not listed, please add
5555
| Alexander Jones | 💻🐛 |
5656
| Alexander L. Cohen | 🐛💻📖💬 |
5757
| Alexander von Lautz | 📖 |
58+
| Alexandre D'Astous | 📖 |
5859
| Alexandre Gramfort | 📖💡 |
5960
| Alexandre Hutton | 📖 |
6061
| Alexandre Routier | 📖 |

src/metaschema.json

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
"versions": {
6969
"type": "array",
7070
"items": {
71+
"type": "string",
7172
"pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"
7273
}
7374
}
@@ -315,7 +316,7 @@
315316
"$ref": "#/definitions/ruleTypes/expressionList"
316317
}
317318
},
318-
"required": ["checks", "selectors"],
319+
"required": ["checks", "selectors", "issue"],
319320
"additionalProperties": false
320321
}
321322
}
@@ -386,19 +387,25 @@
386387
"required": ["common", "deriv", "raw"],
387388
"additionalProperties": false
388389
},
390+
"json": {
391+
"type": "object",
392+
"additionalProperties": {
393+
"$ref": "#/definitions/json"
394+
}
395+
},
389396
"sidecars": {
390397
"type": "object",
391398
"patternProperties": {
392399
"^derivatives$": {
393400
"type": "object",
394401
"properties": {
395-
"common_derivatives": { "$ref": "#/definitions/sidecar" }
402+
"common_derivatives": { "$ref": "#/definitions/json" }
396403
},
397404
"required": ["common_derivatives"],
398405
"additionalProperties": false
399406
},
400407
"^(?!derivatives$)[a-z_]+$": {
401-
"$ref": "#/definitions/sidecar"
408+
"$ref": "#/definitions/json"
402409
},
403410
"additionalProperties": false
404411
},
@@ -464,7 +471,7 @@
464471
"properties": {
465472
"datatypes": {
466473
"type": "array",
467-
"items": { "pattern": "^[a-z]+$" }
474+
"items": { "type": "string", "pattern": "^[a-z]+$" }
468475
}
469476
},
470477
"required": ["datatypes"],
@@ -476,6 +483,7 @@
476483
"required": [
477484
"entities",
478485
"files",
486+
"json",
479487
"sidecars",
480488
"tabular_data",
481489
"common_principles",
@@ -586,7 +594,7 @@
586594
}
587595
}
588596
},
589-
"sidecar": {
597+
"json": {
590598
"type": "object",
591599
"patternProperties": {
592600
"^[a-zA-Z0-9_]+$": {
@@ -654,7 +662,7 @@
654662
"level": { "enum": ["optional", "recommended", "required"] },
655663
"datatypes": {
656664
"type": "array",
657-
"items": { "pattern": "^[a-z]+$" }
665+
"items": { "type": "string", "pattern": "^[a-z]+$" }
658666
},
659667
"stem": { "type": "string" },
660668
"extensions": { "type": "array", "items": { "type": "string" } }
@@ -668,11 +676,11 @@
668676
"level": { "enum": ["optional", "recommended", "required"] },
669677
"datatypes": {
670678
"type": "array",
671-
"items": { "pattern": "^[a-z]+$" }
679+
"items": { "type": "string", "pattern": "^[a-z]+$" }
672680
},
673681
"suffixes": {
674682
"type": "array",
675-
"items": { "pattern": "^[a-zA-Z0-9]+$" }
683+
"items": { "type": "string", "pattern": "^[a-zA-Z0-9]+$" }
676684
},
677685
"extensions": { "type": "array", "items": { "type": "string" } },
678686
"entities": {

src/modality-specific-files/electroencephalography.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ The definitions of the fields specified in these tables may be found in
390390
A guide for using macros can be found at
391391
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
392392
-->
393-
{{ MACROS___make_sidecar_table("eeg.EEGCoordsystemGeneral") }}
393+
{{ MACROS___make_json_table("json.eeg.EEGCoordsystemGeneral") }}
394394

395395
Fields relating to the EEG electrode positions:
396396

@@ -402,7 +402,7 @@ The definitions of the fields specified in these tables may be found in
402402
A guide for using macros can be found at
403403
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
404404
-->
405-
{{ MACROS___make_sidecar_table("eeg.EEGCoordsystemPositions") }}
405+
{{ MACROS___make_json_table("json.eeg.EEGCoordsystemPositions") }}
406406

407407
Fields relating to the position of fiducials measured during an EEG session/run:
408408

@@ -414,7 +414,7 @@ The definitions of the fields specified in these tables may be found in
414414
A guide for using macros can be found at
415415
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
416416
-->
417-
{{ MACROS___make_sidecar_table("eeg.EEGCoordsystemFiducials") }}
417+
{{ MACROS___make_json_table("json.eeg.EEGCoordsystemFiducials") }}
418418

419419
Fields relating to the position of anatomical landmark measured during an EEG session/run:
420420

@@ -426,7 +426,7 @@ The definitions of the fields specified in these tables may be found in
426426
A guide for using macros can be found at
427427
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
428428
-->
429-
{{ MACROS___make_sidecar_table(["eeg.EEGCoordsystemLandmark", "eeg.EEGCoordsystemLandmarkDescriptionRec"]) }}
429+
{{ MACROS___make_json_table(["json.eeg.EEGCoordsystemLandmark", "json.eeg.EEGCoordsystemLandmarkDescriptionRec"]) }}
430430

431431
If the position of anatomical landmarks is measured using the same system or
432432
device used to measure electrode positions, and if thereby the anatomical

src/modality-specific-files/intracranial-electroencephalography.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ The definitions of the fields specified in these tables may be found in
389389
A guide for using macros can be found at
390390
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
391391
-->
392-
{{ MACROS___make_sidecar_table("ieeg.iEEGCoordsystemGeneral") }}
392+
{{ MACROS___make_json_table("json.ieeg.iEEGCoordsystemGeneral") }}
393393

394394
Fields relating to the iEEG electrode positions:
395395

@@ -401,7 +401,7 @@ The definitions of the fields specified in these tables may be found in
401401
A guide for using macros can be found at
402402
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
403403
-->
404-
{{ MACROS___make_sidecar_table("ieeg.iEEGCoordsystemPositions") }}
404+
{{ MACROS___make_json_table("json.ieeg.iEEGCoordsystemPositions") }}
405405

406406
### Recommended 3D coordinate systems
407407

src/modality-specific-files/magnetic-resonance-imaging-data.md

Lines changed: 40 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -721,37 +721,46 @@ within the `[*_]dwi.bval` and `[*_]dwi.bvec` files) MAY change across DWI runs.
721721

722722
**Gradient orientation file formats**.
723723
The `[*_]dwi.bval` and `[*_]dwi.bvec` files MUST follow the
724-
[FSL format](https://fsl.fmrib.ox.ac.uk/fsl/docs/#/diffusion/index?id=diffusion-data-in-fsl):
725-
The `[*_]dwi.bvec` file contains 3 rows with *N* space-delimited floating-point numbers
726-
(corresponding to the *N* volumes in the corresponding NIfTI file.)
727-
The first row contains the *x* elements, the second row contains the *y* elements and
728-
the third row contains the *z* elements of a unit vector in the direction of the applied
729-
diffusion gradient, where the *i*-th elements in each row correspond together to
730-
the *i*-th volume, with `[0,0,0]` for *non-diffusion-weighted* (also called *b*=0 or *low-b*)
731-
volumes.
732-
Following the FSL format for the `[*_]dwi.bvec` specification, the coordinate system of
733-
the *b* vectors MUST be defined with respect to the coordinate system defined by
734-
the header of the corresponding `_dwi` NIfTI file and not the scanner's device
735-
coordinate system (see [Coordinate systems](../appendices/coordinate-systems.md)).
736-
The most relevant limitation imposed by this choice is that the gradient information cannot
737-
be directly stored in this format if the scanner generates *b*-vectors in *scanner coordinates*.
738-
739-
Example of `[*_]dwi.bvec` file, with *N*=6, with two *b*=0 volumes in the beginning:
740-
741-
```Text
742-
0 0 0.021828 -0.015425 -0.70918 -0.2465
743-
0 0 0.80242 0.22098 -0.00063106 0.1043
744-
0 0 -0.59636 0.97516 -0.70503 -0.96351
745-
```
746-
747-
The `[*_]dwi.bval` file contains the *b*-values (in s/mm<sup>2</sup>) corresponding to the
748-
volumes in the relevant NIfTI file), with 0 designating *b*=0 volumes, space-delimited.
749-
750-
Example of `[*_]dwi.bval` file, corresponding to the previous `[*_]dwi.bvec` example:
751-
752-
```Text
753-
0 0 2000 2000 1000 1000
754-
```
724+
[FSL format](https://fsl.fmrib.ox.ac.uk/fsl/docs/#/diffusion/index?id=diffusion-data-in-fsl).
725+
726+
The `[*_]dwi.bvec` file contains 3 rows with *N* space-delimited floating-point numbers,
727+
corresponding to the *N* volumes in the corresponding NIfTI file.
728+
Across these three rows,
729+
each column encodes three elements of a 3-vector for the corresponding image volume;
730+
each vector MUST be either of unit norm,
731+
or optionally the vector `[0.0,0.0,0.0]`
732+
for *non-diffusion-weighted* (also called *b*=0 or *low-b*) volumes.
733+
These values are to be interpreted as cosine values with respect to the image axis orientations
734+
as defined by the corresponding NIfTI image header transformation;
735+
*unless* the image axes defined in the corresponding NIfTI image header
736+
form a right-handed coordinate system
737+
(that is, the 3x3 matrix of direction cosines has a positive determinant),
738+
in which case the sign of the first element of each 3-vector must be inverted
739+
for this interpretation to be valid.
740+
Note that this definition of orientations with respect to the NIfTI image axes
741+
is *not* equivalent to the DICOM convention,
742+
where orientations are instead defined with respect to the scanner device's coordinate system
743+
(see [Coordinate systems](../appendices/coordinate-systems.md)).
744+
745+
The `[*_]dwi.bval` file contains the *b*-values (in s/mm<sup>2</sup>)
746+
corresponding to the volumes in the relevant NIfTI file,
747+
with 0 designating *b*=0 volumes; space-delimited.
748+
749+
Examples of `[*_]dwi.bvec` and `[*_]dwi.bval` files,
750+
corresponding to a NIfTI image with 6 volumes
751+
with the first two volumes having no diffusion sensitization:
752+
753+
- `[*_]dwi.bvec`:
754+
```Text
755+
0 0 0.021828 -0.015425 -0.70918 -0.2465
756+
0 0 0.80242 0.22098 -0.00063106 0.1043
757+
0 0 -0.59636 0.97516 -0.70503 -0.96351
758+
```
759+
760+
- `[_]dwi.bval`:
761+
```Text
762+
0 0 2000 2000 1000 1000
763+
```
755764
756765
### Multipart (split) DWI schemes
757766

src/modality-specific-files/magnetoencephalography.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ The definitions of the fields specified in these tables may be found in
343343
A guide for using macros can be found at
344344
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
345345
-->
346-
{{ MACROS___make_sidecar_table("meg.MEGCoordsystemWithEEG") }}
346+
{{ MACROS___make_json_table("json.meg.MEGCoordsystemWithEEG") }}
347347

348348
Head localization coils:
349349

@@ -355,7 +355,7 @@ The definitions of the fields specified in these tables may be found in
355355
A guide for using macros can be found at
356356
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
357357
-->
358-
{{ MACROS___make_sidecar_table("meg.MEGCoordsystemHeadLocalizationCoils") }}
358+
{{ MACROS___make_json_table("json.meg.MEGCoordsystemHeadLocalizationCoils") }}
359359

360360
Digitized head points:
361361

@@ -367,7 +367,7 @@ The definitions of the fields specified in these tables may be found in
367367
A guide for using macros can be found at
368368
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
369369
-->
370-
{{ MACROS___make_sidecar_table("meg.MEGCoordsystemDigitizedHeadPoints") }}
370+
{{ MACROS___make_json_table("json.meg.MEGCoordsystemDigitizedHeadPoints") }}
371371

372372
Anatomical MRI:
373373

@@ -379,7 +379,7 @@ The definitions of the fields specified in these tables may be found in
379379
A guide for using macros can be found at
380380
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
381381
-->
382-
{{ MACROS___make_sidecar_table("meg.MEGCoordsystemAnatomicalMRI") }}
382+
{{ MACROS___make_json_table("json.meg.MEGCoordsystemAnatomicalMRI") }}
383383

384384
Anatomical landmarks:
385385

@@ -391,7 +391,7 @@ The definitions of the fields specified in these tables may be found in
391391
A guide for using macros can be found at
392392
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
393393
-->
394-
{{ MACROS___make_sidecar_table("meg.MEGCoordsystemAnatomicalLandmarks") }}
394+
{{ MACROS___make_json_table("json.meg.MEGCoordsystemAnatomicalLandmarks") }}
395395

396396
It is also RECOMMENDED that the MRI voxel coordinates of the actual anatomical
397397
landmarks for co-registration of MEG with structural MRI are stored in the
@@ -419,7 +419,7 @@ The definitions of the fields specified in these tables may be found in
419419
A guide for using macros can be found at
420420
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
421421
-->
422-
{{ MACROS___make_sidecar_table("meg.MEGCoordsystemFiducialsInformation") }}
422+
{{ MACROS___make_json_table("json.meg.MEGCoordsystemFiducialsInformation") }}
423423

424424
For more information on the definition of anatomical landmarks, please visit:
425425
[How are the Left and Right Pre-Auricular (LPA and RPA) points defined? - FieldTrip Toolbox](https://www.fieldtriptoolbox.org/faq/how_are_the_lpa_and_rpa_points_defined/)

src/modality-specific-files/near-infrared-spectroscopy.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ A guide for using macros can be found at
386386
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
387387
-->
388388

389-
{{ MACROS___make_sidecar_table("nirs.CoordsystemGeneral") }}
389+
{{ MACROS___make_json_table("json.nirs.CoordsystemGeneral") }}
390390

391391
Fields relating to the NIRS optode positions:
392392

@@ -399,7 +399,7 @@ A guide for using macros can be found at
399399
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
400400
-->
401401

402-
{{ MACROS___make_sidecar_table(["nirs.CoordinateSystem", "nirs.CoordinateSystemDescriptionRec"]) }}
402+
{{ MACROS___make_json_table(["json.nirs.CoordinateSystem", "json.nirs.CoordinateSystemDescriptionRec"]) }}
403403

404404
Fields relating to the position of fiducials measured during an NIRS session/run:
405405

@@ -412,7 +412,7 @@ A guide for using macros can be found at
412412
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
413413
-->
414414

415-
{{ MACROS___make_sidecar_table(["nirs.Fiducials", "nirs.FiducialsCoordinateSystemDescriptionRec"]) }}
415+
{{ MACROS___make_json_table(["json.nirs.Fiducials", "json.nirs.FiducialsCoordinateSystemDescriptionRec"]) }}
416416

417417
Fields relating to the position of anatomical landmarks measured during an NIRS session/run:
418418

@@ -425,7 +425,7 @@ A guide for using macros can be found at
425425
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
426426
-->
427427

428-
{{ MACROS___make_sidecar_table(["nirs.AnatomicalLandmark", "nirs.AnatomicalLandmarkCoordinateSystemDescriptionRec"]) }}
428+
{{ MACROS___make_json_table(["json.nirs.AnatomicalLandmark", "json.nirs.AnatomicalLandmarkCoordinateSystemDescriptionRec"]) }}
429429

430430
### Example `*_coordsystem.json`
431431

0 commit comments

Comments
 (0)