Skip to content

Commit cbd3161

Browse files
authored
Merge branch 'master' into mikkel-dev
2 parents 0c6edbc + 04faf74 commit cbd3161

File tree

10 files changed

+66
-29
lines changed

10 files changed

+66
-29
lines changed

.circleci/config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
uvx linkchecker -t 1 ~/project/site/
3636
# check external separately by pointing to all *html so no
3737
# failures for local file:/// -- yoh found no better way,
38-
linkchecker -t 1 --check-extern \
38+
uvx linkchecker -t 1 --check-extern \
3939
--ignore-url 'file:///.*' \
4040
--ignore-url 'https://bids-specification.readthedocs.io/en/stable/.*' \
4141
--ignore-url 'https://doi.org/.*' \
@@ -45,6 +45,7 @@ jobs:
4545
--ignore-url 'https://www.incf.org' \
4646
--ignore-url 'https://dicomlookup.com/dicomtags/.*' \
4747
--ignore-url 'https://www.instagram.com/bidsstandard/' \
48+
--ignore-url 'https://jsoneditoronline.org' \
4849
~/project/site/*html ~/project/site/*/*.html
4950
else
5051
echo "Release PR - do nothing"

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ repos:
1717
- id: check-added-large-files
1818
- id: check-case-conflict
1919
- repo: https://github.com/python-jsonschema/check-jsonschema
20-
rev: 0.33.0
20+
rev: 0.33.2
2121
hooks:
2222
- id: check-dependabot
2323
- id: check-github-workflows
@@ -49,7 +49,7 @@ repos:
4949
- id: codespell
5050
args: ["--config=.codespellrc", "--dictionary=-", "--dictionary=.codespell_dict"]
5151
- repo: https://github.com/pre-commit/mirrors-mypy
52-
rev: v1.16.0
52+
rev: v1.17.0
5353
hooks:
5454
- id: mypy
5555
# Sync with project.optional-dependencies.typing

src/appendices/contributors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Contributors
22

