Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCHEMA: Define associated data with selectors, path components and inheritance #1548

Merged
merged 2 commits into from
Jul 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions src/schema/meta/associations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# These rules indicate whether an association (defined in meta.context.context.associations)
# applies to a given file. These are hints to allow implementations to avoid unnecessary
# directory and file reads.
#
# Structure:
#
# - "selectors" is a sequence of expressions that apply to a file that may have an association.
# If matched, a tool MUST attempt to find the associated file.
# - "target" contains a set of path components that may be used to search for the associated file.
# These override the path components of the original file and MUST match for the associated file.
# A list of values, such as extensions, indicates multiple possible matches.
# - "inherit" is a boolean indicating whether the associated file may be found at a shallower level
# of the hierarchy.
---
events:
selectors:
- 'task in entities'
- extension != '.json'
target:
suffix: events
extension: .tsv
inherit: true

aslcontext:
selectors:
- suffix == 'asl'
- matches(extension, '\.nii(\.gz)?$')
target:
suffix: aslcontext
extension: .tsv
inherit: true

m0scan:
selectors:
- suffix == 'asl'
- matches(extension, '\.nii(\.gz)?$')
target:
suffix: m0scan
extension: [.nii, .nii.gz]
inherit: false

magnitude:
selectors:
- suffix == 'fieldmap'
- matches(extension, '\.nii(\.gz)?$')
target:
suffix: magnitude
extension: [.nii, .nii.gz]
inherit: false

magnitude1:
selectors:
- matches(suffix, 'phase(diff|1)$')
- matches(extension, '\.nii(\.gz)?$')
target:
suffix: magnitude1
extension: [.nii, .nii.gz]
inherit: false

bval:
selectors:
- suffix == 'dwi'
- matches(extension, '\.nii(\.gz)?$')
target:
extension: .bval
inherit: true

bvec:
selectors:
- suffix == 'dwi'
- matches(extension, '\.nii(\.gz)?$')
target:
extension: .bvec
inherit: true

channels:
selectors:
- intersects([suffix], ['eeg', 'ieeg', 'meg', 'nirs', 'motion', 'optodes'])
- extension != '.json'
target:
suffix: channels
extension: .tsv
inherit: true

coordsystem:
selectors:
- intersects([suffix], ['eeg', 'ieeg', 'meg', 'nirs', 'motion', 'electrodes', 'optodes'])
- extension != '.json'
target:
suffix: coordsystem
extension: .json
inherit: true