pwspy.utility.plotting.roiColor(data, rois, vmin, vmax, scale_bg, hue=0, exponent=1, numScaleBarPix=0)[source]

Given a 2D image of data this function will scale the data, apply an exponential curve, and color the ROI regions with Hue. Used in many presentations and publications.

  • data (np.ndarray) – an MxN array of data to be imaged

  • rois (List[Roi]) – a list of Roi objects. the regions inside a roi will be colored.

  • vmin (float) – the minimum value in the data that will be set to black

  • vmax (float) – the maximum value in the data that will be set to white

  • scale_bg (float) – Scales the brightness of the background (non-roi) region.

  • hue (float) – A value of 0-1 indicating the hue of the colored regions.

  • exponent (float) – The exponent used to curve the color map for more pleasing results.

  • numScaleBarPix (float) – The length of the scale bar in number of pixels.


MxNx3 RGB array of the image

Return type