code: def __compute_percentiles(img, mask, cutoff):
      """
      Creates the list of percentile values to be used as landmarks for the
      linear fitting.
  
      :param img: Image on which to determine the percentiles
      :param mask: Mask to use over the image to constraint to the relevant
      information
      :param cutoff: Values of the minimum and maximum percentiles to use for
      the linear fitting
      :return perc_results: list of percentiles value for the given image over
      the mask
      """
      perc = [
          cutoff[0],
          0.1,
          0.2,
          0.25,
          0.3,
          0.4,
          0.5,
          0.6,
          0.7,
          0.75,
          0.8,
          0.9,
          cutoff[1],
      ]
      masked_img = ma.masked_array(
          img, np.logical_not(mask)
      ).compressed()
      perc_results = np.percentile(masked_img, 100 * np.array(perc))
      # hist, bin = np.histogram(ma.compressed(masked_img), bins=50)
      return perc_results
  
file_path: NiftyNet/niftynet/utilities/histogram_standardisation.py
imports: from __future__ import absolute_import, print_function, division
  import os
  import numpy
  import numpy.ma
  import tensorflow
  from niftynet.io.misc_io import touch_folder
  from niftynet.utilities.util_common import look_up_operations, print_progress_bar
label_desc: Use image node_id 1 for calling a global function with example usage: __compute_percentiles(img, mask, cutoff) and returns: perc_results