Skip to content

Commit

Permalink
Merge pull request #215 from arnaudbore/valid_participant
Browse files Browse the repository at this point in the history
[BF] valid participant
  • Loading branch information
arnaudbore authored Jun 29, 2023
2 parents 3c5ae96 + 6b79575 commit 55f8638
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dcm2bids/participant.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,13 @@ def name(self, name):
""" Prepend 'sub-' if necessary"""
if name.startswith("sub-"):
self._name = name

else:
self._name = "sub-" + name

if not self._name.replace('sub-', '').isalnum():
raise NameError(f"Participant '{self._name.replace('sub-', '')}' "
"should contains only alphanumeric characters.")

@property
def session(self):
"""
Expand Down

0 comments on commit 55f8638

Please sign in to comment.