Skip to content

Commit

Permalink
use __ for uci delimiter
Browse files Browse the repository at this point in the history
  • Loading branch information
jbwexler authored May 30, 2024
1 parent f1db34d commit 055e12b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions wbhiutils/parse_dicom_hdr.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ def parse_pi(dcm_hdr: dict, site: str) -> str:
if site == 'ucsb':
return re.split('[^0-9a-zA-Z]', dcm_hdr["PatientName"], maxsplit=1)[0]
elif site == 'uci':
return re.split('[^0-9a-zA-Z]', dcm_hdr["PatientName"])[0]
return re.split('__', dcm_hdr["PatientName"], maxsplit=1)[0]
elif site == 'ucb':
return re.split(' ', dcm_hdr["StudyDescription"])[0]
return re.split(' ', dcm_hdr["StudyDescription"], maxsplit=1)[0]
else:
return re.split('[^0-9a-zA-Z]', dcm_hdr["PatientName"], maxsplit=1)[0]

Expand All @@ -19,7 +19,7 @@ def parse_sub(dcm_hdr: dict, site: str) -> str:
if site == 'ucsb':
return re.split('[^0-9a-zA-Z]', dcm_hdr["PatientName"], maxsplit=1)[1]
elif site == 'uci':
return re.split('[^0-9a-zA-Z]', dcm_hdr["PatientID"])[0]
return re.split('__', dcm_hdr["PatientID"], maxsplit=1)[0]
elif site == 'ucb':
return dcm_hdr["PatientName"]
else:
Expand Down

0 comments on commit 055e12b

Please sign in to comment.