Skip to content

Commit

Permalink
Fix input types
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmartel committed Apr 25, 2024
1 parent e520051 commit e9ba0c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
5 changes: 4 additions & 1 deletion src/dicom/dicomElementsWrapper.js
Expand Up @@ -21,6 +21,7 @@ import {logger} from '../utils/logger';
/* eslint-disable no-unused-vars */
import {Tag} from './dicomTag';
import {DataElement} from './dataElement';
import {Matrix33} from '../math/matrix';
/* eslint-enable no-unused-vars */

/**
Expand Down Expand Up @@ -698,7 +699,9 @@ export function getOrientationMatrix(dataElements) {
// http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.7.6.2.html#sect_C.7.6.2.1.1
if (typeof imageOrientationPatient !== 'undefined') {
orientationMatrix =
getOrientationFromCosines(imageOrientationPatient.value);
getOrientationFromCosines(
imageOrientationPatient.value.map((item) => parseFloat(item))
);
}
return orientationMatrix;
}
Expand Down
10 changes: 2 additions & 8 deletions src/math/matrix.js
Expand Up @@ -509,14 +509,8 @@ function getVectorStringLPS(vector) {
export function getOrientationFromCosines(cosines) {
let orientationMatrix;
if (typeof cosines !== 'undefined' && cosines.length === 6) {
const rowCosines = new Vector3D(
parseFloat(cosines[0]),
parseFloat(cosines[1]),
parseFloat(cosines[2]));
const colCosines = new Vector3D(
parseFloat(cosines[3]),
parseFloat(cosines[4]),
parseFloat(cosines[5]));
const rowCosines = new Vector3D(cosines[0], cosines[1], cosines[2]);
const colCosines = new Vector3D(cosines[3], cosines[4], cosines[5]);
const normal = rowCosines.crossProduct(colCosines);
/* eslint-disable array-element-newline */
orientationMatrix = new Matrix33([
Expand Down

0 comments on commit e9ba0c8

Please sign in to comment.