code: def get_image_reader_class(
      image_file, use_cached_name=True, volume=False
  ):
      if get_force_bioformats():
          return ALL_READERS["Bio-Formats"]
      if not AVAILABLE_READERS:
          raise Exception(
              "No image readers are enabled.\n"
              "Please check reader configuration in the File menu."
          )
      if (
          use_cached_name
          and image_file.preferred_reader in AVAILABLE_READERS
      ):
          reader_class = get_image_reader_by_name(
              image_file.preferred_reader
          )
          return reader_class
      LOGGER.debug(f"Choosing reader for {image_file.filename}")
      best_reader = None
      best_value = 5
      for reader_name, reader_class in AVAILABLE_READERS.items():
          result = reader_class.supports_format(
              image_file, volume=volume, allow_open=False
          )
          if result == 1:
              LOGGER.debug(f"Selected {reader_name}")
              image_file.preferred_reader = reader_name
              return reader_class
          elif 1 < result < best_value:
              best_value = result
              best_reader = reader_class
      if best_reader is None:
          raise NotImplementedError(
              f"No reader available for {image_file.filename}"
          )
      LOGGER.debug(f"Selected {best_reader}")
      return best_reader
  
file_path: CellProfiler/src/subpackages/core/cellprofiler_core/reader/__init__.py
imports: import os
  import sys
  import traceback
  from ._reader import Reader
  from ..constants.reader import ALL_READERS, builtin_readers, BAD_READERS, AVAILABLE_READERS
  import logging
  from ..preferences import get_force_bioformats, config_read_typed
label_desc: Use image node_id 5 for calling a global function with example usage: get_image_reader_class(image_file, use_cached_name, volume) and returns: best_reader, ALL_READERS, reader_class, reader_class