def _get_display_range(image):
 ip = _get_image_properties(image)
 (immin, immax) = (np.min(image), np.max(image))
 if ip.signed:
  magnitude = max(abs(immin), abs(immax))
  (lo, hi) = ((- magnitude), magnitude)
  cmap = _diverging_colormap
 elif any(ip):
  _raise_warnings(ip)
  (lo, hi) = (immin, immax)
  cmap = _nonstandard_colormap
 else:
  lo = 0
  imtype = image.dtype.type
  hi = dtypes.dtype_range[imtype][1]
  cmap = _default_colormap
 return (lo, hi, cmap)

def _get_display_range ( image ) : ip = _get_image_properties ( image ) ( immin , immax ) = ( np . min ( image ) , np . max ( image ) ) if ip . signed : magnitude = max ( abs ( immin ) , abs ( immax ) ) ( lo , hi ) = ( ( - magnitude ) , magnitude ) cmap = _diverging_colormap elif any ( ip ) : _raise_warnings ( ip ) ( lo , hi ) = ( immin , immax ) cmap = _nonstandard_colormap else : lo = 0 imtype = image . dtype . type hi = dtypes . dtype_range [ imtype ] [ 1 ] cmap = _default_colormap return ( lo , hi , cmap )
return the display range for a given set of image properties .