code: function getLut (image, viewport) {
    // If we have a cached lut and it has the right values, return it immediately
    if (image.cachedLut !== undefined &&
      image.cachedLut.windowCenter === viewport.voi.windowCenter &&
      image.cachedLut.windowWidth === viewport.voi.windowWidth &&
      image.cachedLut.invert === viewport.invert) {
      return image.cachedLut.lutArray;
    }
  
    // Lut is invalid or not present, regenerate it and cache it
    generateColorLut(image, viewport.voi.windowWidth, viewport.voi.windowCenter, viewport.invert);
    image.cachedLut.windowWidth = viewport.voi.windowWidth;
    image.cachedLut.windowCenter = viewport.voi.windowCenter;
    image.cachedLut.invert = viewport.invert;
  
    return image.cachedLut.lutArray;
  }
docs: Generates an appropriate Look Up Table to render the given image with the given window width and level (specified in the viewport)
  Uses an internal cache for performance
  
  @param {Object} image  The image to be rendered
  @param {Object} viewport The viewport values used for rendering
  @returns {Uint8ClampedArray} Look Up Table array.
  @memberof rendering