Skip to content

Commit 426de56

Browse files
authored
SCHEMA: Fix diffusion and NIRS rules (#1650)
* SCHEMA: Check for three bvec rows * FIX: NIRS channels are recommended, not required * FIX: Selectors to match required/optional conditions * FIX: Value of channel type is ACCEL, not ACC
1 parent bf015e6 commit 426de56

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

src/schema/rules/checks/dwi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ DWIBvecRows:
4141
- suffix == "dwi"
4242
- '"bvec" in associations'
4343
checks:
44-
- associations.bvec.n_rows == 1
44+
- associations.bvec.n_rows == 3
4545

4646
# 32
4747
DWIMissingBvec:

src/schema/rules/checks/nirs.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,28 @@ NIRSChannelCount:
2323
ACCELChannelCountReq:
2424
selectors:
2525
- suffix == "nirs"
26+
- count(associations.channels.type, "ACCEL") > 0
2627
checks:
2728
- sidecar.ACCELChannelCount == count(associations.channels.type, "ACCEL")
2829

2930
GYROChannelCountReq:
3031
selectors:
3132
- suffix == "nirs"
33+
- count(associations.channels.type, "GYRO") > 0
3234
checks:
3335
- sidecar.GYROChannelCount == count(associations.channels.type, "GYRO")
3436

3537
MAGNChannelCountReq:
3638
selectors:
3739
- suffix == "nirs"
40+
- count(associations.channels.type, "MAGN") > 0
3841
checks:
3942
- sidecar.MAGNChannelCount == count(associations.channels.type, "MAGN")
4043

4144
ShortChannelCountReq:
4245
selectors:
4346
- suffix == "nirs"
47+
- '"ShortChannelCount" in sidecar'
4448
checks:
4549
- sidecar.ShortChannelCount == count(associations.channels.short_channel, "true")
4650

@@ -53,11 +57,15 @@ Component:
5357
checks:
5458
- columns.component != null
5559

56-
RequiredChannels:
60+
RecommendedChannels:
61+
issue:
62+
code: NIRS_RECOMMENDED_CHANNELS
63+
message: |
64+
NIRS files SHOULD have an associated channels.tsv file.
65+
level: warning
5766
selectors:
58-
- datatype == "nirs"
59-
- suffix == "optodes"
60-
- extension == ".tsv"
67+
- suffix == "nirs"
68+
- extension == ".snirf"
6169
checks:
6270
- associations.channels != null
6371

src/schema/rules/sidecars/nirs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ NirsRequired:
149149
# Following counts required conditions enforced in checks
150150
ACCELChannelCount:
151151
level: optional
152-
level_addendum: required if any channel type is ACC
152+
level_addendum: required if any channel type is ACCEL
153153
GYROChannelCount:
154154
level: optional
155155
level_addendum: required if any channel type is GYRO

0 commit comments

Comments
 (0)