extensions/xnat/src/utils/IO/classes/NIFTIReader.js
/**
   * _extractPixelData - Extracts the pixelData from the NIFTI file.
   *
   * @returns {Int8Array||Int16Array||Int32Array||null} The pixelData.
   */
Extracts the pixelData from the NIFTI file.
Extracts the pixelData from the NIFTI file .
_extractPixelData() {
    const niftiImage = Nifti.readImage(
      this._niftiHeader,
      this._niftiArrayBuffer
    );
    const voxelByteLength = this._niftiHeader.numBitsPerVoxel;
    switch (voxelByteLength) {
      case 8:
        return new Int8Array(niftiImage);
      case 16:
        return new Int16Array(niftiImage);
      case 32:
        return new Int32Array(niftiImage);
      default:
        throw new Exception(
          `No method for parsing ArrayBuffer to ${voxelByteLength}-byte array`
        );
    }
    return null;
  }
_extractPixelData ( ) { const niftiImage = Nifti . readImage ( this . _niftiHeader , this . _niftiArrayBuffer ) ; const voxelByteLength = this . _niftiHeader . numBitsPerVoxel ; switch ( voxelByteLength ) { case 8 : return new Int8Array ( niftiImage ) ; case 16 : return new Int16Array ( niftiImage ) ; case 32 : return new Int32Array ( niftiImage ) ; default : throw new Exception ( ` ${ voxelByteLength } ` ) ; } return null ; }
_extractPixelData - Extracts the pixelData from the NIFTI file.
_extractPixelData - Extracts the pixelData from the NIFTI file .