@cornerstonejs/nifti-image-loader
Version:
Cornerstone ImageLoader for NIfTI
32 lines (25 loc) • 790 B
JavaScript
/* eslint import/extensions: 0 */
import { expect } from 'chai';
import multiplyMatrixAndPoint from '../../src/shared/multiplyMatrixAndPoint.js';
describe('#multiplyMatrixAndPoint', function () {
it('should return the same point if identity matrix', function () {
const identity = [
[],
[],
[],
[]
];
const result = multiplyMatrixAndPoint(identity, [4, 4, 4, 1]);
expect(result).to.deep.equal([4, 4, 4, 1]);
});
it('should return the resulting point', function () {
const matrix = [
[],
[],
[],
[]
];
const result = multiplyMatrixAndPoint(matrix, [4, 4, 4, 1]);
expect(result).to.deep.equal([8, -8, 0, 1]);
});
});