docs: def use_economic_dtype(data3d, slope=1, inter=0, dtype=None):
      """ Use more economic integer-like dtype if it is possible.
  
      :param data3d:
      :param dtype: if dtype is not used, the automatic is used
      :return:
      """
  
      if dtype is None:
          dtype = data3d.dtype
          if issubclass(dtype.type, np.integer):
              mn = data3d.min() * slope + inter
              mx = data3d.max() * slope + inter
              if suits_with_dtype(mn, mx, dtype=np.uint8):
                  dtype = np.uint8
              elif suits_with_dtype(mn, mx, dtype=np.int8):
                  dtype = np.int8
              elif suits_with_dtype(mn, mx, dtype=np.uint16):
                  dtype = np.uint16
              elif suits_with_dtype(mn, mx, dtype=np.int16):
                  dtype = np.int16
              elif suits_with_dtype(mn, mx, dtype=np.uint32):
                  dtype = np.uint32
              elif suits_with_dtype(mn, mx, dtype=np.int32):
                  dtype = np.int32
  
      # new_data3d = ((np.float(slope) * data3d) + np.float(inter)).astype(dtype)
      if slope == 1 and inter == 0:
          # this can prevent out of memmory
          new_data3d = data3d.astype(dtype)
      else:
          new_data3d = ((slope * data3d) + inter).astype(dtype)
      return new_data3d