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] Add MEG, func, and fmap metadata tables #1054

Merged
merged 5 commits into from
Apr 8, 2022
Merged
Show file tree
Hide file tree
Changes from 3 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
87 changes: 87 additions & 0 deletions src/schema/rules/sidecars/fmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#
# Groups of related metadata fields
#
# Assumptions: never need disjunction of selectors
# Assumptions: top-to-bottom overrides is sufficient logic


---
# Fieldmap data
MRIFieldmapB0FieldIdentifier:
selectors:
- modality == "MRI"
- datatype == "fmap"
fields:
B0FieldIdentifier: RECOMMENDED

MRIFieldmapIntendedFor:
selectors:
- modality == "MRI"
- datatype == "fmap"
fields:
IntendedFor:
level: OPTIONAL
addendum: |
This field is OPTIONAL, and in case the fieldmaps do not correspond
to any particular scans, it does not have to be filled.

# Case 1: Phase-difference map and at least one magnitude image
MRIFieldmapPhaseDifferencePhasediff:
selectors:
- modality == "MRI"
- datatype == "fmap"
- suffix == "phasediff"
fields:
EchoTime1: REQUIRED
EchoTime2: REQUIRED

MRIFieldmapPhaseDifferenceMagnitude1:
selectors:
- modality == "MRI"
- datatype == "fmap"
- suffix == "magnitude1"
fields:
EchoTime1: REQUIRED

MRIFieldmapPhaseDifferenceMagnitude2:
selectors:
- modality == "MRI"
- datatype == "fmap"
- suffix == "magnitude2"
fields:
EchoTime2: REQUIRED

# Case 2: Two phase maps and two magnitude images
# NOTE: Need to check for presence of related files.
# For example, magnitude1 needs EchoTime__fmap only if phase1 file exists,
# but EchoTime1 if phasediff exists.
MRIFieldmapTwoPhase:
selectors:
- modality == "MRI"
- datatype == "fmap"
- suffix in ["phase1", "phase2", "magnitude1", "magnitude2"]
fields:
EchoTime__fmap: REQUIRED

# Case 3: Direct field mapping
MRIFieldmapDirectFieldMapping:
selectors:
- modality == "MRI"
- datatype == "fmap"
- suffix in ["phase", "fieldmap"]
fields:
Units:
level: REQUIRED
addendum: |
Fieldmaps must be in units of Hertz (`"Hz"`),
radians per second (`"rad/s"`), or Tesla (`"T"`).

# Case 4: Multiple phase encoded directions ("pepolar")
MRIFieldmapPepolar:
selectors:
- modality == "MRI"
- datatype == "fmap"
- suffix == "epi"
fields:
PhaseEncodingDirection: REQUIRED
TotalReadoutTime: REQUIRED
105 changes: 105 additions & 0 deletions src/schema/rules/sidecars/func.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
#
# Groups of related metadata fields
#
# Assumptions: never need disjunction of selectors
# Assumptions: top-to-bottom overrides is sufficient logic


---
# Task imaging data

# Required fields
MRIFuncRequired:
selectors:
- modality == "MRI"
- datatype == "func"
fields:
RepetitionTime: REQUIRED
VolumeTiming: REQUIRED
TaskName:
level: REQUIRED
addendum: |
A RECOMMENDED convention is to name resting state task using labels
beginning with `rest`.

# Timing Parameters
MRIFuncTimingParameters:
selectors:
- modality == "MRI"
- datatype == "func"
fields:
NumberOfVolumesDiscardedByScanner: RECOMMENDED
NumberOfVolumesDiscardedByUser: RECOMMENDED
DelayTime: RECOMMENDED
AcquisitionDuration:
level: RECOMMENDED
level_addendum: |
REQUIRED for sequences that are described with the `VolumeTiming`
field and that do not have the `SliceTiming` field set to allow for
accurate calculation of "acquisition time"
DelayAfterTrigger: RECOMMENDED

# The mutual exclusion table, spread across 5 definitions
MRIFuncTimingParametersMutualExclusion1:
selectors:
- modality == "MRI"
- datatype == "func"
- sidecar contains "RepetitionTime"
fields:
AcquisitionDuration: PROHIBITED
VolumeTiming: PROHIBITED

MRIFuncTimingParametersMutualExclusion2:
selectors:
- modality == "MRI"
- datatype == "func"
- sidecar contains "SliceTiming"
- sidecar contains "VolumeTiming"
fields:
RepetitionTime: PROHIBITED
DelayTime: PROHIBITED
Comment on lines +53 to +61
Copy link
Member Author

@tsalo tsalo Apr 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably worth discussing. New PROHIBITED level.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I'll just add a note to the HackMD.


MRIFuncTimingParametersMutualExclusion3:
selectors:
- modality == "MRI"
- datatype == "func"
- sidecar contains "AcquisitionDuration"
- sidecar contains "VolumeTiming"
fields:
RepetitionTime: PROHIBITED
DelayTime: PROHIBITED

MRIFuncTimingParametersMutualExclusion4:
selectors:
- modality == "MRI"
- datatype == "func"
- sidecar contains "RepetitionTime"
- sidecar contains "SliceTiming"
fields:
AcquisitionDuration: PROHIBITED
VolumeTiming: PROHIBITED

MRIFuncTimingParametersMutualExclusion5:
selectors:
- modality == "MRI"
- datatype == "func"
- sidecar contains "RepetitionTime"
- sidecar contains "DelayTime"
fields:
AcquisitionDuration: PROHIBITED
VolumeTiming: PROHIBITED

# fMRI task information
MRIFuncTaskInformation:
selectors:
- modality == "MRI"
- datatype == "func"
fields:
Instructions:
level: RECOMMENDED
addendum: |
This is especially important in context of resting state recordings and
distinguishing between eyes open and eyes closed paradigms.
TaskDescription: RECOMMENDED
CogAtlasID: RECOMMENDED
CogPOID: RECOMMENDED
Loading