Skip to content

Commit

Permalink
FIX: Add MRS events files, restrict sidecar metadata checks to data f…
Browse files Browse the repository at this point in the history
…iles (#1875)

* FIX: Add MRS events files, restrict sidecar metadata checks to data files

* FIX: Do not limit suffixes for filename template
  • Loading branch information
effigies authored Jul 25, 2024
1 parent b0bea61 commit 1ef102b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The inputs for this macro can be found in the directory
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
-->
{{ MACROS___make_filename_template("raw", datatypes=["mrs"], suffixes=["svs", "mrsi", "unloc", "mrsref"]) }}
{{ MACROS___make_filename_template("raw", datatypes=["mrs"]) }}

MRS is a spectroscopic technique based on the phenomenon of nuclear magnetic resonance
that allows for the noninvasive detection and quantification of molecules in biochemical samples, such as brain tissue.
Expand Down
10 changes: 10 additions & 0 deletions src/schema/rules/files/raw/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,16 @@ events__pet:
reconstruction: optional
run: optional

events__mrs:
$ref: rules.files.raw.task.events
datatypes:
- mrs
entities:
$ref: rules.files.raw.task.events.entities
reconstruction: optional
nucleus: optional
volume: optional

timeseries__func:
$ref: rules.files.raw.task.timeseries
datatypes:
Expand Down
13 changes: 13 additions & 0 deletions src/schema/rules/sidecars/mrs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
MRSScannerHardware:
selectors:
- modality == "mrs"
- match(extension, "^\.nii(\.gz)?$")
fields:
InstitutionName: recommended
InstitutionAddress: recommended
Expand All @@ -27,6 +28,7 @@ MRSScannerHardware:
MRSSample:
selectors:
- modality == "mrs"
- match(extension, "^\.nii(\.gz)?$")
fields:
BodyPart:
level: optional
Expand All @@ -40,6 +42,7 @@ MRSSample:
MRSSampleVOI:
selectors:
- modality == "mrs"
- match(extension, "^\.nii(\.gz)?$")
- '"volume" in entities'
fields:
BodyPart: required
Expand All @@ -48,6 +51,7 @@ MRSSampleVOI:
MRSSequenceSpecifics:
selectors:
- modality == "mrs"
- match(extension, "^\.nii(\.gz)?$")
fields:
PulseSequenceType:
level: recommended
Expand All @@ -65,6 +69,7 @@ MRSSequenceSpecifics:
MRSRequiredFields:
selectors:
- modality == "mrs"
- match(extension, "^\.nii(\.gz)?$")
fields:
ResonantNucleus: required
SpectrometerFrequency: required
Expand All @@ -74,6 +79,7 @@ MRSRequiredFields:
MRSRecommendedFields:
selectors:
- modality == "mrs"
- match(extension, "^\.nii(\.gz)?$")
fields:
NumberOfSpectralPoints: recommended
MixingTime: recommended
Expand All @@ -84,6 +90,7 @@ MRSRecommendedFields:
MRSRepetitionTime:
selectors:
- modality == "mrs"
- match(extension, "^\.nii(\.gz)?$")
- '!("VolumeTiming" in sidecar)'
fields:
RepetitionTime:
Expand All @@ -93,6 +100,7 @@ MRSRepetitionTime:
MRSVolumeTiming:
selectors:
- modality == "mrs"
- match(extension, "^\.nii(\.gz)?$")
- '!("RepetitionTime" in sidecar)'
fields:
VolumeTiming:
Expand All @@ -102,6 +110,7 @@ MRSVolumeTiming:
MRSConditionalInversionTime:
selectors:
- modality == "mrs"
- match(extension, "^\.nii(\.gz)?$")
- entities.inversion
fields:
InversionTime:
Expand All @@ -111,6 +120,7 @@ MRSConditionalInversionTime:
MRSConditionalAnatomicalImage:
selectors:
- modality == "mrs"
- match(extension, "^\.nii(\.gz)?$")
- intersects(dataset.datatypes, ["anat"])
fields:
AnatomicalImage:
Expand All @@ -120,6 +130,7 @@ MRSConditionalAnatomicalImage:
MRSConditionalNumTransients:
selectors:
- modality == "mrs"
- match(extension, "^\.nii(\.gz)?$")
- intersects([suffix], ["svs", "unloc"])
fields:
NumberOfTransients:
Expand All @@ -129,6 +140,7 @@ MRSConditionalNumTransients:
MRSIRecommendedFields:
selectors:
- modality == "mrs"
- match(extension, "^\.nii(\.gz)?$")
- suffix == "mrsi"
fields:
MRAcquisitionType:
Expand All @@ -147,6 +159,7 @@ MRSIRecommendedFields:
MRSOptionalFields:
selectors:
- modality == "mrs"
- match(extension, "^\.nii(\.gz)?$")
fields:
ChemicalShiftOffset: optional
ChemicalShiftReference: optional
Expand Down

0 comments on commit 1ef102b

Please sign in to comment.