Skip to content

Commit

Permalink
Make the use of sub/sesprefix for recursive sorting more clear (githu…
Browse files Browse the repository at this point in the history
…b issue #202)
  • Loading branch information
marcelzwiers committed Sep 22, 2023
1 parent de75aa7 commit a42987f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions bidscoin/cli/_dicomsort.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ class CustomFormatter(argparse.ArgumentDefaultsHelpFormatter, argparse.RawDescri
formatter_class=CustomFormatter,
description=textwrap.dedent(__doc__),
epilog='examples:\n'
' dicomsort sub-011/ses-mri01\n'
' dicomsort sub-011/ses-mri01/DICOMDIR -n {AcquisitionNumber:05d}_{InstanceNumber:05d}.dcm\n'
' dicomsort myproject/raw/DICOMDIR --subprefix pat^ --sesprefix\n ')
' dicomsort raw/sub-011/ses-mri01\n'
' dicomsort raw --subprefix sub- --sesprefix ses-\n'
' dicomsort myproject/raw/DICOMDIR --subprefix pat^ --sesprefix\n'
' dicomsort sub-011/ses-mri01/DICOMDIR -n {AcquisitionNumber:05d}_{InstanceNumber:05d}.dcm\n ')
parser.add_argument('dicomsource', help='The root folder containing the dicomsource/[sub/][ses/] dicomfiles or the DICOMDIR file')
parser.add_argument('-i','--subprefix', help='Provide a prefix string for recursive sorting of dicomsource/subject subfolders (e.g. "sub-")')
parser.add_argument('-j','--sesprefix', help='Provide a prefix string for recursive sorting of dicomsource/subject/session subfolders (e.g. "ses-")')
parser.add_argument('-i','--subprefix', help='Provide a prefix string to recursively sort dicomsource/subject subfolders (e.g. "sub-" or "S_")')
parser.add_argument('-j','--sesprefix', help='Provide a prefix string to recursively sort dicomsource/subject/session subfolders (e.g. "ses-" or "T_")')
parser.add_argument('-f','--folderscheme', help='Naming scheme for the sorted DICOM Series subfolders. Follows the Python string formatting syntax with DICOM field names in curly bracers with an optional number of digits for numeric fields. Sorting in subfolders is skipped when an empty folderscheme is given (but note that renaming the filenames can still be performed)', default='{SeriesNumber:03d}-{SeriesDescription}')
parser.add_argument('-n','--namescheme', help='Optional naming scheme that can be provided to rename the DICOM files. Follows the Python string formatting syntax with DICOM field names in curly bracers with an optional number of digits for numeric fields. Use e.g. "{PatientName}_{SeriesNumber:03d}_{SeriesDescription}_{AcquisitionNumber:05d}_{InstanceNumber:05d}.dcm" or "{InstanceNumber:05d}_{SOPInstanceUID}.IMA" for default names')
parser.add_argument('-p','--pattern', help='The regular expression pattern used in re.match(pattern, dicomfile) to select the dicom files', default=r'.*\.(IMA|dcm)$')
Expand Down

0 comments on commit a42987f

Please sign in to comment.