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

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

Merged
merged 2 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
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
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
Copy link
Member

Choose a reason for hiding this comment

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

Isn't reconstruction a within-acquisition entity? Like you can have rec-defaced and rec-refaced versions of a file, but they come from the same acquisition, so you wouldn't have separate events files for each one.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's currently permitted for MRI. I don't have a strong commitment to this, though.

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