Skip to content

Conversation

effigies
Copy link
Contributor

@effigies effigies commented Sep 12, 2025

@effigies effigies added the bep label Sep 12, 2025
@effigies
Copy link
Contributor Author

@rwblair @julia-pfarr I think that this approach (of having a physio association for events) won't work. The examples show an empty /task-rest_events.tsv file at the root, while physio.tsv.gz will always be at the leaf. Inheritance can only walk toward the root.

Unfortunately, this means we can't use normal sidecar rules to indicate that the error should be fixed in a particular events.json file, and I don't see a way to do that using checks, since, again, we only have access to the current context.

If we want to think about expanding schema/validator capabilities, we could allow message to be interpolated with the context object, e.g.

EyetrackingStimulusPresentation:
  issue:
    code: JSON_KEY_MISSING
    level: error
    message: |
      `StimulusPresentation` metadata for the events file associated with {path}
      ({associations.events.path}) must have `ScreenDistance`, `ScreenOrigin`,
      `ScreenResolution` and `ScreenSize` fields.
  selectors:
    - suffix == 'physio'
    - sidecar.PhysioType == 'eyetrack'
  checks:
    - 'ScreenDistance' in associations.events.sidecar.StimulusPresentation
    - 'ScreenOrigin' in associations.events.sidecar.StimulusPresentation
    - 'ScreenResolution' in associations.events.sidecar.StimulusPresentation
    - 'ScreenSize' in associations.events.sidecar.StimulusPresentation

It looks like there are a couple JS libraries to implement Python-like str.format(), which should be good enough for our use case.

@julia-pfarr
Copy link
Member

julia-pfarr commented Sep 15, 2025

Yes, I think the empty events.tsv file comes from the fact that in BEP020 we say that there must be an events.tsv file present but combining eyetracking with rest-fmri is a kind of "exception" because no events.

As for your solution for the validator, I can't say much because I don't know the technical details of the validator, but I trust you that this is good solution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants