Skip to content

Commit 43c649a

Browse files
authored
Allow sub- prefix in participant labels (#1347)
1 parent 3f7b6fa commit 43c649a

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

xcp_d/cli/parser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ def _build_parser():
9090
dest='participant_label',
9191
action='store',
9292
nargs='+',
93+
type=lambda label: label.removeprefix('sub-'),
9394
help=(
9495
'A space-delimited list of participant identifiers, or a single identifier. '
9596
"The 'sub-' prefix can be removed."

xcp_d/tests/test_cli.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def test_ds001419_nifti(data_dir, output_dir, working_dir):
4848
dataset_dir,
4949
out_dir,
5050
'participant',
51+
'--participant-label=01',
5152
'--mode=none',
5253
'--datasets',
5354
f'aroma={derivs_dir}',
@@ -97,6 +98,7 @@ def test_ds001419_cifti(data_dir, output_dir, working_dir):
9798
dataset_dir,
9899
out_dir,
99100
'participant',
101+
'--participant-label=sub-01',
100102
'--mode=abcd',
101103
f'-w={work_dir}',
102104
'--task-id=imagery',

0 commit comments

Comments
 (0)