forked from OHIF/Viewers
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: lesion-tracker extension (OHIF#1420)
* chore: init lesion-tracker extension * chore: dev build for lesion-tracker extension * fix: a more appropriate library name * chore: fix script naming
- Loading branch information
Showing
11 changed files
with
306 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
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 }); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
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: 'OHIFExtLesionTracker', | ||
libraryTarget: 'umd', | ||
libraryExport: 'default', | ||
filename: pkg.main, | ||
}, | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# @ohif/extension-lesion-tracker | ||
|
||
This project is an OHIF extension that can be used with the Core OHIF Platform, | ||
either at runtime, or as an ES6 dependency, to create a medical image viewing | ||
application similar to that of the [legacy Lesion | ||
Tracker][legacy-lesion-tracker] viewer. | ||
|
||
## About | ||
|
||
... | ||
|
||
## Scope | ||
|
||
... | ||
|
||
### Configuration | ||
|
||
... | ||
|
||
### Extensions | ||
|
||
... | ||
|
||
## Build & Deploy | ||
|
||
... | ||
|
||
## Funding/Support | ||
|
||
... | ||
|
||
<!-- | ||
LINKS | ||
--> | ||
|
||
<!-- prettier-ignore-start --> | ||
[legacy-lesion-tracker]: http://lesiontracker.ohif.org/studylist | ||
<!-- prettier-ignore-end --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"name": "@ohif/extension-lesion-tracker", | ||
"version": "0.0.1", | ||
"description": "OHIF extension for Lesion Tracker", | ||
"author": "OHIF", | ||
"license": "MIT", | ||
"repository": "OHIF/Viewers", | ||
"main": "dist/index.umd.js", | ||
"module": "src/index.js", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"engines": { | ||
"node": ">=10", | ||
"npm": ">=6", | ||
"yarn": ">=1.16.0" | ||
}, | ||
"files": [ | ||
"dist", | ||
"README.md" | ||
], | ||
"scripts": { | ||
"dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --debug --output-pathinfo", | ||
"dev:lesion-tracker": "yarn run dev", | ||
"build": "cross-env NODE_ENV=production webpack --config .webpack/webpack.prod.js", | ||
"build:package": "yarn run build", | ||
"prepublishOnly": "yarn run build", | ||
"start": "yarn run dev" | ||
}, | ||
"peerDependencies": { | ||
"@ohif/core": "^0.50.0", | ||
"prop-types": "^15.6.2", | ||
"react": "^16.8.6", | ||
"react-dom": "^16.8.6" | ||
}, | ||
"dependencies": { | ||
"@babel/runtime": "^7.5.5", | ||
"classnames": "^2.2.6" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
// SEE: Async imports (code-splitting) | ||
// import asyncComponent from './asyncComponent.js'; | ||
// import OHIFDicomPDFSopClassHandler from './OHIFDicomPDFSopClassHandler.js'; | ||
|
||
// const ConnectedOHIFDicomPDFViewer = asyncComponent(() => | ||
// import( | ||
// /* webpackChunkName: "ConnectedOHIFDicomPDFViewer" */ './ConnectedOHIFDicomPDFViewer' | ||
// ) | ||
// ); | ||
|
||
export default { | ||
/** | ||
* Only required property. Should be a unique value across all extensions. | ||
*/ | ||
id: 'lesion-tracker', | ||
|
||
/** | ||
* @param {object} params | ||
* @param {ServicesManager} params.servicesManager | ||
* @param {CommandsManager} params.commandsManager | ||
*/ | ||
getPanelModule({ servicesManager, commandsManager }) { | ||
return undefined; | ||
// { | ||
// TODO: | ||
// - Right, alternative StudyBrowser | ||
// - Left, alternative Measurements Table | ||
// menuOptions: [ | ||
// { | ||
// // A suggested icon | ||
// // Available icons determined by consuming app | ||
// icon: 'list', | ||
// // A suggested label | ||
// label: 'Magic', | ||
// // 'right' or 'left' | ||
// from: 'right', | ||
// // The target component to toggle open/close | ||
// target: 'target-component-id', | ||
// // Overrides `defaultContext`, if specified | ||
// context: ['ACTIVE_VIEWPORT:MAGIC'], | ||
// }, | ||
// ], | ||
// components: [ | ||
// { | ||
// id: 'target-component-id', | ||
// component: MyComponent, | ||
// }, | ||
// ], | ||
// defaultContext: ['ROUTE:VIEWER'], | ||
// }; | ||
}, | ||
|
||
/** | ||
* @param {object} params | ||
* @param {ServicesManager} params.servicesManager | ||
* @param {CommandsManager} params.commandsManager | ||
* @returns Object | ||
*/ | ||
getToolbarModule({ servicesManager, commandsManager }) { | ||
// TODO: Zoom, Levels, Pan, More (see lesiontracker.ohif.org) | ||
// These may be driven through configuration of `cornerstone` extension instead of defined here | ||
return { | ||
definitions: [ | ||
{ | ||
id: 'say-hell-world', | ||
label: '🎉 HELLO WORLD 🎉', | ||
icon: 'exclamation-triangle', | ||
type: 'command', | ||
commandName: 'sayHelloWorld', | ||
}, | ||
], | ||
defaultContext: 'VIEWER', | ||
}; | ||
}, | ||
|
||
/** | ||
* @param {object} params | ||
* @param {ServicesManager} params.servicesManager | ||
* @param {CommandsManager} params.commandsManager | ||
* @returns Object | ||
*/ | ||
getCommandsModule({ servicesManager }) { | ||
const { UINotificationService } = servicesManager.services; | ||
return { | ||
definitions: { | ||
sayHelloWorld: { | ||
commandFn: function() { | ||
console.log(UINotificationService); | ||
UINotificationService.show({ | ||
title: 'What does a nosey pepper do?', | ||
message: 'Gets jalapeno business!', | ||
}); | ||
}, | ||
storeContexts: [], | ||
options: {}, | ||
}, | ||
}, | ||
defaultContext: ['VIEWER'], | ||
}; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* Entry point for development and production PWA builds. | ||
* Packaged (NPM) builds go through `index-umd.js` | ||
*/ | ||
|
||
import 'regenerator-runtime/runtime'; | ||
|
||
import App from './App.js'; | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
|
||
/** | ||
* EXTENSIONS | ||
* ================= | ||
* | ||
* Importing and modifying the extensions our app uses HERE allows us to leverage | ||
* tree shaking and a few other niceties. However, by including them here they become | ||
* "baked in" to the published application. | ||
* | ||
* Depending on your use case/needs, you may want to consider not adding any extensions | ||
* by default HERE, and instead provide them via the extensions configuration key or | ||
* by using the exported `App` component, and passing in your extensions as props using | ||
* the defaultExtensions property. | ||
*/ | ||
import OHIFLesionTrackerExtension from '@ohif/extension-lesion-tracker'; | ||
import OHIFDicomPDFExtension from '@ohif/extension-dicom-pdf'; | ||
|
||
/* | ||
* Default Settings | ||
*/ | ||
let config = {}; | ||
|
||
if (window) { | ||
config = window.config || {}; | ||
} | ||
|
||
const appProps = { | ||
config, | ||
defaultExtensions: [OHIFLesionTrackerExtension, OHIFDicomPDFExtension], | ||
}; | ||
|
||
/** Create App */ | ||
const app = React.createElement(App, appProps, null); | ||
|
||
/** Render */ | ||
ReactDOM.render(app, document.getElementById('root')); |
Oops, something went wrong.