From b7aa992a36a92b6292e5ba289efff2cde6ba2fa3 Mon Sep 17 00:00:00 2001 From: mathiasg Date: Mon, 17 Oct 2022 13:20:58 -0400 Subject: [PATCH 1/2] ENH: Add morphometric suffixes to pattern matching --- niworkflows/interfaces/surf.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/niworkflows/interfaces/surf.py b/niworkflows/interfaces/surf.py index 1c6b11e8319..d0db17297cb 100644 --- a/niworkflows/interfaces/surf.py +++ b/niworkflows/interfaces/surf.py @@ -154,13 +154,19 @@ class Path2BIDS(SimpleInterface): suffix = smoothwm + >>> Path2BIDS(in_file='lh.sulc_converted.gii').run().outputs + + extension = .gii + hemi = L + suffix = sulc + """ input_spec = _Path2BIDSInputSpec output_spec = _Path2BIDSOutputSpec _pattern = re.compile( r"(?P[lr])h.(?P(wm|smoothwm|pial|midthickness|" - r"inflated|vinflated|sphere|flat))[\w\d_-]*(?P\.\w+)?" + r"inflated|vinflated|sphere|flat|sulc|curv|thickness))[\w\d_-]*(?P\.\w+)?" ) _excluded = ("extprefix",) From a46f5d9ad933437289c38bdb2f0a0c90ebee1a0d Mon Sep 17 00:00:00 2001 From: mathiasg Date: Mon, 17 Oct 2022 14:51:56 -0400 Subject: [PATCH 2/2] ENH: Add morphometrics to BIDS patterns --- niworkflows/data/nipreps.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/niworkflows/data/nipreps.json b/niworkflows/data/nipreps.json index 50d7a1c4402..ee481eee49b 100644 --- a/niworkflows/data/nipreps.json +++ b/niworkflows/data/nipreps.json @@ -154,7 +154,7 @@ "default_path_patterns": [ "sub-{subject}[/ses-{session}]/{datatype|anat}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_run-{run}][_space-{space}][_cohort-{cohort}][_res-{resolution}][_desc-{desc}]_{suffix}{extension<.nii|.nii.gz|.json>|.nii.gz}", "sub-{subject}[/ses-{session}]/{datatype|anat}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_run-{run}]_from-{from}_to-{to}_mode-{mode|image}_{suffix|xfm}{extension<.txt|.h5>}", - "sub-{subject}[/ses-{session}]/{datatype|anat}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_run-{run}]_hemi-{hemi}[_space-{space}][_cohort-{cohort}][_den-{density}]_{suffix}{extension<.surf.gii>}", + "sub-{subject}[/ses-{session}]/{datatype|anat}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_run-{run}]_hemi-{hemi}[_space-{space}][_cohort-{cohort}][_den-{density}]_{suffix}{extension<.surf.gii|.shape.gii>}", "sub-{subject}[/ses-{session}]/{datatype|anat}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_run-{run}][_space-{space}][_cohort-{cohort}][_res-{resolution}]_desc-{desc}_{suffix|mask}{extension<.nii|.nii.gz|.json>|.nii.gz}", "sub-{subject}[/ses-{session}]/{datatype|anat}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_run-{run}][_space-{space}][_cohort-{cohort}][_res-{resolution}]_label-{label}[_desc-{desc}]_{suffix|probseg}{extension<.nii|.nii.gz|.json>|.nii.gz}", "sub-{subject}[/ses-{session}]/{datatype|func}/sub-{subject}[_ses-{session}]_task-{task}[_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_dir-{direction}][_run-{run}][_echo-{echo}][_part-{part}][_space-{space}][_cohort-{cohort}][_res-{resolution}][_desc-{desc}]_{suffix}{extension<.nii|.nii.gz|.json>|.nii.gz}",