Skip to content

Commit ae3747f

Browse files
committed
feat(schema): Expand use of raw templates
1 parent 0f699c4 commit ae3747f

File tree

17 files changed

+88
-238
lines changed

17 files changed

+88
-238
lines changed

src/schema/meta/templates.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,30 @@ raw:
1717
subject: required
1818
session: optional
1919

20+
recording:
21+
entities:
22+
$ref: meta.templates.raw.base.entities
23+
acquisition: optional
24+
run: optional
25+
26+
task:
27+
entities:
28+
$ref: meta.templates.raw.recording.entities
29+
task: required
30+
31+
mri:
32+
entities:
33+
$ref: meta.templates.raw.recording.entities
34+
ceagent: optional
35+
reconstruction: optional
36+
chunk: optional
37+
38+
epi:
39+
entities:
40+
$ref: meta.templates.raw.mri.entities
41+
direction: optional
42+
part: optional
43+
2044
# Entities that apply to most derivative files
2145
# Include thus:
2246
#

src/schema/rules/files/raw/anat.yaml

Lines changed: 10 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,10 @@ nonparametric:
2020
datatypes:
2121
- anat
2222
entities:
23-
$ref: meta.templates.raw.base.entities
23+
$ref: meta.templates.raw.mri.entities
2424
task: optional
25-
acquisition: optional
26-
ceagent: optional
27-
reconstruction: optional
28-
run: optional
2925
echo: optional
3026
part: optional
31-
chunk: optional
3227

3328
parametric:
3429
suffixes:
@@ -55,13 +50,8 @@ parametric:
5550
datatypes:
5651
- anat
5752
entities:
58-
$ref: meta.templates.raw.base.entities
53+
$ref: meta.templates.raw.mri.entities
5954
task: optional
60-
acquisition: optional
61-
ceagent: optional
62-
reconstruction: optional
63-
run: optional
64-
chunk: optional
6555

6656
defacemask:
6757
suffixes:
@@ -73,14 +63,9 @@ defacemask:
7363
datatypes:
7464
- anat
7565
entities:
76-
$ref: meta.templates.raw.base.entities
66+
$ref: meta.templates.raw.mri.entities
7767
task: optional
78-
acquisition: optional
79-
ceagent: optional
80-
reconstruction: optional
81-
run: optional
8268
modality: optional
83-
chunk: optional
8469

8570
megre:
8671
suffixes:
@@ -92,15 +77,10 @@ megre:
9277
datatypes:
9378
- anat
9479
entities:
95-
$ref: meta.templates.raw.base.entities
80+
$ref: meta.templates.raw.mri.entities
9681
task: optional
97-
acquisition: optional
98-
ceagent: optional
99-
reconstruction: optional
100-
run: optional
10182
echo: required
10283
part: optional
103-
chunk: optional
10484

10585
mese:
10686
suffixes:
@@ -112,16 +92,11 @@ mese:
11292
datatypes:
11393
- anat
11494
entities:
115-
$ref: meta.templates.raw.base.entities
95+
$ref: meta.templates.raw.mri.entities
11696
task: optional
117-
acquisition: optional
118-
ceagent: optional
119-
reconstruction: optional
12097
direction: optional
121-
run: optional
12298
echo: required
12399
part: optional
124-
chunk: optional
125100

126101
multiflip:
127102
suffixes:
@@ -133,16 +108,11 @@ multiflip:
133108
datatypes:
134109
- anat
135110
entities:
136-
$ref: meta.templates.raw.base.entities
111+
$ref: meta.templates.raw.mri.entities
137112
task: optional
138-
acquisition: optional
139-
ceagent: optional
140-
reconstruction: optional
141-
run: optional
142113
echo: optional
143114
flip: required
144115
part: optional
145-
chunk: optional
146116

147117
multiinversion:
148118
suffixes:
@@ -154,15 +124,10 @@ multiinversion:
154124
datatypes:
155125
- anat
156126
entities:
157-
$ref: meta.templates.raw.base.entities
127+
$ref: meta.templates.raw.mri.entities
158128
task: optional
159-
acquisition: optional
160-
ceagent: optional
161-
reconstruction: optional
162-
run: optional
163129
inversion: required
164130
part: optional
165-
chunk: optional
166131

167132
mp2rage:
168133
suffixes:
@@ -174,17 +139,12 @@ mp2rage:
174139
datatypes:
175140
- anat
176141
entities:
177-
$ref: meta.templates.raw.base.entities
142+
$ref: meta.templates.raw.mri.entities
178143
task: optional
179-
acquisition: optional
180-
ceagent: optional
181-
reconstruction: optional
182-
run: optional
183144
echo: optional
184145
flip: optional
185146
inversion: required
186147
part: optional
187-
chunk: optional
188148

