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 YAML tables for DWI/ASL/(i)EEG/micr/beh metadata #1029

Merged
18 changes: 18 additions & 0 deletions src/schema/rules/sidecars/anat.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# Groups of related metadata fields
#
# Assumptions: never need disjunction of selectors
# Assumptions: top-to-bottom overrides is sufficient logic


---
# Anatomy imaging data

MRIAnatomyCommonMetadataFields:
selectors:
- modality == "MRI"
- datatype == "anat"
fields:
ContrastBolusIngredient: OPTIONAL
RepetitionTimeExcitation: OPTIONAL
RepetitionTimePreparation: OPTIONAL
197 changes: 197 additions & 0 deletions src/schema/rules/sidecars/asl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
#
# Groups of related metadata fields
#
# Assumptions: never need disjunction of selectors
# Assumptions: top-to-bottom overrides is sufficient logic


---
# Fields described in text, but not in tables
MRIASLTextOnly:
selectors:
- modality == "MRI"
- datatype == "perf"
- suffix == "asl"
fields:
MagneticFieldStrength: REQUIRED
MRAcquisitionType: REQUIRED
EchoTime: REQUIRED
SliceTiming:
level: RECOMMENDED
level_addendum: REQUIRED if `MRAcquisitionType` is defined as `2D`
RepetitionTimePreparation: REQUIRED
FlipAngle:
level: RECOMMENDED
level_addendum: REQUIRED if `LookLocker` is `true`

MRIASLTextOnlySliceTiming:
selectors:
- modality == "MRI"
- datatype == "perf"
- suffix == "asl"
- sidecar.MRAcquisitionType == "2D"
fields:
SliceTiming: REQUIRED

MRIASLTextOnlyFlipAngle:
selectors:
- modality == "MRI"
- datatype == "perf"
- suffix == "asl"
- sidecar.LookLocker == true
fields:
FlipAngle: REQUIRED

# Common metadata fields applicable to both (P)CASL and PASL
MRIASLCommonMetadataFields:
selectors:
- modality == "MRI"
- datatype == "perf"
- suffix == "asl"
fields:
ArterialSpinLabelingType: REQUIRED
PostLabelingDelay: REQUIRED
BackgroundSuppression: REQUIRED
M0Type: REQUIRED
TotalAcquiredPairs: REQUIRED
VascularCrushing: RECOMMENDED
AcquisitionVoxelSize: RECOMMENDED
M0Estimate:
level: OPTIONAL
level_addendum: REQUIRED if `M0Type` is `Estimate`
BackgroundSuppressionNumberPulses:
level: OPTIONAL
level_addendum: RECOMMENDED if `BackgroundSuppression` is `true`
BackgroundSuppressionPulseTime:
level: OPTIONAL
level_addendum: RECOMMENDED if `BackgroundSuppression` is `true`
VascularCrushingVENC:
level: OPTIONAL
level_addendum: RECOMMENDED if `VascularCrushing` is `true`
LabelingOrientation: RECOMMENDED
LabelingDistance: RECOMMENDED
LabelingLocationDescription: RECOMMENDED
LookLocker: OPTIONAL
LabelingEfficiency: OPTIONAL

MRIASLCommonMetadataFieldsM0Type:
selectors:
- modality == "MRI"
- datatype == "perf"
- suffix == "asl"
- sidecar.M0Type == "Estimate"
fields:
M0Estimate: REQUIRED

MRIASLCommonMetadataFieldsBackgroundSuppression:
selectors:
- modality == "MRI"
- datatype == "perf"
- suffix == "asl"
- sidecar.BackgroundSuppression == true
fields:
BackgroundSuppressionNumberPulses: RECOMMENDED
BackgroundSuppressionPulseTime: RECOMMENDED

MRIASLCommonMetadataFieldsVascularCrushing:
selectors:
- modality == "MRI"
- datatype == "perf"
- suffix == "asl"
- sidecar.VascularCrushing == true
fields:
VascularCrushingVENC: RECOMMENDED

MRIASLPCASLSpecific:
selectors:
- modality == "MRI"
- datatype == "perf"
- suffix == "asl"
- sidecar.ArterialSpinLabelingType in ["CASL", "PCASL"]
fields:
LabelingDuration: REQUIRED
LabelingPulseAverageGradient: RECOMMENDED
LabelingPulseMaximumGradient: RECOMMENDED
LabelingPulseAverageB1: RECOMMENDED
LabelingPulseDuration: RECOMMENDED
LabelingPulseFlipAngle: RECOMMENDED
LabelingPulseInterval: RECOMMENDED

