getInputImageArray = (imgFile) => {
  let canvas = document.createElement('canvas');
  canvas.style.cssText = 'display:none;';
  document.getElementsByTagName('body')[0].appendChild(canvas);
  let context = canvas.getContext('2d');

  return new Promise((resolve, reject) => {
    let inputImage = new Image();
    inputImage.src = imgFile;
    inputImage.onload = () => {
      context.drawImage(inputImage, 0, 0,);
      // Get image data and convert it to a 3D array
      let imageData = context.getImageData(0, 0, inputImage.width,
        inputImage.height).data;

      // Remove this newly created canvas element
      canvas.parentNode.removeChild(canvas);

      console.log(imageDataTo3DArray(imageData));
      resolve(imageDataTo3DArray(imageData));
    }
    inputImage.onerror = reject;
  })
}
Get the 3D pixel value array of the given image file.
@param {string} imgFile File path to the image file
@returns A promise with the corresponding 3D array