Skip to content

Commit fb1f802

Browse files
Fix SIDECAR_WITHOUT_DATAFILE for EMG coordsystem files
The previous selector used 'modality != emg' which did not work for coordsystem files because modality is not reliably set for these files. This fix excludes coordsystem files when: - datatype is 'emg' (files in emg/ directory), OR - the file has a space entity (e.g., space-leftForearm_coordsystem.json) The second condition allows root-level coordsystem files with space entities to pass validation. These are used in EMG datasets where coordinate systems are shared across subjects and sessions. Example valid patterns: - /space-leftForearm_coordsystem.json (root level, no sub/ses entities) - /sub-01/emg/sub-01_space-hand_coordsystem.json (subject level)
1 parent 57d7711 commit fb1f802

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/schema/rules/errors.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,9 @@ SidecarWithoutDatafile:
142142
level: error
143143
selectors:
144144
- extension == ".json"
145-
- suffix != "coordsystem" || modality != "emg"
145+
- suffix != "coordsystem" || !(datatype == "emg" || entities.space)
146146
# ↑ EMG allows multiple coordsys files per data file (distinguished via `space` entity)
147+
# ↑ Also excludes root-level coordsys files with `space` entity (inherited by all sessions)
147148

148149
# BIDS Validator Original Issue Code #97
149150
MissingSession:

0 commit comments

Comments
 (0)