MRIASLPCASLSpecific2:
selectors:
- modality == "MRI"
- datatype == "perf"
- suffix == "asl"
- sidecar.ArterialSpinLabelingType == "PCASL"
fields:
PCASLType: RECOMMENDED

MRIASLCASLSpecific:
selectors:
- modality == "MRI"
- datatype == "perf"
- suffix == "asl"
- sidecar.ArterialSpinLabelingType == "CASL"
fields:
CASLType: RECOMMENDED

MRIASLPASLSpecific:
selectors:
- modality == "MRI"
- datatype == "perf"
- suffix == "asl"
- sidecar.ArterialSpinLabelingType == "PASL"
fields:
BolusCutOffFlag: REQUIRED
PASLType: RECOMMENDED
LabelingSlabThickness: RECOMMENDED
BolusCutOffDelayTime:
level: OPTIONAL
level_addendum: REQUIRED if `BolusCutOffFlag` is `true`
BolusCutOffTechnique:
level: OPTIONAL
level_addendum: REQUIRED if `BolusCutOffFlag` is `true`

MRIASLPASLSpecificBolusCutOffFlag:
selectors:
- modality == "MRI"
- datatype == "perf"
- suffix == "asl"
- sidecar.ArterialSpinLabelingType == "PASL"
- sidecar.BolusCutOffFlag == true
fields:
BolusCutOffDelayTime: REQUIRED
BolusCutOffTechnique: REQUIRED

# m0scan metadata fields
MRIASLM0ScanTextOnly:
selectors:
- modality == "MRI"
- datatype == "perf"
- suffix == "m0scan"
fields:
EchoTime: REQUIRED
RepetitionTimePreparation: REQUIRED
FlipAngle:
level: RECOMMENDED
level_addendum: REQUIRED if `LookLocker` is `true`

MRIASLM0ScanTextOnlyFlipAngle:
selectors:
- modality == "MRI"
- datatype == "perf"
- suffix == "m0scan"
- sidecar.LookLocker == true
fields:
FlipAngle: REQUIRED

MRIASLM0Scan:
selectors:
- modality == "MRI"
- datatype == "perf"
- suffix == "m0scan"
fields:
IntendedFor:
level: REQUIRED
addendum: This is used to refer to the ASL time series for which the `*_m0scan.nii[.gz]` is intended.
AcquisitionVoxelSize: RECOMMENDED
21 changes: 21 additions & 0 deletions src/schema/rules/sidecars/beh.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# Groups of related metadata fields
#
# Assumptions: never need disjunction of selectors
# Assumptions: top-to-bottom overrides is sufficient logic


---
# Metadata for either beh or events files
BEHTabularData:
selectors:
- suffix in ["beh", "events"]
fields:
TaskName: RECOMMENDED
Instructions: RECOMMENDED
TaskDescription: RECOMMENDED
CogAtlasID: RECOMMENDED
CogPOID: RECOMMENDED
InstitutionName: RECOMMENDED
InstitutionAddress: RECOMMENDED
InstitutionalDepartmentName: RECOMMENDED
26 changes: 26 additions & 0 deletions src/schema/rules/sidecars/continuous.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#
# Groups of related metadata fields
#
# Assumptions: never need disjunction of selectors
# Assumptions: top-to-bottom overrides is sufficient logic


---
# Metadata for either physio or stim files
Continuous:
selectors:
- suffix in ["physio", "stim"]
fields:
SamplingFrequency: REQUIRED
StartTime: REQUIRED
Columns: REQUIRED

# Other RECOMMENDED metadata for physiological data
Physio:
selectors:
- suffix == "physio"
fields:
Manufacturer: RECOMMENDED
ManufacturersModelName: RECOMMENDED
SoftwareVersions: RECOMMENDED
DeviceSerialNumber: RECOMMENDED
25 changes: 25 additions & 0 deletions src/schema/rules/sidecars/dwi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#
# Groups of related metadata fields
#
# Assumptions: never need disjunction of selectors
# Assumptions: top-to-bottom overrides is sufficient logic


---
# Multipart (split) DWI schemes
# NOTE: I don't think this can be schemafied, since it depends on owner intent.
MRIDiffusionMultipart:
selectors:
- modality == "MRI"
- datatype == "dwi"
fields:
MultipartID: REQUIRED
Comment on lines +10 to +16
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure how we should handle MultipartID, since its requirement level depends on owner knowledge, rather than any validatable elements of the dataset.


# Other RECOMMENDED metadata
MRIDiffusionOtherMetadata:
selectors:
- modality == "MRI"
- datatype == "dwi"
fields:
PhaseEncodingDirection: RECOMMENDED
TotalReadoutTime: RECOMMENDED
Loading