code: def get_opt_parser():
      # use module docstring for help output
      p = OptionParser(
          usage=f"{sys.argv[0]} [OPTIONS] [FILE ...]\n\n" + __doc__,
          version="%prog " + nib.__version__,
      )
  
      p.add_options(
          [
              Option(
                  "-v",
                  "--verbose",
                  action="count",
                  dest="verbose",
                  default=0,
                  help="Make more noise.  Could be specified multiple times",
              ),
              Option(
                  "-H",
                  "--header-fields",
                  dest="header_fields",
                  default="",
                  help="Header fields (comma separated) to be printed as well (if present)",
              ),
              Option(
                  "-s",
                  "--stats",
                  action="store_true",
                  dest="stats",
                  default=False,
                  help="Output basic data statistics",
              ),
              Option(
                  "-c",
                  "--counts",
                  action="store_true",
                  dest="counts",
                  default=False,
                  help="Output counts - number of entries for each numeric value "
                  "(useful for int ROI maps)",
              ),
              Option(
                  "--all-counts",
                  action="store_true",
                  dest="all_counts",
                  default=False,
                  help="Output all counts, even if number of unique values > %d"
                  % MAX_UNIQUE,
              ),
              Option(
                  "-z",
                  "--zeros",
                  action="store_true",
                  dest="stats_zeros",
                  default=False,
                  help="Include zeros into output basic data statistics (--stats, --counts)",
              ),
          ]
      )
  
      return p
  
file_path: nibabel/nibabel/cmdline/ls.py
imports: import sys
  from optparse import Option, OptionParser
  import numpy
  import nibabel
  import nibabel.cmdline.utils
  from nibabel.cmdline.utils import _err, ap, safe_get, table2string, verbose
label_desc: Use image node_id 1 for calling a global function with example usage: get_opt_parser() and returns: p