From 16609f2bf40e5745898bfccc3ec6d723369d871d Mon Sep 17 00:00:00 2001 From: Taylor Salo Date: Thu, 30 Nov 2023 11:24:43 -0500 Subject: [PATCH] Add ASL support (#839) * Add "asl" to list of non-standard spaces. * Add "asl" to data collection. * Add ASL-related filename patterns to config. * Drop m0scan from fmap pattern. --- niworkflows/data/nipreps.json | 6 +++++- niworkflows/interfaces/bids.py | 3 ++- niworkflows/utils/bids.py | 1 + niworkflows/utils/spaces.py | 1 + 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/niworkflows/data/nipreps.json b/niworkflows/data/nipreps.json index 01f32f20011..1143dc7f601 100644 --- a/niworkflows/data/nipreps.json +++ b/niworkflows/data/nipreps.json @@ -87,7 +87,7 @@ }, { "name": "datatype", - "pattern": "[/\\\\]+(func|anat|fmap|dwi|meg|eeg|figures)[/\\\\]+" + "pattern": "[/\\\\]+(func|anat|fmap|dwi|meg|eeg|perf|figures)[/\\\\]+" }, { "name": "extension", @@ -172,6 +172,10 @@ "sub-{subject}[/ses-{session}]/{datatype|dwi}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_rec-{reconstruction}][_dir-{direction}][_run-{run}][_space-{space}][_cohort-{cohort}][_res-{resolution}]_desc-{desc}_{suffix}{extension<.json|.nii.gz|.nii>|.nii.gz}", "sub-{subject}[/ses-{session}]/{datatype|dwi}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_rec-{reconstruction}][_dir-{direction}][_run-{run}][_space-{space}][_cohort-{cohort}][_res-{resolution}][_desc-{desc}]_{suffix}{extension<.tsv|.bval|.bvec|.b>|.tsv}", "sub-{subject}[/ses-{session}]/{datatype|dwi}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_rec-{reconstruction}][_dir-{direction}][_run-{run}]_from-{from}_to-{to}_mode-{mode|image}[_desc-{desc}]_{suffix|xfm}{extension<.txt|.h5>}", + "sub-{subject}[/ses-{session}]/{datatype|perf}/sub-{subject}[_ses-{session}][_task-{task}][_acq-{acquisition}][_rec-{reconstruction}][_dir-{direction}][_run-{run}]_{suffix}{extension<.tsv|.json>|.tsv}", + "sub-{subject}[/ses-{session}]/{datatype|perf}/sub-{subject}[_ses-{session}][_task-{task}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_dir-{direction}][_run-{run}]_from-{from}_to-{to}_mode-{mode|image}_{suffix|xfm}{extension<.txt|.h5>}", + "sub-{subject}[/ses-{session}]/{datatype|perf}/sub-{subject}[_ses-{session}][_task-{task}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_dir-{direction}][_run-{run}][_space-{space}][_atlas-{atlas}][_cohort-{cohort}][_desc-{desc}]_{suffix}{extension<.json|.tsv>|.tsv}", + "sub-{subject}[/ses-{session}]/{datatype|perf}/sub-{subject}[_ses-{session}][_task-{task}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_dir-{direction}][_run-{run}][_space-{space}][_atlas-{atlas}][_cohort-{cohort}][_desc-{desc}]_{suffix}{extension<.nii|.nii.gz|.json|.tsv>|.tsv}", "sub-{subject}[/ses-{session}]/{datatype|fmap}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_dir-{direction}][_run-{run}][_part-{part}][_space-{space}][_cohort-{cohort}][_res-{resolution}][_fmapid-{fmapid}][_desc-{desc}]_{suffix}{extension<.nii|.nii.gz|.json>|.nii.gz}", "sub-{subject}/{datatype}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_run-{run}][_space-{space}][_cohort-{cohort}][_desc-{desc}]_{suffix}{extension<.html|.svg>|.svg}", "sub-{subject}/{datatype}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_run-{run}][_space-{space}][_cohort-{cohort}][_fmapid-{fmapid}][_desc-{desc}]_{suffix}{extension<.html|.svg>|.svg}", diff --git a/niworkflows/interfaces/bids.py b/niworkflows/interfaces/bids.py index 409831f75a6..21a4e43f4a0 100644 --- a/niworkflows/interfaces/bids.py +++ b/niworkflows/interfaces/bids.py @@ -227,6 +227,7 @@ class _BIDSDataGrabberOutputSpec(TraitedSpec): flair = OutputMultiObject(desc="output FLAIR images") pet = OutputMultiObject(desc="output PET images") dwi = OutputMultiObject(desc="output DWI images") + asl = OutputMultiObject(desc="output ASL images") class BIDSDataGrabber(SimpleInterface): @@ -278,7 +279,7 @@ def _run_interface(self, runtime): ) ) - for imtype in ["bold", "t2w", "flair", "fmap", "sbref", "roi", "pet"]: + for imtype in ["bold", "t2w", "flair", "fmap", "sbref", "roi", "pet", "asl"]: if not bids_dict[imtype]: LOGGER.info( 'No "%s" images found for sub-%s', imtype, self.inputs.subject_id diff --git a/niworkflows/utils/bids.py b/niworkflows/utils/bids.py index c642ef5fd1e..fdcfbd586f3 100644 --- a/niworkflows/utils/bids.py +++ b/niworkflows/utils/bids.py @@ -40,6 +40,7 @@ "sbref": {"datatype": "func", "suffix": "sbref", "part": ["mag", None]}, "t1w": {"datatype": "anat", "suffix": "T1w", "part": ["mag", None]}, "t2w": {"datatype": "anat", "suffix": "T2w", "part": ["mag", None]}, + "asl": {"datatype": "perf", "suffix": "asl"}, } diff --git a/niworkflows/utils/spaces.py b/niworkflows/utils/spaces.py index 2f014ccbd21..5fddda253a4 100644 --- a/niworkflows/utils/spaces.py +++ b/niworkflows/utils/spaces.py @@ -38,6 +38,7 @@ "session", "individual", "dwi", + "asl", ] """List of supported nonstandard reference spaces."""