diff --git a/OHIFViewer/package.json b/OHIFViewer/package.json index 31b448689..d0a62cfa3 100644 --- a/OHIFViewer/package.json +++ b/OHIFViewer/package.json @@ -4,7 +4,7 @@ "description": "", "main": "index.js", "dependencies": { - "babel-runtime": "^6.20.0" + "babel-runtime": "^6.22.0" }, "devDependencies": {}, "scripts": { diff --git a/Packages/ohif-viewerbase/client/index.js b/Packages/ohif-viewerbase/client/index.js index b6ccded13..398f39815 100644 --- a/Packages/ohif-viewerbase/client/index.js +++ b/Packages/ohif-viewerbase/client/index.js @@ -43,10 +43,6 @@ Viewerbase.getImageId = getImageId; import { setActiveViewport } from './lib/setActiveViewport'; Viewerbase.setActiveViewport = setActiveViewport; -// classifyImageOrientation -import { classifyImageOrientation } from './lib/classifyImageOrientation'; -Viewerbase.classifyImageOrientation = classifyImageOrientation; - // setFocusToActiveViewport import { setFocusToActiveViewport } from './lib/setFocusToActiveViewport'; Viewerbase.setFocusToActiveViewport = setFocusToActiveViewport; diff --git a/Packages/ohif-viewerbase/client/lib/classifyImageOrientation.js b/Packages/ohif-viewerbase/client/lib/classifyImageOrientation.js deleted file mode 100644 index 877c3fa76..000000000 --- a/Packages/ohif-viewerbase/client/lib/classifyImageOrientation.js +++ /dev/null @@ -1,57 +0,0 @@ -import { OHIF } from 'meteor/ohif:core'; - -/** - * This function returns a string describing an image orientation - * (e.g. axial, sagittal, coronal) - * If no classification is determined, it returns undefined - * - * @param {string} [imageId] - * @returns {string} - */ -export function classifyImageOrientation(imageId) { - // First we check if this imageId has already been classified, so we can return - // the classification from the cache - if (OHIF.viewer.linkSeries.classifiedOrientation.hasOwnProperty(imageId)) { - return OHIF.viewer.linkSeries.classifiedOrientation[imageId]; - } - - // Calculate the image plane normal - const imagePlane = cornerstoneTools.metaData.get('imagePlane', imageId); - if (!imagePlane || !imagePlane.rowCosines || !imagePlane.columnCosines) { - return; - } - const imageNormal = imagePlane.rowCosines.clone().cross(imagePlane.columnCosines); - - // These represent the normal vectors to three standard image planes - const normals = { - axial: new cornerstoneMath.Vector3(0, 0, 1), - coronal: new cornerstoneMath.Vector3(0, 1, 0), - sagittal: new cornerstoneMath.Vector3(1, 0, 0) - }; - - const PI = Math.PI; - // This loop checks the angle between the current image plane normal - // and that of the three standard image planes above. If the two - // normal vectors are within 15 degrees of each other, the current image - // is classified as the relevant standard image plane (e.g. axial). - let classifiedOrientation; - Object.keys(normals).some(orientation => { - let angleInRadians = imageNormal.angleTo(normals[orientation]); - - angleInRadians = Math.abs(angleInRadians); - if (angleInRadians < PI / 12 || angleInRadians === PI) { // Pi / 12 radians = 15 degrees - classifiedOrientation = orientation; - return true; - } - }); - - // If no classification was determined, stop here and dump a warning to the console - if (!classifiedOrientation) { - return; - } - - // Otherwise, update the cache with the classified orientation for this imageId - OHIF.viewer.linkSeries.classifiedOrientation[imageId] = classifiedOrientation; - - return classifiedOrientation; -}; \ No newline at end of file