Skip to content

Commit 5b898c4

Browse files
authored
Merge pull request #753 from mgxd/enh/path2bids-regex
ENH: Add morphometric suffixes to pattern matching
2 parents e5fc210 + a46f5d9 commit 5b898c4

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

niworkflows/data/nipreps.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154
"default_path_patterns": [
155155
"sub-{subject}[/ses-{session}]/{datatype<anat>|anat}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_run-{run}][_space-{space}][_cohort-{cohort}][_res-{resolution}][_desc-{desc}]_{suffix<T1w|T2w|T1rho|T1map|T2map|T2starmap|FLAIR|FLASH|PDmap|PD|PDT2|dseg|inplaneT[12]|angio|T2starw|MTw|TSE>}{extension<.nii|.nii.gz|.json>|.nii.gz}",
156156
"sub-{subject}[/ses-{session}]/{datatype<anat>|anat}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_run-{run}]_from-{from}_to-{to}_mode-{mode<image|points>|image}_{suffix<xfm>|xfm}{extension<.txt|.h5>}",
157-
"sub-{subject}[/ses-{session}]/{datatype<anat>|anat}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_run-{run}]_hemi-{hemi<L|R>}[_space-{space}][_cohort-{cohort}][_den-{density}]_{suffix<wm|smoothwm|pial|midthickness|inflated|vinflated|sphere|flat>}{extension<.surf.gii>}",
157+
"sub-{subject}[/ses-{session}]/{datatype<anat>|anat}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_run-{run}]_hemi-{hemi<L|R>}[_space-{space}][_cohort-{cohort}][_den-{density}]_{suffix<wm|smoothwm|pial|midthickness|inflated|vinflated|sphere|flat|sulc|curv|thickness>}{extension<.surf.gii|.shape.gii>}",
158158
"sub-{subject}[/ses-{session}]/{datatype<anat>|anat}/sub-{subject}[_ses-{session}][_acq-{acquisition}][_ce-{ceagent}][_rec-{reconstruction}][_run-{run}][_space-{space}][_cohort-{cohort}][_res-{resolution}]_desc-{desc}_{suffix<mask>|mask}{extension<.nii|.nii.gz|.json>|.nii.gz}",
159159
"sub-{subject}[/ses-{session}]/{datatype<anat>|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>|probseg}{extension<.nii|.nii.gz|.json>|.nii.gz}",
160160
"sub-{subject}[/ses-{session}]/{datatype<func>|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<bold|cbv|sbref|boldref|dseg>}{extension<.nii|.nii.gz|.json>|.nii.gz}",

niworkflows/interfaces/surf.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,19 @@ class Path2BIDS(SimpleInterface):
154154
suffix = smoothwm
155155
<BLANKLINE>
156156
157+
>>> Path2BIDS(in_file='lh.sulc_converted.gii').run().outputs
158+
<BLANKLINE>
159+
extension = .gii
160+
hemi = L
161+
suffix = sulc
162+
<BLANKLINE>
157163
"""
158164

159165
input_spec = _Path2BIDSInputSpec
160166
output_spec = _Path2BIDSOutputSpec
161167
_pattern = re.compile(
162168
r"(?P<hemi>[lr])h.(?P<suffix>(wm|smoothwm|pial|midthickness|"
163-
r"inflated|vinflated|sphere|flat))[\w\d_-]*(?P<extprefix>\.\w+)?"
169+
r"inflated|vinflated|sphere|flat|sulc|curv|thickness))[\w\d_-]*(?P<extprefix>\.\w+)?"
164170
)
165171
_excluded = ("extprefix",)
166172

0 commit comments

Comments
 (0)