code: def main():
      parser = get_opt_parser()
      (opts, infiles) = parser.parse_args()
  
      verbose.switch = opts.verbose
  
      if opts.origin not in ("scanner", "fov"):
          error(f"Unrecognized value for --origin: '{opts.origin}'.", 1)
      if opts.dwell_time and opts.field_strength is None:
          error("Need --field-strength for dwell time calculation", 1)
  
      # store any exceptions
      errs = []
      for infile in infiles:
          verbose(f"Processing {infile}")
          try:
              proc_file(infile, opts)
          except Exception as e:
              errs.append(f"{infile}: {e}")
  
      if len(errs):
          error(
              f"Caught {len(errs)} exceptions. Dump follows:\n\n"
              + "\n".join(errs),
              1,
          )
      else:
          verbose("Done")
  
file_path: nibabel/nibabel/cmdline/parrec2nii.py
imports: import csv
  import os
  import sys
  from optparse import Option, OptionParser
  import numpy
  import numpy.linalg
  import nibabel
  import nibabel.nifti1
  import nibabel.parrec
  from nibabel.affines import apply_affine, from_matvec, to_matvec
  from nibabel.filename_parser import splitext_addext
  from nibabel.mriutils import MRIError, calculate_dwell_time
  from nibabel.orientations import apply_orientation, inv_ornt_aff, io_orientation
  from nibabel.parrec import one_line
  from nibabel.volumeutils import fname_ext_ul_case
label_desc: Use image node_id 5 for calling a global function with example usage: main() without return types