From 0842eb9a8ce72ceebcf10b7e47648078123c0ef8 Mon Sep 17 00:00:00 2001 From: dannyrb Date: Tue, 16 Jun 2020 00:26:12 -0400 Subject: [PATCH] Delete SR Viewport example mode --- .../SRViewportExample/.webpack/webpack.dev.js | 8 -- .../.webpack/webpack.prod.js | 44 ------- modes/SRViewportExample/LICENSE | 21 ---- modes/SRViewportExample/babel.config.js | 1 - modes/SRViewportExample/package.json | 35 ------ modes/SRViewportExample/src/index.js | 108 ------------------ platform/viewer/src/App.jsx | 1 - platform/viewer/src/appInit.js | 1 - 8 files changed, 219 deletions(-) delete mode 100644 modes/SRViewportExample/.webpack/webpack.dev.js delete mode 100644 modes/SRViewportExample/.webpack/webpack.prod.js delete mode 100644 modes/SRViewportExample/LICENSE delete mode 100644 modes/SRViewportExample/babel.config.js delete mode 100644 modes/SRViewportExample/package.json delete mode 100644 modes/SRViewportExample/src/index.js diff --git a/modes/SRViewportExample/.webpack/webpack.dev.js b/modes/SRViewportExample/.webpack/webpack.dev.js deleted file mode 100644 index 1ae308448..000000000 --- a/modes/SRViewportExample/.webpack/webpack.dev.js +++ /dev/null @@ -1,8 +0,0 @@ -const path = require('path'); -const webpackCommon = require('./../../../.webpack/webpack.commonjs.js'); -const SRC_DIR = path.join(__dirname, '../src'); -const DIST_DIR = path.join(__dirname, '../dist'); - -module.exports = (env, argv) => { - return webpackCommon(env, argv, { SRC_DIR, DIST_DIR }); -}; diff --git a/modes/SRViewportExample/.webpack/webpack.prod.js b/modes/SRViewportExample/.webpack/webpack.prod.js deleted file mode 100644 index ca612cd37..000000000 --- a/modes/SRViewportExample/.webpack/webpack.prod.js +++ /dev/null @@ -1,44 +0,0 @@ -const webpack = require('webpack'); -const merge = require('webpack-merge'); -const path = require('path'); -const webpackCommon = require('./../../../.webpack/webpack.commonjs.js'); -const pkg = require('./../package.json'); - -const ROOT_DIR = path.join(__dirname, './..'); -const SRC_DIR = path.join(__dirname, '../src'); -const DIST_DIR = path.join(__dirname, '../dist'); - -module.exports = (env, argv) => { - const commonConfig = webpackCommon(env, argv, { SRC_DIR, DIST_DIR }); - - return merge(commonConfig, { - devtool: 'source-map', - stats: { - colors: true, - hash: true, - timings: true, - assets: true, - chunks: false, - chunkModules: false, - modules: false, - children: false, - warnings: true, - }, - optimization: { - minimize: true, - sideEffects: true, - }, - output: { - path: ROOT_DIR, - library: 'OHIFExtCornerstone', - libraryTarget: 'umd', - libraryExport: 'default', - filename: pkg.main, - }, - plugins: [ - new webpack.optimize.LimitChunkCountPlugin({ - maxChunks: 1, - }), - ], - }); -}; diff --git a/modes/SRViewportExample/LICENSE b/modes/SRViewportExample/LICENSE deleted file mode 100644 index 19e20dd35..000000000 --- a/modes/SRViewportExample/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2018 Open Health Imaging Foundation - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/modes/SRViewportExample/babel.config.js b/modes/SRViewportExample/babel.config.js deleted file mode 100644 index 325ca2a8e..000000000 --- a/modes/SRViewportExample/babel.config.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('../../babel.config.js'); diff --git a/modes/SRViewportExample/package.json b/modes/SRViewportExample/package.json deleted file mode 100644 index e54e85f1d..000000000 --- a/modes/SRViewportExample/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "@ohif/sr-mode-example", - "version": "0.0.1", - "description": "Example SR mode for OHIF", - "author": "OHIF", - "license": "MIT", - "repository": "OHIF/Viewers", - "main": "dist/index.umd.js", - "module": "src/index.js", - "engines": { - "node": ">=10", - "npm": ">=6", - "yarn": ">=1.16.0" - }, - "files": [ - "dist", - "README.md" - ], - "publishConfig": { - "access": "public" - }, - "scripts": { - "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --debug --output-pathinfo", - "dev:cornerstone": "yarn run dev", - "build": "cross-env NODE_ENV=production webpack --config .webpack/webpack.prod.js", - "build:package": "yarn run build", - "start": "yarn run dev", - "test:unit": "jest --watchAll", - "test:unit:ci": "jest --ci --runInBand --collectCoverage" - }, - "peerDependencies": {}, - "dependencies": { - "@babel/runtime": "7.7.6" - } -} diff --git a/modes/SRViewportExample/src/index.js b/modes/SRViewportExample/src/index.js deleted file mode 100644 index 542e42108..000000000 --- a/modes/SRViewportExample/src/index.js +++ /dev/null @@ -1,108 +0,0 @@ -export default function mode({ modeConfiguration }) { - return { - id: 'sr-example-mode', - validationTags: { - study: [], - series: [], - }, - isValidMode: (studyTags, seriesTags) => { - // All series are welcome in this mode! - return true; - }, - routes: [ - { - path: 'viewer', - init: ({ servicesManager, extensionManager }) => { - const { ToolBarService } = servicesManager.services; - ToolBarService.init(extensionManager); - ToolBarService.addButtons([ - { - id: 'Zoom', - namespace: 'org.ohif.cornerstone.toolbarModule.Zoom', - }, - { - id: 'Levels', - namespace: 'org.ohif.cornerstone.toolbarModule.Wwwc', - }, - { - id: 'Pan', - namespace: 'org.ohif.cornerstone.toolbarModule.Pan', - }, - { - id: 'Capture', - namespace: 'org.ohif.cornerstone.toolbarModule.Capture', - }, - { - id: 'Layout', - namespace: 'org.ohif.default.toolbarModule.Layout', - }, - { - id: 'Annotate', - namespace: 'org.ohif.cornerstone.toolbarModule.Annotate', - }, - { - id: 'Bidirectional', - namespace: 'org.ohif.cornerstone.toolbarModule.Bidirectional', - }, - { - id: 'Ellipse', - namespace: 'org.ohif.cornerstone.toolbarModule.Ellipse', - }, - { - id: 'Length', - namespace: 'org.ohif.cornerstone.toolbarModule.Length', - }, - ]); - - // Could import layout selector here from org.ohif.default (when it exists!) - ToolBarService.setToolBarLayout([ - // Primary - { - tools: ['Zoom', 'Levels', 'Pan', 'Capture', 'Layout'], - moreTools: ['Zoom'], - }, - // Secondary - { - tools: ['Annotate', 'Bidirectional', 'Ellipse', 'Length'], - }, - ]); - }, - layoutTemplate: ({ routeProps }) => { - return { - id: 'org.ohif.default.layoutTemplateModule.viewerLayout', - props: { - // named slots - leftPanels: ['org.ohif.default.panelModule.seriesList'], - rightPanels: ['org.ohif.default.panelModule.measure'], - viewports: [ - { - namespace: 'org.ohif.cornerstone.viewportModule.cornerstone', - displaySetsToDisplay: [ - 'org.ohif.default.sopClassHandlerModule.stack', - ], - }, - { - namespace: 'org.ohif.dicom-sr.viewportModule.dicom-sr', - displaySetsToDisplay: [ - 'org.ohif.dicom-sr.sopClassHandlerModule.dicom-sr', - ], - }, - ], - }, - }; - }, - }, - ], - extensions: [ - 'org.ohif.default', - 'org.ohif.cornerstone', - 'org.ohif.dicom-sr', - ], - sopClassHandlers: [ - 'org.ohif.default.sopClassHandlerModule.stack', - 'org.ohif.dicom-sr.sopClassHandlerModule.dicom-sr', - ], - }; -} - -window.SRViewportExample = mode({}); diff --git a/platform/viewer/src/App.jsx b/platform/viewer/src/App.jsx index 67edc6af2..c65292a05 100644 --- a/platform/viewer/src/App.jsx +++ b/platform/viewer/src/App.jsx @@ -21,7 +21,6 @@ import appInit from './appInit.js'; // TODO: Temporarily for testing import '@ohif/mode-example'; -import '@ohif/sr-mode-example'; import '@ohif/mode-longitudinal'; /** diff --git a/platform/viewer/src/appInit.js b/platform/viewer/src/appInit.js index c5de2134e..ef8c16641 100644 --- a/platform/viewer/src/appInit.js +++ b/platform/viewer/src/appInit.js @@ -71,7 +71,6 @@ function appInit(appConfigOrFunc, defaultExtensions) { if (!appConfig.modes.length) { appConfig.modes.push(window.exampleMode); appConfig.modes.push(window.longitudinalMode); - appConfig.modes.push(window.SRViewportExample); } return {