class_docstr: Base for image providers: handle pathname and filename & URLs
class_docstr_tok: ["Base","for","image","providers",":","handle","pathname","and","filename","&","URLs"]
code: def __set_image_volume(self):
      pathname = url2pathname(self.get_url())
  
      # Volume loading is currently limited to tiffs/numpy files only
      if is_numpy_file(self.__filename):
          data = numpy.load(pathname)
      else:
          reader = self.get_reader(volume=True)
          data = reader.read_volume(
              c=self.channel,
              z=self.z,
              t=self.t,
              series=self.series,
              rescale=self.rescale,
              wants_max_intensity=False,
          )
  
      # https://github.com/CellProfiler/python-bioformats/blob/855f2fb7807f00ef41e6d169178b7f3d22530b79/bioformats/formatreader.py#L768-L791
      if data.dtype in [numpy.int8, numpy.uint8]:
          self.scale = 255
      elif data.dtype in [numpy.int16, numpy.uint16]:
          self.scale = 65535
      elif data.dtype == numpy.int32:
          self.scale = 2**32 - 1
      elif data.dtype == numpy.uint32:
          self.scale = 2**32
      else:
          self.scale = 1
  
      self.__image = Image(
          image=data,
          path_name=self.get_pathname(),
          file_name=self.get_filename(),
          dimensions=3,
          scale=self.scale,
          spacing=self.__spacing,
      )
  
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 23 for calling the FileImage obj's underlying member method code with example usage: obj.__set_image_volume() without return types