extensions/xnat/src/utils/IO/classes/NIFTIReader.js
/**
   * _compareSliceDirection - Checks which direction the NIFTI slices are in
   *                          relation to the scan data.
   *
   * @param  {object} imagePositionPatient  The imagePositionPatient of the
   *                                        first image in the series.
   * @param  {object} firstVoxelInDicomPCSFrame The position of the the first
   *                                            voxel of the NIFTI in the PCS.
   * @param  {number} tol                       The tolerance.
   * @returns {string}  A string that indicates if the NIFTI slices are ascending
   *                    or descending the scan.
   */
Checks which direction the NIFTI slices are in
relation to the scan data.

@param  {object} imagePositionPatient  The imagePositionPatient of the
first image in the series.
@param  {object} firstVoxelInDicomPCSFrame The position of the the first
voxel of the NIFTI in the PCS.
@param  {number} tol                       The tolerance.
@returns {string}  A string that indicates if the NIFTI slices are ascending
or descending the scan.
Checks which direction the NIFTI slices are in relation to the scan data . @param { object } imagePositionPatient The imagePositionPatient of the first image in the series . @param { object } firstVoxelInDicomPCSFrame The position of the the first voxel of the NIFTI in the PCS . @param { number } tol The tolerance . @returns { string } A string that indicates if the NIFTI slices are ascending or descending the scan .
_compareSliceDirection(imagePositionPatient, firstVoxelInDicomPCSFrame, tol) {
    if (Math.abs(imagePositionPatient.z - firstVoxelInDicomPCSFrame[2]) < tol) {
      return 'ascending';
    }
    return 'descending';
  }
_compareSliceDirection ( imagePositionPatient , firstVoxelInDicomPCSFrame , tol ) { if ( Math . abs ( imagePositionPatient . z - firstVoxelInDicomPCSFrame [ 2 ] ) < tol ) { return 'ascending' ; } return 'descending' ; }
_compareSliceDirection - Checks which direction the NIFTI slices are in
                          relation to the scan data.
_compareSliceDirection - Checks which direction the NIFTI slices are in relation to the scan data .