code: def upper_bound_by_percent(data, percent=1):
      """Find the upper bound for visualization of medical images
  
      Calculate the histogram of the image and go right to left until you find
      the bound that contains more than a percentage of the image.
  
      Parameters
      ----------
      data : ndarray
      percent : float
  
      Returns
      -------
      upper_bound : float
      """
  
      percent = percent / 100.0
      values, bounds = np.histogram(data, 20)
      total_voxels = np.prod(data.shape)
      agg = 0
  
      for i in range(len(values) - 1, 0, -1):
          agg += values[i]
          if agg / float(total_voxels) > percent:
              return bounds[i]
  
label_desc: Use image node_id 3 for calling a global function with example usage: upper_bound_by_percent(data, percent) and returns: bounds