189149
vfamt:
190150
suffixes:
@@ -197,17 +157,12 @@ vfamt:
197157
datatypes:
198158
- anat
199159
entities:
200-
$ref: meta.templates.raw.base.entities
160+
$ref: meta.templates.raw.mri.entities
201161
task: optional
202-
acquisition: optional
203-
ceagent: optional
204-
reconstruction: optional
205-
run: optional
206162
echo: optional
207163
flip: required
208164
mtransfer: required
209165
part: optional
210-
chunk: optional
211166

212167
mtr:
213168
suffixes:
@@ -219,12 +174,7 @@ mtr:
219174
datatypes:
220175
- anat
221176
entities:
222-
$ref: meta.templates.raw.base.entities
177+
$ref: meta.templates.raw.mri.entities
223178
task: optional
224-
acquisition: optional
225-
ceagent: optional
226-
reconstruction: optional
227-
run: optional
228179
mtransfer: required
229180
part: optional
230-
chunk: optional
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
---
22
# Non-continuous data
33
noncontinuous:
4+
$ref: meta.templates.raw.task
45
suffixes:
56
- beh
67
extensions:
78
- .tsv
89
- .json
910
datatypes:
1011
- beh
11-
entities:
12-
$ref: meta.templates.raw.base.entities
13-
task: required
14-
acquisition: optional
15-
run: optional

src/schema/rules/files/raw/channels.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
channels:
3+
$ref: meta.templates.raw.task
34
suffixes:
45
- channels
56
extensions:
@@ -9,11 +10,6 @@ channels:
910
- eeg
1011
- ieeg
1112
- nirs
12-
entities:
13-
$ref: meta.templates.raw.base.entities
14-
task: required
15-
acquisition: optional
16-
run: optional
1713

1814
# MEG has an additional entity available
1915
channels__meg:
@@ -66,10 +62,8 @@ electrodes:
6662
- eeg
6763
- ieeg
6864
entities:
69-
$ref: meta.templates.raw.base.entities
65+
$ref: meta.templates.raw.recording.entities
7066
task: optional
71-
acquisition: optional
72-
run: optional
7367
space: optional
7468

7569
# MEG has an additional entity available

src/schema/rules/files/raw/dwi.yaml

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,10 @@ dwi:
1111
datatypes:
1212
- dwi
1313
entities:
14-
$ref: meta.templates.raw.base.entities
15-
acquisition: optional
16-
reconstruction: optional
17-
direction: optional
18-
run: optional
19-
part: optional
20-
chunk: optional
14+
$ref: meta.templates.raw.epi.entities
15+
# Historically BIDS has not permitted ceagent for DWI
16+
# This could be relaxed without backwards incompatibility
17+
ceagent: null
2118

2219
sbref:
2320
suffixes:
@@ -29,13 +26,8 @@ sbref:
2926
datatypes:
3027
- dwi
3128
entities:
32-
$ref: meta.templates.raw.base.entities
33-
acquisition: optional
34-
reconstruction: optional
35-
direction: optional
36-
run: optional
37-
part: optional
38-
chunk: optional
29+
$ref: meta.templates.raw.epi.entities
30+
ceagent: null
3931

4032
# Common scanner-generated derivatives need raw names
4133
ScannerDerivatives:
@@ -53,10 +45,7 @@ ScannerDerivatives:
5345
datatypes:
5446
- dwi
5547
entities:
56-
subject: required
57-
session: optional
58-
acquisition: optional
59-
reconstruction: optional
60-
direction: optional
61-
run: optional
62-
chunk: optional
48+
$ref: meta.templates.raw.epi.entities
49+
# part is also not defined for derivative maps
50+
ceagent: null
51+
part: null

src/schema/rules/files/raw/eeg.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
eeg:
3+
$ref: meta.templates.raw.task
34
suffixes:
45
- eeg
56
extensions:
@@ -13,8 +14,3 @@ eeg:
1314
- .bdf
1415
datatypes:
1516
- eeg
16-
entities:
17-
$ref: meta.templates.raw.base.entities
18-
task: required
19-
acquisition: optional
20-
run: optional

src/schema/rules/files/raw/events.yaml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
events:
3+
$ref: meta.templates.raw.task
34
suffixes:
45
- events
56
extensions:
@@ -11,11 +12,6 @@ events:
1112
- ieeg
1213
- meg
1314
- nirs
14-
entities:
15-
$ref: meta.templates.raw.base.entities
16-
task: required
17-
acquisition: optional
18-
run: optional
1915

2016
# Specializations
2117
# In these rules, we use $ref to retrieve most of an object, and then override
@@ -43,12 +39,11 @@ events__pet:
4339
datatypes:
4440
- pet
4541
entities:
46-
# Most events allow acquisition, PET doesn't
47-
$ref: meta.templates.raw.base.entities
48-
task: required
42+
$ref: meta.templates.raw.task.entities
4943
tracer: optional
5044
reconstruction: optional
51-
run: optional
45+
# Most events allow acquisition, PET doesn't
46+
acquisition: null
5247

5348
events__mrs:
5449
$ref: rules.files.raw.events.events

0 commit comments

Comments
 (0)