code: def main():
      # parse cmd arguments
      parser = getParser()
      parser.parse_args()
      args = getArguments(parser)
  
      # prepare logger
      logger = Logger.getInstance()
      if args.debug:
          logger.setLevel(logging.DEBUG)
      elif args.verbose:
          logger.setLevel(logging.INFO)
  
      # write header line
      print("image;labels\n")
  
      # iterate over input images
      for image in args.images:
          # get and prepare image data
          logger.info("Processing image {}...".format(image))
          image_data, _ = load(image)
  
          # count number of labels and flag a warning if they reach the ushort border
          count = len(numpy.unique(image_data))
  
          # count number of labels and write
          print("{};{}\n".format(image.split("/")[-1], count))
  
          sys.stdout.flush()
  
      logger.info("Successfully terminated.")
  
file_path: medpy/bin/medpy_label_count.py
imports: import argparse
  import logging
  import sys
  import numpy
  from medpy.io import load
  from medpy.core import Logger
label_desc: Use image node_id 1 for calling a global function with example usage: main() without return types