class_docstr: Base for image providers: handle pathname and filename & URLs
class_docstr_tok: ["Base","for","image","providers",":","handle","pathname","and","filename","&","URLs"]
docstr: :param name: Name of image to be provided
  :type name:
  :param pathname: Path to file or base of URL
  :type pathname:
  :param filename: Filename of file or last chunk of URL
  :type filename:
  :param rescale:
  :type rescale:
  :param series:
  :type series:
  :param index:
  :type index:
  :param channel:
  :type channel:
  :param volume:
  :type volume:
  :param spacing:
  :type spacing:
docstr_tok: [":","param","name",":","Name","of","image","to","be","provided",":","type","name",":",":","param","pathname",":","Path","to","file","or","base","of","URL",":","type","pathname",":",":","param","filename",":","Filename","of","file","or","last","chunk","of","URL",":","type","filename",":",":","param","rescale",":",":","type","rescale",":",":","param","series",":",":","type","series",":",":","param","index",":",":","type","index",":",":","param","channel",":",":","type","channel",":",":","param","volume",":",":","type","volume",":",":","param","spacing",":",":","type","spacing",":"]
code: def __init__(
      self,
      name,
      pathname,
      filename,
      rescale=True,
      series=None,
      index=None,
      channel=None,
      volume=False,
      spacing=None,
      z=None,
      t=None,
  ):
      """
      :param name: Name of image to be provided
      :type name:
      :param pathname: Path to file or base of URL
      :type pathname:
      :param filename: Filename of file or last chunk of URL
      :type filename:
      :param rescale:
      :type rescale:
      :param series:
      :type series:
      :param index:
      :type index:
      :param channel:
      :type channel:
      :param volume:
      :type volume:
      :param spacing:
      :type spacing:
      """
      if pathname.startswith(FILE_SCHEME):
          pathname = url2pathname(pathname)
      self.__name = name
      self.__pathname = pathname
      self.__filename = filename
      self.__cached_file = None
      self.__is_cached = False
      self.__cacheing_tried = False
      self.__image = None
      self.__preferred_reader = None
      self.__image_file = None
      self.__reader = None
  
      if pathname is None:
          self.__url = filename
      elif any(
          [pathname.startswith(s + ":") for s in PASSTHROUGH_SCHEMES]
      ):
          if filename is not None:
              self.__url = pathname + "/" + filename
          else:
              self.__url = pathname
      elif filename is None:
          self.__url = pathname2url(pathname)
      else:
          self.__url = pathname2url(os.path.join(pathname, filename))
      self.rescale = rescale
      self.__series = series
      self.__channel = channel
      self.__index = index
      self.__volume = volume
      self.__spacing = spacing
      if volume:
          if z is not None and t is not None:
              raise ValueError(
                  f"T- and Z-plane indexes were specified while in 3D mode."
                  f"If extracting planes you should disable separation of an axis to "
                  f"work in 3D."
              )
          self.__z = z
          self.__t = t
      else:
          self.__z = z if z is not None else 0
          self.__t = t if t is not None else 0
      self.scale = None
  
imports: import atexit
  import hashlib
  import logging
  import os
  import tempfile
  import urllib.parse
  import urllib.request
  import weakref
  import numpy
  import cellprofiler_core.preferences
  from .._abstract_image import AbstractImage
  from ..._image import Image
  from ....reader import get_image_reader, get_image_reader_class
  from ....utilities.image import is_numpy_file, download_to_temp_file
  from ....utilities.image import is_matlab_file
  from ....utilities.image import loadmat
  from ....utilities.image import load_data_file
  from ....utilities.image import generate_presigned_url
  from ....constants.image import FILE_SCHEME, PASSTHROUGH_SCHEMES
  from ....utilities.pathname import pathname2url, url2pathname
label_desc: Use image node_id 1 to create a new FileImage object from inherited base classes: AbstractImage with example: obj = FileImage(name, pathname, filename, rescale, series, index, channel, volume, spacing, z, t)