33
Legend (source:
4-
<https://allcontributors.org/docs/en/emoji-key>)
4+
<https://github.com/all-contributors/all-contributors/blob/master/docs/emoji-key.md>)
55

66
| **Emoji** | **Represents** |
77
| --------- | -------------------------------------------------------------------------------------- |

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -600,13 +600,13 @@ to be populated for functional sequences. Note that all these options can be
600600
used for non sparse sequences but that only options B, D and E are valid for
601601
sparse sequences.
602602

603-
| | **`RepetitionTime`** | **`SliceTiming`** | **`AcquisitionDuration`** | **`DelayTime`** | **`VolumeTiming`** |
604-
| -------- | -------------------- | ----------------- | ------------------------- | --------------- | ------------------ |
605-
| option A | \[ X ] | | \[ ] | | \[ ] |
606-
| option B | \[ ] | \[ X ] | | \[ ] | \[ X ] |
607-
| option C | \[ ] | | \[ X ] | \[ ] | \[ X ] |
608-
| option D | \[ X ] | \[ X ] | \[ ] | | \[ ] |
609-
| option E | \[ X ] | | \[ ] | \[ X ] | \[ ] |
603+
| | **`RepetitionTime`** | **`SliceTiming`** | **`FrameAcquisitionDuration`** | **`DelayTime`** | **`VolumeTiming`** |
604+
| -------- | -------------------- | ----------------- | ------------------------------ | --------------- | ------------------ |
605+
| option A | \[ X ] | | \[ ] | | \[ ] |
606+
| option B | \[ ] | \[ X ] | | \[ ] | \[ X ] |
607+
| option C | \[ ] | | \[ X ] | \[ ] | \[ X ] |
608+
| option D | \[ X ] | \[ X ] | \[ ] | | \[ ] |
609+
| option E | \[ X ] | | \[ ] | \[ X ] | \[ ] |
610610

611611
**Legend**
612612

src/schema/objects/metadata.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@ AcquisitionDuration:
2020
name: AcquisitionDuration
2121
display_name: Acquisition Duration
2222
description: |
23-
Duration (in seconds) of volume acquisition.
23+
Duration (in seconds) of scan acquisition, including all volumes for multi-volume scans.
2424
Corresponds to [DICOM Tag 0018, 9073](https://dicomlookup.com/dicomtags/(0018,9073)) `Acquisition Duration`.
25-
This field is mutually exclusive with `"RepetitionTime"`.
2625
type: number
2726
exclusiveMinimum: 0
2827
unit: s
@@ -1200,6 +1199,15 @@ FlipAngle:
12001199
unit: degree
12011200
exclusiveMinimum: 0
12021201
maximum: 360
1202+
FrameAcquisitionDuration:
1203+
name: FrameAcquisitionDuration
1204+
display_name: Frame Acquisition Duration
1205+
description: |
1206+
Duration (in seconds) of volume acquisition.
1207+
Corresponds to DICOM Tag 0018, 9220 `Frame Acquisition Duration`.
1208+
type: number
1209+
exclusiveMinimum: 0
1210+
unit: s
12031211
FrameDuration:
12041212
name: FrameDuration
12051213
display_name: Frame Duration

src/schema/rules/checks/func.yaml

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ PhaseSuffixDeprecated:
1212
level: warning
1313
selectors:
1414
- datatype == "func"
15+
- match(extension, "^\.nii(\.gz)?$")
1516
checks:
1617
- suffix != "phase"
1718

@@ -67,6 +68,7 @@ SliceTimingGreaterThanRepetitionTime:
6768
level: error
6869
selectors:
6970
- suffix == "bold"
71+
- match(extension, "^\.nii(\.gz)?$")
7072
- type(sidecar.SliceTiming) != "null"
7173
- type(sidecar.RepetitionTime) != "null"
7274
checks:
@@ -88,24 +90,24 @@ VolumeTimingRepetitionTimeMutex:
8890
or 'VolumeTiming' when variable times are used.
8991
level: error
9092
selectors:
91-
- type(nifti_header) != "null"
9293
- intersects([suffix], ["asl", "bold"])
94+
- match(extension, "^\.nii(\.gz)?$")
9395
- type(sidecar.VolumeTiming) != "null"
9496
checks:
9597
- type(sidecar.RepetitionTime) == "null"
9698

97-
RepetitionTimeAcquisitionDurationMutex:
99+
RepetitionTimeFrameAcquisitionDurationMutex:
98100
issue:
99101
code: REPETITION_TIME_AND_ACQUISITION_DURATION_MUTUALLY_EXCLUSIVE
100102
message: |
101-
The fields 'RepetitionTime' and 'AcquisitionDuration' for this file are mutually exclusive.
103+
The fields 'RepetitionTime' and 'FrameAcquisitionDuration' for this file are mutually exclusive.
102104
To specify acquisition duration, use 'SliceTiming' or 'DelayTime'
103-
(RepetitionTime - AcquisitionDuration).
105+
(RepetitionTime - FrameAcquisitionDuration).
104106
level: error
105107
selectors:
106-
- type(nifti_header) != "null"
107108
- intersects([suffix], ["asl", "bold"])
108-
- type(sidecar.AcquisitionDuration) != "null"
109+
- match(extension, "^\.nii(\.gz)?$")
110+
- type(sidecar.FrameAcquisitionDuration) != "null"
109111
checks:
110112
- type(sidecar.RepetitionTime) == "null"
111113

@@ -114,24 +116,44 @@ VolumeTimingDelayTimeMutex:
114116
code: VOLUME_TIMING_AND_DELAY_TIME_MUTUALLY_EXCLUSIVE
115117
message: |
116118
The fields 'VolumeTiming' and 'DelayTime' for this file are mutually exclusive.
117-
To specify acquisition duration, use 'AcquisitionDuration' or 'SliceTiming'.
119+
To specify acquisition duration, use 'FrameAcquisitionDuration' or 'SliceTiming'.
118120
level: error
119121
selectors:
120-
- type(nifti_header) != "null"
121122
- intersects([suffix], ["asl", "bold"])
123+
- match(extension, "^\.nii(\.gz)?$")
122124
- type(sidecar.VolumeTiming) != "null"
125+
- type(sidecar.RepetitionTime) == "null"
123126
checks:
124127
- type(sidecar.DelayTime) == "null"
125128

126-
VolumeTimingMissingAcquisitionDuration:
129+
VolumeTimingMissingFrameAcquisitionDuration:
127130
issue:
128131
code: VOLUME_TIMING_MISSING_ACQUISITION_DURATION
129132
message: |
130-
The field 'VolumeTiming' requires 'AcquisitionDuration' or 'SliceTiming' to be defined.
133+
The field 'VolumeTiming' requires 'FrameAcquisitionDuration' or 'SliceTiming' to be defined.
131134
level: error
132135
selectors:
133-
- type(nifti_header) != "null"
134136
- intersects([suffix], ["asl", "bold"])
137+
- match(extension, "^\.nii(\.gz)?$")
138+
- type(sidecar.VolumeTiming) != "null"
139+
- type(sidecar.RepetitionTime) == "null"
140+
checks:
141+
- |
142+
"SliceTiming" in sidecar ||
143+
"FrameAcquisitionDuration" in sidecar ||
144+
"AcquisitionDuration" in sidecar
145+
146+
DeprecatedAcquisitionDuration:
147+
issue:
148+
code: DEPRECATED_ACQUISITION_DURATION
149+
message: |
150+
The 'AcquisitionDuration' field has been replaced with 'FrameAcquisitionDuration'
151+
to indicate the duration of volume acquisition in sparse acquisition sequences.
152+
level: warning
153+
selectors:
154+
- intersects([suffix], ["asl", "bold"])
155+
- match(extension, "^\.nii(\.gz)?$")
135156
- type(sidecar.VolumeTiming) != "null"
157+
- type(sidecar.FrameAcquisitionDuration) == "null"
136158
checks:
137-
- '"SliceTiming" in sidecar || "AcquisitionDuration" in sidecar'
159+
- '!("AcquisitionDuration" in sidecar)'

src/schema/rules/sidecars/anat.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ MRIAnatomyCommonMetadataFields:
1919
TaskMetadata:
2020
selectors:
2121
- datatype == "anat"
22-
- entity.task != null
22+
- entities.task != null
2323
- match(extension, "^\.nii(\.gz)?$")
2424
fields:
2525
TaskName:

src/schema/rules/sidecars/func.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ MRIFuncVolumeTiming:
4444
description_addendum: |
4545
This field is mutually exclusive with `"DelayTime"`.
4646
If defined, this requires acquisition time (TA) be defined via either
47-
`"SliceTiming"` or `"AcquisitionDuration"`.
47+
`"SliceTiming"` or `"FrameAcquisitionDuration"`.
4848
4949
# Timing Parameters
5050
MRIFuncTimingParameters:
@@ -56,13 +56,18 @@ MRIFuncTimingParameters:
5656
NumberOfVolumesDiscardedByScanner: optional
5757
NumberOfVolumesDiscardedByUser: optional
5858
DelayTime: optional
59-
AcquisitionDuration:
59+
FrameAcquisitionDuration:
6060
level: optional
6161
level_addendum: |
6262
required for sequences that are described with the `VolumeTiming`
6363
field and that do not have the `SliceTiming` field set to allow for
6464
accurate calculation of "acquisition time"
6565
DelayAfterTrigger: optional
66+
AcquisitionDuration:
67+
level: deprecated
68+
description_addendum: |
69+
This field was previously used to indicate volume acquisition duration
70+
for BOLD data. The `FrameAcquisitionDuration` field should be used instead.
6671
6772
# fMRI task information
6873
MRIFuncTaskInformation:

src/schema/rules/sidecars/mri.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ MRITimingParameters:
262262
level: optional
263263
level_addendum: required if `inv` entity is present
264264
DwellTime: recommended
265+
AcquisitionDuration: optional
265266

266267
EchoTimeRequiredASL:
267268
selectors:

tools/schemacode/src/bidsschematools/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,4 @@ def jsonschema_validator(
148148

149149
validator_kwargs: ValidatorKwargs
150150
validator_kwargs = {"format_checker": validator_cls.FORMAT_CHECKER} if check_format else {}
151-
return validator_cls(schema, **validator_kwargs)
151+
return validator_cls(schema, **validator_kwargs) # type: ignore[call-arg]

0 commit comments

Comments
 (0)