From 1ef102b9fa579d0237183c9cdf1d78ab02cbd511 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Thu, 25 Jul 2024 19:23:10 -0400 Subject: [PATCH] FIX: Add MRS events files, restrict sidecar metadata checks to data files (#1875) * FIX: Add MRS events files, restrict sidecar metadata checks to data files * FIX: Do not limit suffixes for filename template --- .../magnetic-resonance-spectroscopy.md | 2 +- src/schema/rules/files/raw/task.yaml | 10 ++++++++++ src/schema/rules/sidecars/mrs.yaml | 13 +++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/modality-specific-files/magnetic-resonance-spectroscopy.md b/src/modality-specific-files/magnetic-resonance-spectroscopy.md index d5a0d992ac..22ec6540e0 100644 --- a/src/modality-specific-files/magnetic-resonance-spectroscopy.md +++ b/src/modality-specific-files/magnetic-resonance-spectroscopy.md @@ -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. diff --git a/src/schema/rules/files/raw/task.yaml b/src/schema/rules/files/raw/task.yaml index b7171e568f..812765a063 100644 --- a/src/schema/rules/files/raw/task.yaml +++ b/src/schema/rules/files/raw/task.yaml @@ -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: diff --git a/src/schema/rules/sidecars/mrs.yaml b/src/schema/rules/sidecars/mrs.yaml index 75fe94bd2b..28796eb5e4 100644 --- a/src/schema/rules/sidecars/mrs.yaml +++ b/src/schema/rules/sidecars/mrs.yaml @@ -9,6 +9,7 @@ MRSScannerHardware: selectors: - modality == "mrs" + - match(extension, "^\.nii(\.gz)?$") fields: InstitutionName: recommended InstitutionAddress: recommended @@ -27,6 +28,7 @@ MRSScannerHardware: MRSSample: selectors: - modality == "mrs" + - match(extension, "^\.nii(\.gz)?$") fields: BodyPart: level: optional @@ -40,6 +42,7 @@ MRSSample: MRSSampleVOI: selectors: - modality == "mrs" + - match(extension, "^\.nii(\.gz)?$") - '"volume" in entities' fields: BodyPart: required @@ -48,6 +51,7 @@ MRSSampleVOI: MRSSequenceSpecifics: selectors: - modality == "mrs" + - match(extension, "^\.nii(\.gz)?$") fields: PulseSequenceType: level: recommended @@ -65,6 +69,7 @@ MRSSequenceSpecifics: MRSRequiredFields: selectors: - modality == "mrs" + - match(extension, "^\.nii(\.gz)?$") fields: ResonantNucleus: required SpectrometerFrequency: required @@ -74,6 +79,7 @@ MRSRequiredFields: MRSRecommendedFields: selectors: - modality == "mrs" + - match(extension, "^\.nii(\.gz)?$") fields: NumberOfSpectralPoints: recommended MixingTime: recommended @@ -84,6 +90,7 @@ MRSRecommendedFields: MRSRepetitionTime: selectors: - modality == "mrs" + - match(extension, "^\.nii(\.gz)?$") - '!("VolumeTiming" in sidecar)' fields: RepetitionTime: @@ -93,6 +100,7 @@ MRSRepetitionTime: MRSVolumeTiming: selectors: - modality == "mrs" + - match(extension, "^\.nii(\.gz)?$") - '!("RepetitionTime" in sidecar)' fields: VolumeTiming: @@ -102,6 +110,7 @@ MRSVolumeTiming: MRSConditionalInversionTime: selectors: - modality == "mrs" + - match(extension, "^\.nii(\.gz)?$") - entities.inversion fields: InversionTime: @@ -111,6 +120,7 @@ MRSConditionalInversionTime: MRSConditionalAnatomicalImage: selectors: - modality == "mrs" + - match(extension, "^\.nii(\.gz)?$") - intersects(dataset.datatypes, ["anat"]) fields: AnatomicalImage: @@ -120,6 +130,7 @@ MRSConditionalAnatomicalImage: MRSConditionalNumTransients: selectors: - modality == "mrs" + - match(extension, "^\.nii(\.gz)?$") - intersects([suffix], ["svs", "unloc"]) fields: NumberOfTransients: @@ -129,6 +140,7 @@ MRSConditionalNumTransients: MRSIRecommendedFields: selectors: - modality == "mrs" + - match(extension, "^\.nii(\.gz)?$") - suffix == "mrsi" fields: MRAcquisitionType: @@ -147,6 +159,7 @@ MRSIRecommendedFields: MRSOptionalFields: selectors: - modality == "mrs" + - match(extension, "^\.nii(\.gz)?$") fields: ChemicalShiftOffset: optional ChemicalShiftReference: optional