constructor( volume, index = 0, axis = 'z' ) {

		const slice = this;

		/**
		 * The associated volume.
		 *
		 * @type {Volume}
		 */
		this.volume = volume;

		Object.defineProperty( this, 'index', {
			get: function () {

				return index;

			},
			/**
			 * The index of the slice, if changed, will automatically call updateGeometry at the next repaint.
			 *
			 * @name VolumeSlice#index
			 * @type {number}
			 * @default 0
			 * @param {number} value
			 * @return {number}
			 */
			set: function ( value ) {

				index = value;
				slice.geometryNeedsUpdate = true;
				return index;

			}
		} );

		/**
		 * The normal axis.
		 *
		 * @type {('x'|'y'|'z')}
		 */
		this.axis = axis;

		/**
		 * The final canvas used for the texture.
		 *
		 * @type {HTMLCanvasElement}
		 */
		this.canvas = document.createElement( 'canvas' );

		/**
		 * The rendering context of the canvas.
		 *
		 * @type {CanvasRenderingContext2D}
		 */
		this.ctx;

		/**
		 * The intermediary canvas used to paint the data.
		 *
		 * @type {HTMLCanvasElement}
		 */
		this.canvasBuffer = document.createElement( 'canvas' );

		/**
		 * The rendering context of the canvas buffer,
		 *
		 * @type {CanvasRenderingContext2D}
		 */
		this.ctxBuffer;

		this.updateGeometry();


		const canvasMap = new Texture( this.canvas );
		canvasMap.minFilter = LinearFilter;
		canvasMap.generateMipmaps = false;
		canvasMap.wrapS = canvasMap.wrapT = ClampToEdgeWrapping;
		canvasMap.colorSpace = SRGBColorSpace;
		const material = new MeshBasicMaterial( { map: canvasMap, side: DoubleSide, transparent: true } );

		/**
		 * The mesh ready to get used in the scene.
		 *
		 * @type {Mesh}
		 */
		this.mesh = new Mesh( this.geometry, material );
		this.mesh.matrixAutoUpdate = false;

		/**
		 * If set to `true`, `updateGeometry()` will be triggered at the next repaint.
		 *
		 * @type {boolean}
		 * @default true
		 */
		this.geometryNeedsUpdate = true;
		this.repaint();

		/**
		 * Width of slice in the original coordinate system, corresponds to the width of the buffer canvas.
		 *
		 * @type {number}
		 * @default 0
		 */
		this.iLength = 0;

		/**
		 * Height of slice in the original coordinate system, corresponds to the height of the buffer canvas.
		 *
		 * @type {number}
		 * @default 0
		 */
		this.jLength = 0;

		/**
		 * Function that allow the slice to access right data.
		 *
		 * @type {?Function}
		 * @see {@link Volume#extractPerpendicularPlane}
		 */
		this.sliceAccess = null;

	}
Constructs a new volume slice.

@param {Volume} volume - The associated volume.
@param {number} [index=0] - The index of the slice.
@param {('x'|'y'|'z')} [axis='z'] - For now only 'x', 'y' or 'z' but later it will change to a normal vector.