chore: Clean up unused files, imports, and work on getting end-to-end tests and unit tests running (#2272)
This commit is contained in:
1 parent
414ebc6850
commit
0db81b30f3
374 files changed
+14138
-21288
No files matched your search
@@ -30,7 +30,7 @@ module.exports = (env, argv) => {
|
||||
},
|
||||
output: {
|
||||
path: ROOT_DIR,
|
||||
library: 'OHIFExtCornerstone',
|
||||
library: 'OHIFModeLongitudinal',
|
||||
libraryTarget: 'umd',
|
||||
libraryExport: 'default',
|
||||
filename: pkg.main,
|
||||
|
||||
@@ -26,10 +26,16 @@
|
||||
"build:package": "yarn run build",
|
||||
"start": "yarn run dev",
|
||||
"test:unit": "jest --watchAll",
|
||||
"test:unit:ci": "jest --ci --runInBand --collectCoverage"
|
||||
"test:unit:ci": "jest --ci --runInBand --collectCoverage --passWithNoTests"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@ohif/core": "^2.12.3"
|
||||
},
|
||||
"peerDependencies": {},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "7.7.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"webpack": "^5.21.2",
|
||||
"webpack-merge": "^5.7.3"
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ function _createButton(type, id, icon, label, commandName, commandOptions) {
|
||||
label,
|
||||
type,
|
||||
commandName,
|
||||
commandOptions,
|
||||
commandOptions
|
||||
};
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ const _createToolButton = _createButton.bind(null, 'tool');
|
||||
*/
|
||||
function _createWwwcPreset(preset, title, subtitle) {
|
||||
return {
|
||||
id: preset,
|
||||
id: preset.toString(),
|
||||
title,
|
||||
subtitle,
|
||||
type: 'action',
|
||||
@@ -111,6 +111,7 @@ export default [
|
||||
id: 'WindowLevel',
|
||||
type: 'ohif.splitButton',
|
||||
props: {
|
||||
groupId: 'Wwwc',
|
||||
primary: _createToolButton(
|
||||
'Wwwc',
|
||||
'tool-window-level',
|
||||
@@ -168,7 +169,7 @@ export default [
|
||||
isRadio: true, // ?
|
||||
groupId: 'MoreTools',
|
||||
primary: _createActionButton(
|
||||
'reset',
|
||||
'Reset',
|
||||
'tool-reset',
|
||||
'Reset View',
|
||||
'resetViewport'
|
||||
@@ -181,7 +182,7 @@ export default [
|
||||
},
|
||||
items: [
|
||||
_createActionButton(
|
||||
'reset',
|
||||
'Reset',
|
||||
'tool-reset',
|
||||
'Reset View',
|
||||
'resetViewport'
|
||||
|
||||
@@ -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 });
|
||||
};
|
||||
@@ -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,
|
||||
}),
|
||||
],
|
||||
});
|
||||
};
|
||||
@@ -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.
|
||||
@@ -1 +0,0 @@
|
||||
module.exports = require('../../babel.config.js');
|
||||
@@ -1,35 +0,0 @@
|
||||
{
|
||||
"name": "@ohif/mode-segmentation",
|
||||
"version": "0.0.1",
|
||||
"description": "Segmentation 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"
|
||||
}
|
||||
}
|
||||
@@ -1,77 +0,0 @@
|
||||
import toolbarButtons from './toolbarButtons.js';
|
||||
import { hotkeys } from '@ohif/core';
|
||||
|
||||
export default function mode({ modeConfiguration }) {
|
||||
return {
|
||||
// TODO: Mode uses 'id' for route when it should use `slug`, if provided, and
|
||||
// the route path
|
||||
id: 'segmentation',
|
||||
displayName: 'Segmentation',
|
||||
validationTags: {
|
||||
study: [],
|
||||
series: [],
|
||||
},
|
||||
isValidMode: (studyTags, seriesTags) => {
|
||||
// All series are welcome in this mode!
|
||||
return true;
|
||||
},
|
||||
routes: [
|
||||
{
|
||||
path: 'segmentation',
|
||||
init: ({ servicesManager, extensionManager }) => {
|
||||
const { ToolBarService } = servicesManager.services;
|
||||
ToolBarService.init(extensionManager);
|
||||
ToolBarService.addButtons(toolbarButtons);
|
||||
ToolBarService.createButtonSection('primary', [
|
||||
'Zoom',
|
||||
'Wwwc',
|
||||
'Pan',
|
||||
'Capture',
|
||||
'Layout',
|
||||
'Divider',
|
||||
[
|
||||
'ResetView',
|
||||
'RotateClockwise',
|
||||
'FlipHorizontally',
|
||||
'StackScroll',
|
||||
'Magnify',
|
||||
'Invert',
|
||||
'Cine',
|
||||
'Angle',
|
||||
'Probe',
|
||||
'RectangleRoi',
|
||||
],
|
||||
]);
|
||||
ToolBarService.createButtonSection('secondary', [
|
||||
'Annotate',
|
||||
'Bidirectional',
|
||||
'Ellipse',
|
||||
'Length',
|
||||
]);
|
||||
},
|
||||
layoutTemplate: ({ routeProps }) => {
|
||||
return {
|
||||
id: 'org.ohif.default.layoutTemplateModule.viewerLayout',
|
||||
props: {
|
||||
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',
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
],
|
||||
extensions: ['org.ohif.default', 'org.ohif.cornerstone'],
|
||||
sopClassHandlers: ['org.ohif.default.sopClassHandlerModule.stack'],
|
||||
hotkeys: [...hotkeys.defaults.hotkeyBindings],
|
||||
};
|
||||
}
|
||||
|
||||
window.segmentationMode = mode({});
|
||||
@@ -1,259 +0,0 @@
|
||||
// TODO: torn, can either bake this here; or have to create a whole new button type
|
||||
// Only ways that you can pass in a custom React component for render :l
|
||||
|
||||
export default [
|
||||
// Divider
|
||||
{
|
||||
id: 'Divider',
|
||||
type: 'ohif.divider',
|
||||
},
|
||||
// ~~ Primary
|
||||
{
|
||||
id: 'Zoom',
|
||||
type: 'ohif.radioGroup',
|
||||
config: {
|
||||
groupName: 'primaryTool',
|
||||
},
|
||||
props: {
|
||||
isActive: false,
|
||||
icon: 'tool-zoom',
|
||||
label: 'Zoom',
|
||||
commandName: 'setToolActive',
|
||||
commandOptions: { toolName: 'Zoom' },
|
||||
type: 'primary',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'Wwwc',
|
||||
type: 'ohif.radioGroup',
|
||||
config: {
|
||||
groupName: 'primaryTool',
|
||||
},
|
||||
props: {
|
||||
isActive: true,
|
||||
icon: 'tool-window-level',
|
||||
label: 'Levels',
|
||||
commandName: 'setToolActive',
|
||||
commandOptions: { toolName: 'Wwwc' },
|
||||
type: 'primary',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'Pan',
|
||||
type: 'ohif.radioGroup',
|
||||
config: {
|
||||
groupName: 'primaryTool',
|
||||
},
|
||||
props: {
|
||||
isActive: false,
|
||||
icon: 'tool-move',
|
||||
label: 'Pan',
|
||||
commandName: 'setToolActive',
|
||||
commandOptions: { toolName: 'Pan' },
|
||||
type: 'primary',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'Capture',
|
||||
type: 'ohif.action',
|
||||
props: {
|
||||
icon: 'tool-capture',
|
||||
label: 'Capture',
|
||||
commandName: 'showDownloadViewportModal',
|
||||
type: 'primary',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'Layout',
|
||||
type: 'ohif.layoutSelector',
|
||||
},
|
||||
// ~~ Primary: NESTED
|
||||
{
|
||||
id: 'ResetView',
|
||||
type: 'ohif.action',
|
||||
props: {
|
||||
icon: 'tool-reset',
|
||||
label: 'Reset View',
|
||||
commandName: 'resetViewport',
|
||||
type: 'primary',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'RotateClockwise',
|
||||
type: 'ohif.action',
|
||||
props: {
|
||||
icon: 'tool-rotate-right',
|
||||
label: 'Rotate Right',
|
||||
commandName: 'rotateViewportCW',
|
||||
type: 'primary',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'FlipHorizontally',
|
||||
type: 'ohif.action',
|
||||
props: {
|
||||
icon: 'tool-flip-horizontal',
|
||||
label: 'Flip Horizontally',
|
||||
commandName: 'flipViewportHorizontal',
|
||||
type: 'primary',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'StackScroll',
|
||||
type: 'ohif.radioGroup',
|
||||
config: {
|
||||
groupName: 'primaryTool',
|
||||
},
|
||||
props: {
|
||||
isActive: false,
|
||||
icon: 'tool-stack-scroll',
|
||||
label: 'Stack Scroll',
|
||||
commandName: 'setToolActive',
|
||||
commandOptions: { toolName: 'StackScroll' },
|
||||
type: 'primary',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'Magnify',
|
||||
type: 'ohif.radioGroup',
|
||||
config: {
|
||||
groupName: 'primaryTool',
|
||||
},
|
||||
props: {
|
||||
isActive: false,
|
||||
icon: 'tool-magnify',
|
||||
label: 'Magnify',
|
||||
commandName: 'setToolActive',
|
||||
commandOptions: { toolName: 'Magnify' },
|
||||
type: 'primary',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'Invert',
|
||||
type: 'ohif.action',
|
||||
props: {
|
||||
icon: 'tool-invert',
|
||||
label: 'Invert',
|
||||
commandName: 'invertViewport',
|
||||
type: 'primary',
|
||||
},
|
||||
},
|
||||
// TODO: Toggle
|
||||
{
|
||||
id: 'Cine',
|
||||
type: 'ohif.action',
|
||||
props: {
|
||||
icon: 'tool-cine',
|
||||
label: 'Cine',
|
||||
commandName: '',
|
||||
type: 'primary',
|
||||
},
|
||||
},
|
||||
// TODO: 2D MPR: We had said this was off the table?
|
||||
{
|
||||
id: 'Angle',
|
||||
type: 'ohif.radioGroup',
|
||||
config: {
|
||||
groupName: 'primaryTool',
|
||||
},
|
||||
props: {
|
||||
isActive: false,
|
||||
icon: 'tool-angle',
|
||||
label: 'Angle',
|
||||
commandName: 'setToolActive',
|
||||
commandOptions: { toolName: 'Angle' },
|
||||
type: 'primary',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'Probe',
|
||||
type: 'ohif.radioGroup',
|
||||
config: {
|
||||
groupName: 'primaryTool',
|
||||
},
|
||||
props: {
|
||||
isActive: false,
|
||||
icon: 'tool-probe',
|
||||
label: 'Probe',
|
||||
commandName: 'setToolActive',
|
||||
commandOptions: { toolName: 'Probe' },
|
||||
type: 'primary',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'RectangleRoi',
|
||||
type: 'ohif.radioGroup',
|
||||
config: {
|
||||
groupName: 'primaryTool',
|
||||
},
|
||||
props: {
|
||||
isActive: false,
|
||||
icon: 'tool-rectangle',
|
||||
label: 'Rectangle',
|
||||
commandName: 'setToolActive',
|
||||
commandOptions: { toolName: 'RectangleRoi' },
|
||||
type: 'primary',
|
||||
},
|
||||
},
|
||||
// ~~ Secondary
|
||||
{
|
||||
id: 'Annotate',
|
||||
type: 'ohif.radioGroup',
|
||||
config: {
|
||||
groupName: 'primaryTool',
|
||||
},
|
||||
props: {
|
||||
isActive: false,
|
||||
icon: 'tool-annotate',
|
||||
label: 'Annotate',
|
||||
commandName: 'setToolActive',
|
||||
commandOptions: { toolName: 'ArrowAnnotate' },
|
||||
type: 'secondary',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'Bidirectional',
|
||||
type: 'ohif.radioGroup',
|
||||
config: {
|
||||
groupName: 'primaryTool',
|
||||
},
|
||||
props: {
|
||||
isActive: false,
|
||||
icon: 'tool-bidirectional',
|
||||
label: 'Bidirectional',
|
||||
commandName: 'setToolActive',
|
||||
commandOptions: { toolName: 'Bidirectional' },
|
||||
type: 'secondary',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'Ellipse',
|
||||
type: 'ohif.radioGroup',
|
||||
config: {
|
||||
groupName: 'primaryTool',
|
||||
},
|
||||
props: {
|
||||
isActive: false,
|
||||
icon: 'tool-elipse',
|
||||
label: 'Ellipse',
|
||||
commandName: 'setToolActive',
|
||||
commandOptions: { toolName: 'EllipticalRoi' },
|
||||
type: 'secondary',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'Length',
|
||||
type: 'ohif.radioGroup',
|
||||
config: {
|
||||
groupName: 'primaryTool',
|
||||
},
|
||||
props: {
|
||||
isActive: false,
|
||||
icon: 'tool-length',
|
||||
label: 'Length',
|
||||
commandName: 'setToolActive',
|
||||
commandOptions: { toolName: 'Length' },
|
||||
type: 'secondary',
|
||||
},
|
||||
},
|
||||
];
|
||||
Reference in new issue
Block a user