init
This commit is contained in:
12
modes/longitudinal/.webpack/webpack.dev.js
Normal file
12
modes/longitudinal/.webpack/webpack.dev.js
Normal file
@@ -0,0 +1,12 @@
|
||||
const path = require('path');
|
||||
const webpackCommon = require('./../../../.webpack/webpack.base.js');
|
||||
const SRC_DIR = path.join(__dirname, '../src');
|
||||
const DIST_DIR = path.join(__dirname, '../dist');
|
||||
|
||||
const ENTRY = {
|
||||
app: `${SRC_DIR}/index.ts`,
|
||||
};
|
||||
|
||||
module.exports = (env, argv) => {
|
||||
return webpackCommon(env, argv, { SRC_DIR, DIST_DIR, ENTRY });
|
||||
};
|
||||
53
modes/longitudinal/.webpack/webpack.prod.js
Normal file
53
modes/longitudinal/.webpack/webpack.prod.js
Normal file
@@ -0,0 +1,53 @@
|
||||
const webpack = require('webpack');
|
||||
const { merge } = require('webpack-merge');
|
||||
const path = require('path');
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||
|
||||
const pkg = require('./../package.json');
|
||||
const webpackCommon = require('./../../../.webpack/webpack.base.js');
|
||||
|
||||
const ROOT_DIR = path.join(__dirname, './../');
|
||||
const SRC_DIR = path.join(__dirname, '../src');
|
||||
const DIST_DIR = path.join(__dirname, '../dist');
|
||||
const ENTRY = {
|
||||
app: `${SRC_DIR}/index.ts`,
|
||||
};
|
||||
|
||||
module.exports = (env, argv) => {
|
||||
const commonConfig = webpackCommon(env, argv, { SRC_DIR, DIST_DIR, ENTRY });
|
||||
|
||||
return merge(commonConfig, {
|
||||
stats: {
|
||||
colors: true,
|
||||
hash: true,
|
||||
timings: true,
|
||||
assets: true,
|
||||
chunks: false,
|
||||
chunkModules: false,
|
||||
modules: false,
|
||||
children: false,
|
||||
warnings: true,
|
||||
},
|
||||
optimization: {
|
||||
minimize: true,
|
||||
sideEffects: false,
|
||||
},
|
||||
output: {
|
||||
path: ROOT_DIR,
|
||||
library: 'ohif-mode-longitudinal',
|
||||
libraryTarget: 'umd',
|
||||
libraryExport: 'default',
|
||||
filename: pkg.main,
|
||||
},
|
||||
externals: [/\b(vtk.js)/, /\b(dcmjs)/, /\b(gl-matrix)/, /^@ohif/, /^@cornerstonejs/],
|
||||
plugins: [
|
||||
new webpack.optimize.LimitChunkCountPlugin({
|
||||
maxChunks: 1,
|
||||
}),
|
||||
// new MiniCssExtractPlugin({
|
||||
// filename: './dist/[name].css',
|
||||
// chunkFilename: './dist/[id].css',
|
||||
// }),
|
||||
],
|
||||
});
|
||||
};
|
||||
2213
modes/longitudinal/CHANGELOG.md
Normal file
2213
modes/longitudinal/CHANGELOG.md
Normal file
File diff suppressed because it is too large
Load Diff
21
modes/longitudinal/LICENSE
Normal file
21
modes/longitudinal/LICENSE
Normal file
@@ -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.
|
||||
60
modes/longitudinal/README.md
Normal file
60
modes/longitudinal/README.md
Normal file
@@ -0,0 +1,60 @@
|
||||
# Measurement Tracking Mode
|
||||
|
||||
|
||||
|
||||
## Introduction
|
||||
Measurement tracking mode allows you to:
|
||||
|
||||
- Draw annotations and have them shown in the measurement panel
|
||||
- Create a report from the tracked measurement and export them as DICOM SR
|
||||
- Use already exported DICOM SR to re-hydrate the measurements in the viewer
|
||||
|
||||

|
||||
|
||||
## Workflow
|
||||
|
||||
|
||||
### Status Icon
|
||||
Each viewport has a left icon indicating whether the series within the viewport contains:
|
||||
|
||||
- tracked measurement OR
|
||||
- untracked measurement OR
|
||||
- Structured Report OR
|
||||
- Locked (uneditable) Structured Report
|
||||
|
||||
In the following, we will discuss each category.
|
||||
|
||||

|
||||
|
||||
### Tracked vs Untracked Measurements
|
||||
|
||||
OHIF-v3 implements a workflow for measurement tracking that can be seen below.
|
||||
In summary, when you create an annotation, a prompt will be shown whether to start tracking or not. If you start the tracking, the annotation style will change to a solid line, and annotation details get displayed on the measurement panel. On the other hand, if you decline the tracking prompt, the measurement will be considered "temporary," and annotation style remains as a dashed line and not shown on the right panel, and cannot be exported.
|
||||
|
||||
Below, you can see different icons that appear for a tracked vs. untracked series in OHIF-v3.
|
||||
|
||||
|
||||

|
||||
|
||||
|
||||
### Reading and Writing DICOM SR
|
||||
OHIF-v3 provides full support for reading, writing and mapping the DICOM Structured Report (SR) to interactable Cornerstone Tools. When you load an already exported DICOM SR into the viewer, you will be prompted whether to track the measurements for the series or not.
|
||||
|
||||
|
||||

|
||||
|
||||
If you click Yes, DICOM SR measurements gets re-hydrated into the viewer and the series become a tracked series. However, If you say no and later decide to say track the measurements, you can always click on the SR button that will prompt you with the same message again.
|
||||
|
||||
|
||||

|
||||
|
||||
The full workflow for saving measurements to SR and loading SR into the viewer is shown below.
|
||||
|
||||

|
||||
|
||||
|
||||
### Loading DICOM SR into an Already Tracked Series
|
||||
|
||||
If you have an already tracked series and try to load a DICOM SR measurements, you will be shown the following lock icon. This means that, you can review the DICOM SR measurement, manipulate image and draw "temporary" measurements; however, you cannot edit the DICOM SR measurement.
|
||||
|
||||

|
||||
BIN
modes/longitudinal/assets/locked.png
Normal file
BIN
modes/longitudinal/assets/locked.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
BIN
modes/longitudinal/assets/preview.png
Normal file
BIN
modes/longitudinal/assets/preview.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
BIN
modes/longitudinal/assets/restore.png
Normal file
BIN
modes/longitudinal/assets/restore.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
BIN
modes/longitudinal/assets/sr-import.png
Normal file
BIN
modes/longitudinal/assets/sr-import.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 191 KiB |
BIN
modes/longitudinal/assets/tracked.png
Normal file
BIN
modes/longitudinal/assets/tracked.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 53 KiB |
BIN
modes/longitudinal/assets/workflow.png
Normal file
BIN
modes/longitudinal/assets/workflow.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 870 KiB |
1
modes/longitudinal/babel.config.js
Normal file
1
modes/longitudinal/babel.config.js
Normal file
@@ -0,0 +1 @@
|
||||
module.exports = require('../../babel.config.js');
|
||||
55
modes/longitudinal/package.json
Normal file
55
modes/longitudinal/package.json
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"name": "@ohif/mode-longitudinal",
|
||||
"version": "3.9.1",
|
||||
"description": "Longitudinal Workflow",
|
||||
"author": "OHIF",
|
||||
"license": "MIT",
|
||||
"repository": "OHIF/Viewers",
|
||||
"main": "dist/ohif-mode-longitudinal.js",
|
||||
"module": "src/index.ts",
|
||||
"engines": {
|
||||
"node": ">=14",
|
||||
"npm": ">=6",
|
||||
"yarn": ">=1.16.0"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"README.md"
|
||||
],
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"keywords": [
|
||||
"ohif-mode"
|
||||
],
|
||||
"scripts": {
|
||||
"clean": "shx rm -rf dist",
|
||||
"clean:deep": "yarn run clean && shx rm -rf node_modules",
|
||||
"dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --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 --passWithNoTests"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@ohif/core": "3.9.1",
|
||||
"@ohif/extension-cornerstone": "3.9.1",
|
||||
"@ohif/extension-cornerstone-dicom-rt": "3.9.1",
|
||||
"@ohif/extension-cornerstone-dicom-seg": "3.9.1",
|
||||
"@ohif/extension-cornerstone-dicom-sr": "3.9.1",
|
||||
"@ohif/extension-default": "3.9.1",
|
||||
"@ohif/extension-dicom-pdf": "3.9.1",
|
||||
"@ohif/extension-dicom-video": "3.9.1",
|
||||
"@ohif/extension-measurement-tracking": "3.9.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.20.13",
|
||||
"i18next": "^17.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"webpack": "5.94.0",
|
||||
"webpack-merge": "^5.7.3"
|
||||
}
|
||||
}
|
||||
26
modes/longitudinal/src/customizations.tsx
Normal file
26
modes/longitudinal/src/customizations.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
export const performCustomizations = customizationService => {
|
||||
// Set the custom SegmentationTable
|
||||
customizationService.addModeCustomizations([
|
||||
// To disable editing in the SegmentationTable
|
||||
{
|
||||
id: 'PanelSegmentation.disableEditing',
|
||||
disableEditing: true,
|
||||
},
|
||||
// To disable editing in the MeasurementTable
|
||||
// {
|
||||
// id: 'PanelMeasurement.disableEditing',
|
||||
// disableEditing: true,
|
||||
// },
|
||||
// {
|
||||
// id: 'measurementLabels',
|
||||
// labelOnMeasure: true,
|
||||
// exclusive: true,
|
||||
// items: [
|
||||
// { value: 'Head', label: 'Head' },
|
||||
// { value: 'Shoulder', label: 'Shoulder' },
|
||||
// { value: 'Knee', label: 'Knee' },
|
||||
// { value: 'Toe', label: 'Toe' },
|
||||
// ],
|
||||
// },
|
||||
]);
|
||||
};
|
||||
5
modes/longitudinal/src/id.js
Normal file
5
modes/longitudinal/src/id.js
Normal file
@@ -0,0 +1,5 @@
|
||||
import packageJson from '../package.json';
|
||||
|
||||
const id = packageJson.name;
|
||||
|
||||
export { id };
|
||||
252
modes/longitudinal/src/index.ts
Normal file
252
modes/longitudinal/src/index.ts
Normal file
@@ -0,0 +1,252 @@
|
||||
import { hotkeys } from '@ohif/core';
|
||||
import i18n from 'i18next';
|
||||
import { id } from './id';
|
||||
import initToolGroups from './initToolGroups';
|
||||
import toolbarButtons from './toolbarButtons';
|
||||
import moreTools from './moreTools';
|
||||
import { performCustomizations } from './customizations';
|
||||
|
||||
// Allow this mode by excluding non-imaging modalities such as SR, SEG
|
||||
// Also, SM is not a simple imaging modalities, so exclude it.
|
||||
const NON_IMAGE_MODALITIES = ['ECG', 'SEG', 'RTSTRUCT', 'RTPLAN', 'PR'];
|
||||
|
||||
const ohif = {
|
||||
layout: '@ohif/extension-default.layoutTemplateModule.viewerLayout',
|
||||
sopClassHandler: '@ohif/extension-default.sopClassHandlerModule.stack',
|
||||
thumbnailList: '@ohif/extension-default.panelModule.seriesList',
|
||||
wsiSopClassHandler:
|
||||
'@ohif/extension-cornerstone.sopClassHandlerModule.DicomMicroscopySopClassHandler',
|
||||
};
|
||||
|
||||
const cornerstone = {
|
||||
measurements: '@ohif/extension-cornerstone.panelModule.panelMeasurement',
|
||||
segmentation: '@ohif/extension-cornerstone.panelModule.panelSegmentation',
|
||||
};
|
||||
|
||||
const tracked = {
|
||||
measurements: '@ohif/extension-measurement-tracking.panelModule.trackedMeasurements',
|
||||
thumbnailList: '@ohif/extension-measurement-tracking.panelModule.seriesList',
|
||||
viewport: '@ohif/extension-measurement-tracking.viewportModule.cornerstone-tracked',
|
||||
};
|
||||
|
||||
const dicomsr = {
|
||||
sopClassHandler: '@ohif/extension-cornerstone-dicom-sr.sopClassHandlerModule.dicom-sr',
|
||||
sopClassHandler3D: '@ohif/extension-cornerstone-dicom-sr.sopClassHandlerModule.dicom-sr-3d',
|
||||
viewport: '@ohif/extension-cornerstone-dicom-sr.viewportModule.dicom-sr',
|
||||
};
|
||||
|
||||
const dicomvideo = {
|
||||
sopClassHandler: '@ohif/extension-dicom-video.sopClassHandlerModule.dicom-video',
|
||||
viewport: '@ohif/extension-dicom-video.viewportModule.dicom-video',
|
||||
};
|
||||
|
||||
const dicompdf = {
|
||||
sopClassHandler: '@ohif/extension-dicom-pdf.sopClassHandlerModule.dicom-pdf',
|
||||
viewport: '@ohif/extension-dicom-pdf.viewportModule.dicom-pdf',
|
||||
};
|
||||
|
||||
const dicomSeg = {
|
||||
sopClassHandler: '@ohif/extension-cornerstone-dicom-seg.sopClassHandlerModule.dicom-seg',
|
||||
viewport: '@ohif/extension-cornerstone-dicom-seg.viewportModule.dicom-seg',
|
||||
};
|
||||
|
||||
const dicomPmap = {
|
||||
sopClassHandler: '@ohif/extension-cornerstone-dicom-pmap.sopClassHandlerModule.dicom-pmap',
|
||||
viewport: '@ohif/extension-cornerstone-dicom-pmap.viewportModule.dicom-pmap',
|
||||
};
|
||||
|
||||
const dicomRT = {
|
||||
viewport: '@ohif/extension-cornerstone-dicom-rt.viewportModule.dicom-rt',
|
||||
sopClassHandler: '@ohif/extension-cornerstone-dicom-rt.sopClassHandlerModule.dicom-rt',
|
||||
};
|
||||
|
||||
const extensionDependencies = {
|
||||
// Can derive the versions at least process.env.from npm_package_version
|
||||
'@ohif/extension-default': '^3.0.0',
|
||||
'@ohif/extension-cornerstone': '^3.0.0',
|
||||
'@ohif/extension-measurement-tracking': '^3.0.0',
|
||||
'@ohif/extension-cornerstone-dicom-sr': '^3.0.0',
|
||||
'@ohif/extension-cornerstone-dicom-seg': '^3.0.0',
|
||||
'@ohif/extension-cornerstone-dicom-pmap': '^3.0.0',
|
||||
'@ohif/extension-cornerstone-dicom-rt': '^3.0.0',
|
||||
'@ohif/extension-dicom-pdf': '^3.0.1',
|
||||
'@ohif/extension-dicom-video': '^3.0.1',
|
||||
};
|
||||
|
||||
function modeFactory({ modeConfiguration }) {
|
||||
let _activatePanelTriggersSubscriptions = [];
|
||||
return {
|
||||
// TODO: We're using this as a route segment
|
||||
// We should not be.
|
||||
id,
|
||||
routeName: 'viewer',
|
||||
displayName: i18n.t('Modes:Basic Viewer'),
|
||||
/**
|
||||
* Lifecycle hooks
|
||||
*/
|
||||
onModeEnter: function ({ servicesManager, extensionManager, commandsManager }: withAppTypes) {
|
||||
const {
|
||||
measurementService,
|
||||
toolbarService,
|
||||
toolGroupService,
|
||||
customizationService,
|
||||
panelService,
|
||||
segmentationService,
|
||||
} = servicesManager.services;
|
||||
|
||||
measurementService.clearMeasurements();
|
||||
|
||||
performCustomizations(customizationService);
|
||||
|
||||
// Init Default and SR ToolGroups
|
||||
initToolGroups(extensionManager, toolGroupService, commandsManager, this.labelConfig);
|
||||
|
||||
toolbarService.addButtons([...toolbarButtons, ...moreTools]);
|
||||
toolbarService.createButtonSection('primary', [
|
||||
'MeasurementTools',
|
||||
'Zoom',
|
||||
'Pan',
|
||||
'TrackballRotate',
|
||||
'WindowLevel',
|
||||
'Capture',
|
||||
'Layout',
|
||||
'Crosshairs',
|
||||
'MoreTools',
|
||||
]);
|
||||
|
||||
// // ActivatePanel event trigger for when a segmentation or measurement is added.
|
||||
// // Do not force activation so as to respect the state the user may have left the UI in.
|
||||
_activatePanelTriggersSubscriptions = [
|
||||
...panelService.addActivatePanelTriggers(cornerstone.segmentation, [
|
||||
{
|
||||
sourcePubSubService: segmentationService,
|
||||
sourceEvents: [segmentationService.EVENTS.SEGMENTATION_ADDED],
|
||||
},
|
||||
]),
|
||||
...panelService.addActivatePanelTriggers(tracked.measurements, [
|
||||
{
|
||||
sourcePubSubService: measurementService,
|
||||
sourceEvents: [
|
||||
measurementService.EVENTS.MEASUREMENT_ADDED,
|
||||
measurementService.EVENTS.RAW_MEASUREMENT_ADDED,
|
||||
],
|
||||
},
|
||||
]),
|
||||
];
|
||||
},
|
||||
onModeExit: ({ servicesManager }: withAppTypes) => {
|
||||
const {
|
||||
toolGroupService,
|
||||
syncGroupService,
|
||||
segmentationService,
|
||||
cornerstoneViewportService,
|
||||
uiDialogService,
|
||||
uiModalService,
|
||||
} = servicesManager.services;
|
||||
|
||||
_activatePanelTriggersSubscriptions.forEach(sub => sub.unsubscribe());
|
||||
_activatePanelTriggersSubscriptions = [];
|
||||
|
||||
uiDialogService.dismissAll();
|
||||
uiModalService.hide();
|
||||
toolGroupService.destroy();
|
||||
syncGroupService.destroy();
|
||||
segmentationService.destroy();
|
||||
cornerstoneViewportService.destroy();
|
||||
},
|
||||
validationTags: {
|
||||
study: [],
|
||||
series: [],
|
||||
},
|
||||
|
||||
isValidMode: function ({ modalities }) {
|
||||
const modalities_list = modalities.split('\\');
|
||||
|
||||
// Exclude non-image modalities
|
||||
return {
|
||||
valid: !!modalities_list.filter(modality => NON_IMAGE_MODALITIES.indexOf(modality) === -1)
|
||||
.length,
|
||||
description:
|
||||
'The mode does not support studies that ONLY include the following modalities: SM, ECG, SEG, RTSTRUCT',
|
||||
};
|
||||
},
|
||||
routes: [
|
||||
{
|
||||
path: 'longitudinal',
|
||||
/*init: ({ servicesManager, extensionManager }) => {
|
||||
//defaultViewerRouteInit
|
||||
},*/
|
||||
layoutTemplate: () => {
|
||||
return {
|
||||
id: ohif.layout,
|
||||
props: {
|
||||
leftPanels: [tracked.thumbnailList],
|
||||
rightPanels: [cornerstone.segmentation, tracked.measurements],
|
||||
rightPanelClosed: true,
|
||||
viewports: [
|
||||
{
|
||||
namespace: tracked.viewport,
|
||||
displaySetsToDisplay: [
|
||||
ohif.sopClassHandler,
|
||||
dicomvideo.sopClassHandler,
|
||||
dicomsr.sopClassHandler3D,
|
||||
ohif.wsiSopClassHandler,
|
||||
],
|
||||
},
|
||||
{
|
||||
namespace: dicomsr.viewport,
|
||||
displaySetsToDisplay: [dicomsr.sopClassHandler],
|
||||
},
|
||||
{
|
||||
namespace: dicompdf.viewport,
|
||||
displaySetsToDisplay: [dicompdf.sopClassHandler],
|
||||
},
|
||||
{
|
||||
namespace: dicomSeg.viewport,
|
||||
displaySetsToDisplay: [dicomSeg.sopClassHandler],
|
||||
},
|
||||
{
|
||||
namespace: dicomPmap.viewport,
|
||||
displaySetsToDisplay: [dicomPmap.sopClassHandler],
|
||||
},
|
||||
{
|
||||
namespace: dicomRT.viewport,
|
||||
displaySetsToDisplay: [dicomRT.sopClassHandler],
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
],
|
||||
extensions: extensionDependencies,
|
||||
// Default protocol gets self-registered by default in the init
|
||||
hangingProtocol: 'default',
|
||||
// Order is important in sop class handlers when two handlers both use
|
||||
// the same sop class under different situations. In that case, the more
|
||||
// general handler needs to come last. For this case, the dicomvideo must
|
||||
// come first to remove video transfer syntax before ohif uses images
|
||||
sopClassHandlers: [
|
||||
dicomvideo.sopClassHandler,
|
||||
dicomSeg.sopClassHandler,
|
||||
dicomPmap.sopClassHandler,
|
||||
ohif.sopClassHandler,
|
||||
ohif.wsiSopClassHandler,
|
||||
dicompdf.sopClassHandler,
|
||||
dicomsr.sopClassHandler3D,
|
||||
dicomsr.sopClassHandler,
|
||||
dicomRT.sopClassHandler,
|
||||
],
|
||||
hotkeys: [...hotkeys.defaults.hotkeyBindings],
|
||||
...modeConfiguration,
|
||||
};
|
||||
}
|
||||
|
||||
const mode = {
|
||||
id,
|
||||
modeFactory,
|
||||
extensionDependencies,
|
||||
};
|
||||
|
||||
export default mode;
|
||||
export { initToolGroups, moreTools, toolbarButtons };
|
||||
334
modes/longitudinal/src/initToolGroups.js
Normal file
334
modes/longitudinal/src/initToolGroups.js
Normal file
@@ -0,0 +1,334 @@
|
||||
import { toolNames as SRToolNames } from '@ohif/extension-cornerstone-dicom-sr';
|
||||
|
||||
const colours = {
|
||||
'viewport-0': 'rgb(200, 0, 0)',
|
||||
'viewport-1': 'rgb(200, 200, 0)',
|
||||
'viewport-2': 'rgb(0, 200, 0)',
|
||||
};
|
||||
|
||||
const colorsByOrientation = {
|
||||
axial: 'rgb(200, 0, 0)',
|
||||
sagittal: 'rgb(200, 200, 0)',
|
||||
coronal: 'rgb(0, 200, 0)',
|
||||
};
|
||||
|
||||
function initDefaultToolGroup(
|
||||
extensionManager,
|
||||
toolGroupService,
|
||||
commandsManager,
|
||||
toolGroupId,
|
||||
modeLabelConfig
|
||||
) {
|
||||
const utilityModule = extensionManager.getModuleEntry(
|
||||
'@ohif/extension-cornerstone.utilityModule.tools'
|
||||
);
|
||||
|
||||
const { toolNames, Enums } = utilityModule.exports;
|
||||
|
||||
const tools = {
|
||||
active: [
|
||||
{
|
||||
toolName: toolNames.WindowLevel,
|
||||
bindings: [{ mouseButton: Enums.MouseBindings.Primary }],
|
||||
},
|
||||
{
|
||||
toolName: toolNames.Pan,
|
||||
bindings: [{ mouseButton: Enums.MouseBindings.Auxiliary }],
|
||||
},
|
||||
{
|
||||
toolName: toolNames.Zoom,
|
||||
bindings: [{ mouseButton: Enums.MouseBindings.Secondary }],
|
||||
},
|
||||
{
|
||||
toolName: toolNames.StackScroll,
|
||||
bindings: [{ mouseButton: Enums.MouseBindings.Wheel }],
|
||||
},
|
||||
],
|
||||
passive: [
|
||||
{ toolName: toolNames.Length },
|
||||
{
|
||||
toolName: toolNames.ArrowAnnotate,
|
||||
configuration: {
|
||||
getTextCallback: (callback, eventDetails) => {
|
||||
if (modeLabelConfig) {
|
||||
callback(' ');
|
||||
} else {
|
||||
commandsManager.runCommand('arrowTextCallback', {
|
||||
callback,
|
||||
eventDetails,
|
||||
});
|
||||
}
|
||||
},
|
||||
changeTextCallback: (data, eventDetails, callback) => {
|
||||
if (modeLabelConfig === undefined) {
|
||||
commandsManager.runCommand('arrowTextCallback', {
|
||||
callback,
|
||||
data,
|
||||
eventDetails,
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
{ toolName: toolNames.Bidirectional },
|
||||
{ toolName: toolNames.DragProbe },
|
||||
{ toolName: toolNames.Probe },
|
||||
{ toolName: toolNames.EllipticalROI },
|
||||
{ toolName: toolNames.CircleROI },
|
||||
{ toolName: toolNames.RectangleROI },
|
||||
{ toolName: toolNames.StackScroll },
|
||||
{ toolName: toolNames.Angle },
|
||||
{ toolName: toolNames.CobbAngle },
|
||||
{ toolName: toolNames.Magnify },
|
||||
{ toolName: toolNames.CalibrationLine },
|
||||
{
|
||||
toolName: toolNames.PlanarFreehandContourSegmentation,
|
||||
configuration: {
|
||||
displayOnePointAsCrosshairs: true,
|
||||
},
|
||||
},
|
||||
{ toolName: toolNames.UltrasoundDirectional },
|
||||
{ toolName: toolNames.PlanarFreehandROI },
|
||||
{ toolName: toolNames.SplineROI },
|
||||
{ toolName: toolNames.LivewireContour },
|
||||
{ toolName: toolNames.WindowLevelRegion },
|
||||
],
|
||||
enabled: [
|
||||
{ toolName: toolNames.ImageOverlayViewer },
|
||||
{ toolName: toolNames.ReferenceLines },
|
||||
{
|
||||
toolName: SRToolNames.SRSCOORD3DPoint,
|
||||
},
|
||||
],
|
||||
disabled: [
|
||||
{
|
||||
toolName: toolNames.AdvancedMagnify,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
toolGroupService.createToolGroupAndAddTools(toolGroupId, tools);
|
||||
}
|
||||
|
||||
function initSRToolGroup(extensionManager, toolGroupService) {
|
||||
const SRUtilityModule = extensionManager.getModuleEntry(
|
||||
'@ohif/extension-cornerstone-dicom-sr.utilityModule.tools'
|
||||
);
|
||||
|
||||
if (!SRUtilityModule) {
|
||||
return;
|
||||
}
|
||||
|
||||
const CS3DUtilityModule = extensionManager.getModuleEntry(
|
||||
'@ohif/extension-cornerstone.utilityModule.tools'
|
||||
);
|
||||
|
||||
const { toolNames: SRToolNames } = SRUtilityModule.exports;
|
||||
const { toolNames, Enums } = CS3DUtilityModule.exports;
|
||||
const tools = {
|
||||
active: [
|
||||
{
|
||||
toolName: toolNames.WindowLevel,
|
||||
bindings: [
|
||||
{
|
||||
mouseButton: Enums.MouseBindings.Primary,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
toolName: toolNames.Pan,
|
||||
bindings: [
|
||||
{
|
||||
mouseButton: Enums.MouseBindings.Auxiliary,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
toolName: toolNames.Zoom,
|
||||
bindings: [
|
||||
{
|
||||
mouseButton: Enums.MouseBindings.Secondary,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
toolName: toolNames.StackScroll,
|
||||
bindings: [{ mouseButton: Enums.MouseBindings.Wheel }],
|
||||
},
|
||||
],
|
||||
passive: [
|
||||
{ toolName: SRToolNames.SRLength },
|
||||
{ toolName: SRToolNames.SRArrowAnnotate },
|
||||
{ toolName: SRToolNames.SRBidirectional },
|
||||
{ toolName: SRToolNames.SREllipticalROI },
|
||||
{ toolName: SRToolNames.SRCircleROI },
|
||||
{ toolName: SRToolNames.SRPlanarFreehandROI },
|
||||
{ toolName: SRToolNames.SRRectangleROI },
|
||||
{ toolName: toolNames.WindowLevelRegion },
|
||||
],
|
||||
enabled: [
|
||||
{
|
||||
toolName: SRToolNames.DICOMSRDisplay,
|
||||
},
|
||||
],
|
||||
// disabled
|
||||
};
|
||||
|
||||
const toolGroupId = 'SRToolGroup';
|
||||
toolGroupService.createToolGroupAndAddTools(toolGroupId, tools);
|
||||
}
|
||||
|
||||
function initMPRToolGroup(extensionManager, toolGroupService, commandsManager, modeLabelConfig) {
|
||||
const utilityModule = extensionManager.getModuleEntry(
|
||||
'@ohif/extension-cornerstone.utilityModule.tools'
|
||||
);
|
||||
|
||||
const serviceManager = extensionManager._servicesManager;
|
||||
const { cornerstoneViewportService } = serviceManager.services;
|
||||
|
||||
const { toolNames, Enums } = utilityModule.exports;
|
||||
|
||||
const tools = {
|
||||
active: [
|
||||
{
|
||||
toolName: toolNames.WindowLevel,
|
||||
bindings: [{ mouseButton: Enums.MouseBindings.Primary }],
|
||||
},
|
||||
{
|
||||
toolName: toolNames.Pan,
|
||||
bindings: [{ mouseButton: Enums.MouseBindings.Auxiliary }],
|
||||
},
|
||||
{
|
||||
toolName: toolNames.Zoom,
|
||||
bindings: [{ mouseButton: Enums.MouseBindings.Secondary }],
|
||||
},
|
||||
{
|
||||
toolName: toolNames.StackScroll,
|
||||
bindings: [{ mouseButton: Enums.MouseBindings.Wheel }],
|
||||
},
|
||||
],
|
||||
passive: [
|
||||
{ toolName: toolNames.Length },
|
||||
{
|
||||
toolName: toolNames.ArrowAnnotate,
|
||||
configuration: {
|
||||
getTextCallback: (callback, eventDetails) => {
|
||||
if (modeLabelConfig) {
|
||||
callback('');
|
||||
} else {
|
||||
commandsManager.runCommand('arrowTextCallback', {
|
||||
callback,
|
||||
eventDetails,
|
||||
});
|
||||
}
|
||||
},
|
||||
changeTextCallback: (data, eventDetails, callback) => {
|
||||
if (modeLabelConfig === undefined) {
|
||||
commandsManager.runCommand('arrowTextCallback', {
|
||||
callback,
|
||||
data,
|
||||
eventDetails,
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
{ toolName: toolNames.Bidirectional },
|
||||
{ toolName: toolNames.DragProbe },
|
||||
{ toolName: toolNames.Probe },
|
||||
{ toolName: toolNames.EllipticalROI },
|
||||
{ toolName: toolNames.CircleROI },
|
||||
{ toolName: toolNames.RectangleROI },
|
||||
{ toolName: toolNames.StackScroll },
|
||||
{ toolName: toolNames.Angle },
|
||||
{ toolName: toolNames.CobbAngle },
|
||||
{ toolName: toolNames.PlanarFreehandROI },
|
||||
{ toolName: toolNames.WindowLevelRegion },
|
||||
{
|
||||
toolName: toolNames.PlanarFreehandContourSegmentation,
|
||||
configuration: {
|
||||
displayOnePointAsCrosshairs: true,
|
||||
},
|
||||
},
|
||||
],
|
||||
disabled: [
|
||||
{
|
||||
toolName: toolNames.Crosshairs,
|
||||
configuration: {
|
||||
viewportIndicators: true,
|
||||
viewportIndicatorsConfig: {
|
||||
circleRadius: 5,
|
||||
xOffset: 0.95,
|
||||
yOffset: 0.05,
|
||||
},
|
||||
disableOnPassive: true,
|
||||
autoPan: {
|
||||
enabled: false,
|
||||
panSize: 10,
|
||||
},
|
||||
getReferenceLineColor: viewportId => {
|
||||
const viewportInfo = cornerstoneViewportService.getViewportInfo(viewportId);
|
||||
const viewportOptions = viewportInfo?.viewportOptions;
|
||||
if (viewportOptions) {
|
||||
return (
|
||||
colours[viewportOptions.id] ||
|
||||
colorsByOrientation[viewportOptions.orientation] ||
|
||||
'#0c0'
|
||||
);
|
||||
} else {
|
||||
console.warn('missing viewport?', viewportId);
|
||||
return '#0c0';
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
toolName: toolNames.AdvancedMagnify,
|
||||
},
|
||||
{ toolName: toolNames.ReferenceLines },
|
||||
],
|
||||
};
|
||||
|
||||
toolGroupService.createToolGroupAndAddTools('mpr', tools);
|
||||
}
|
||||
function initVolume3DToolGroup(extensionManager, toolGroupService) {
|
||||
const utilityModule = extensionManager.getModuleEntry(
|
||||
'@ohif/extension-cornerstone.utilityModule.tools'
|
||||
);
|
||||
|
||||
const { toolNames, Enums } = utilityModule.exports;
|
||||
|
||||
const tools = {
|
||||
active: [
|
||||
{
|
||||
toolName: toolNames.TrackballRotateTool,
|
||||
bindings: [{ mouseButton: Enums.MouseBindings.Primary }],
|
||||
},
|
||||
{
|
||||
toolName: toolNames.Zoom,
|
||||
bindings: [{ mouseButton: Enums.MouseBindings.Secondary }],
|
||||
},
|
||||
{
|
||||
toolName: toolNames.Pan,
|
||||
bindings: [{ mouseButton: Enums.MouseBindings.Auxiliary }],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
toolGroupService.createToolGroupAndAddTools('volume3d', tools);
|
||||
}
|
||||
|
||||
function initToolGroups(extensionManager, toolGroupService, commandsManager, modeLabelConfig) {
|
||||
initDefaultToolGroup(
|
||||
extensionManager,
|
||||
toolGroupService,
|
||||
commandsManager,
|
||||
'default',
|
||||
modeLabelConfig
|
||||
);
|
||||
initSRToolGroup(extensionManager, toolGroupService, commandsManager);
|
||||
initMPRToolGroup(extensionManager, toolGroupService, commandsManager, modeLabelConfig);
|
||||
initVolume3DToolGroup(extensionManager, toolGroupService);
|
||||
}
|
||||
|
||||
export default initToolGroups;
|
||||
270
modes/longitudinal/src/moreTools.ts
Normal file
270
modes/longitudinal/src/moreTools.ts
Normal file
@@ -0,0 +1,270 @@
|
||||
import type { RunCommand } from '@ohif/core/types';
|
||||
import { EVENTS } from '@cornerstonejs/core';
|
||||
import { ToolbarService, ViewportGridService } from '@ohif/core';
|
||||
import { setToolActiveToolbar } from './toolbarButtons';
|
||||
const { createButton } = ToolbarService;
|
||||
|
||||
const ReferenceLinesListeners: RunCommand = [
|
||||
{
|
||||
commandName: 'setSourceViewportForReferenceLinesTool',
|
||||
context: 'CORNERSTONE',
|
||||
},
|
||||
];
|
||||
|
||||
const moreTools = [
|
||||
{
|
||||
id: 'MoreTools',
|
||||
uiType: 'ohif.splitButton',
|
||||
props: {
|
||||
groupId: 'MoreTools',
|
||||
evaluate: 'evaluate.group.promoteToPrimaryIfCornerstoneToolNotActiveInTheList',
|
||||
primary: createButton({
|
||||
id: 'Reset',
|
||||
icon: 'tool-reset',
|
||||
tooltip: 'Reset View',
|
||||
label: 'Reset',
|
||||
commands: 'resetViewport',
|
||||
evaluate: 'evaluate.action',
|
||||
}),
|
||||
secondary: {
|
||||
icon: 'chevron-down',
|
||||
label: '',
|
||||
tooltip: 'More Tools',
|
||||
},
|
||||
items: [
|
||||
createButton({
|
||||
id: 'Reset',
|
||||
icon: 'tool-reset',
|
||||
label: 'Reset View',
|
||||
tooltip: 'Reset View',
|
||||
commands: 'resetViewport',
|
||||
evaluate: 'evaluate.action',
|
||||
}),
|
||||
createButton({
|
||||
id: 'rotate-right',
|
||||
icon: 'tool-rotate-right',
|
||||
label: 'Rotate Right',
|
||||
tooltip: 'Rotate +90',
|
||||
commands: 'rotateViewportCW',
|
||||
evaluate: [
|
||||
'evaluate.action',
|
||||
{
|
||||
name: 'evaluate.viewport.supported',
|
||||
unsupportedViewportTypes: ['video'],
|
||||
},
|
||||
],
|
||||
}),
|
||||
createButton({
|
||||
id: 'flipHorizontal',
|
||||
icon: 'tool-flip-horizontal',
|
||||
label: 'Flip Horizontal',
|
||||
tooltip: 'Flip Horizontally',
|
||||
commands: 'flipViewportHorizontal',
|
||||
evaluate: [
|
||||
'evaluate.viewportProperties.toggle',
|
||||
{
|
||||
name: 'evaluate.viewport.supported',
|
||||
unsupportedViewportTypes: ['video', 'volume3d'],
|
||||
},
|
||||
],
|
||||
}),
|
||||
createButton({
|
||||
id: 'ImageSliceSync',
|
||||
icon: 'link',
|
||||
label: 'Image Slice Sync',
|
||||
tooltip: 'Enable position synchronization on stack viewports',
|
||||
commands: {
|
||||
commandName: 'toggleSynchronizer',
|
||||
commandOptions: {
|
||||
type: 'imageSlice',
|
||||
},
|
||||
},
|
||||
listeners: {
|
||||
[EVENTS.VIEWPORT_NEW_IMAGE_SET]: {
|
||||
commandName: 'toggleImageSliceSync',
|
||||
commandOptions: { toggledState: true },
|
||||
},
|
||||
},
|
||||
evaluate: [
|
||||
'evaluate.cornerstone.synchronizer',
|
||||
{
|
||||
name: 'evaluate.viewport.supported',
|
||||
unsupportedViewportTypes: ['video', 'volume3d'],
|
||||
},
|
||||
],
|
||||
}),
|
||||
createButton({
|
||||
id: 'ReferenceLines',
|
||||
icon: 'tool-referenceLines',
|
||||
label: 'Reference Lines',
|
||||
tooltip: 'Show Reference Lines',
|
||||
commands: 'toggleEnabledDisabledToolbar',
|
||||
listeners: {
|
||||
[ViewportGridService.EVENTS.ACTIVE_VIEWPORT_ID_CHANGED]: ReferenceLinesListeners,
|
||||
[ViewportGridService.EVENTS.VIEWPORTS_READY]: ReferenceLinesListeners,
|
||||
},
|
||||
evaluate: [
|
||||
'evaluate.cornerstoneTool.toggle',
|
||||
{
|
||||
name: 'evaluate.viewport.supported',
|
||||
unsupportedViewportTypes: ['video'],
|
||||
},
|
||||
],
|
||||
}),
|
||||
createButton({
|
||||
id: 'ImageOverlayViewer',
|
||||
icon: 'toggle-dicom-overlay',
|
||||
label: 'Image Overlay',
|
||||
tooltip: 'Toggle Image Overlay',
|
||||
commands: 'toggleEnabledDisabledToolbar',
|
||||
evaluate: [
|
||||
'evaluate.cornerstoneTool.toggle',
|
||||
{
|
||||
name: 'evaluate.viewport.supported',
|
||||
unsupportedViewportTypes: ['video'],
|
||||
},
|
||||
],
|
||||
}),
|
||||
createButton({
|
||||
id: 'StackScroll',
|
||||
icon: 'tool-stack-scroll',
|
||||
label: 'Stack Scroll',
|
||||
tooltip: 'Stack Scroll',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: 'evaluate.cornerstoneTool',
|
||||
}),
|
||||
createButton({
|
||||
id: 'invert',
|
||||
icon: 'tool-invert',
|
||||
label: 'Invert',
|
||||
tooltip: 'Invert Colors',
|
||||
commands: 'invertViewport',
|
||||
evaluate: [
|
||||
'evaluate.viewportProperties.toggle',
|
||||
{
|
||||
name: 'evaluate.viewport.supported',
|
||||
unsupportedViewportTypes: ['video'],
|
||||
},
|
||||
],
|
||||
}),
|
||||
createButton({
|
||||
id: 'Probe',
|
||||
icon: 'tool-probe',
|
||||
label: 'Probe',
|
||||
tooltip: 'Probe',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: 'evaluate.cornerstoneTool',
|
||||
}),
|
||||
createButton({
|
||||
id: 'Cine',
|
||||
icon: 'tool-cine',
|
||||
label: 'Cine',
|
||||
tooltip: 'Cine',
|
||||
commands: 'toggleCine',
|
||||
evaluate: [
|
||||
'evaluate.cine',
|
||||
{
|
||||
name: 'evaluate.viewport.supported',
|
||||
unsupportedViewportTypes: ['volume3d'],
|
||||
},
|
||||
],
|
||||
}),
|
||||
createButton({
|
||||
id: 'Angle',
|
||||
icon: 'tool-angle',
|
||||
label: 'Angle',
|
||||
tooltip: 'Angle',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: 'evaluate.cornerstoneTool',
|
||||
}),
|
||||
createButton({
|
||||
id: 'CobbAngle',
|
||||
icon: 'icon-tool-cobb-angle',
|
||||
label: 'Cobb Angle',
|
||||
tooltip: 'Cobb Angle',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: 'evaluate.cornerstoneTool',
|
||||
}),
|
||||
createButton({
|
||||
id: 'Magnify',
|
||||
icon: 'tool-magnify',
|
||||
label: 'Zoom-in',
|
||||
tooltip: 'Zoom-in',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: [
|
||||
'evaluate.cornerstoneTool',
|
||||
{
|
||||
name: 'evaluate.viewport.supported',
|
||||
unsupportedViewportTypes: ['video'],
|
||||
},
|
||||
],
|
||||
}),
|
||||
createButton({
|
||||
id: 'CalibrationLine',
|
||||
icon: 'tool-calibration',
|
||||
label: 'Calibration',
|
||||
tooltip: 'Calibration Line',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: [
|
||||
'evaluate.cornerstoneTool',
|
||||
{
|
||||
name: 'evaluate.viewport.supported',
|
||||
unsupportedViewportTypes: ['video'],
|
||||
},
|
||||
],
|
||||
}),
|
||||
createButton({
|
||||
id: 'TagBrowser',
|
||||
icon: 'dicom-tag-browser',
|
||||
label: 'Dicom Tag Browser',
|
||||
tooltip: 'Dicom Tag Browser',
|
||||
commands: 'openDICOMTagViewer',
|
||||
}),
|
||||
createButton({
|
||||
id: 'AdvancedMagnify',
|
||||
icon: 'icon-tool-loupe',
|
||||
label: 'Magnify Probe',
|
||||
tooltip: 'Magnify Probe',
|
||||
commands: 'toggleActiveDisabledToolbar',
|
||||
evaluate: [
|
||||
'evaluate.cornerstoneTool.toggle.ifStrictlyDisabled',
|
||||
{
|
||||
name: 'evaluate.viewport.supported',
|
||||
unsupportedViewportTypes: ['video'],
|
||||
},
|
||||
],
|
||||
}),
|
||||
createButton({
|
||||
id: 'UltrasoundDirectionalTool',
|
||||
icon: 'icon-tool-ultrasound-bidirectional',
|
||||
label: 'Ultrasound Directional',
|
||||
tooltip: 'Ultrasound Directional',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: [
|
||||
'evaluate.cornerstoneTool',
|
||||
{
|
||||
name: 'evaluate.modality.supported',
|
||||
supportedModalities: ['US'],
|
||||
},
|
||||
],
|
||||
}),
|
||||
createButton({
|
||||
id: 'WindowLevelRegion',
|
||||
icon: 'icon-tool-window-region',
|
||||
label: 'Window Level Region',
|
||||
tooltip: 'Window Level Region',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: [
|
||||
'evaluate.cornerstoneTool',
|
||||
{
|
||||
name: 'evaluate.viewport.supported',
|
||||
unsupportedViewportTypes: ['video'],
|
||||
},
|
||||
],
|
||||
}),
|
||||
],
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export default moreTools;
|
||||
210
modes/longitudinal/src/toolbarButtons.ts
Normal file
210
modes/longitudinal/src/toolbarButtons.ts
Normal file
@@ -0,0 +1,210 @@
|
||||
// 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
|
||||
import { ToolbarService } from '@ohif/core';
|
||||
import type { Button } from '@ohif/core/types';
|
||||
|
||||
const { createButton } = ToolbarService;
|
||||
|
||||
export const setToolActiveToolbar = {
|
||||
commandName: 'setToolActiveToolbar',
|
||||
commandOptions: {
|
||||
toolGroupIds: ['default', 'mpr', 'SRToolGroup', 'volume3d'],
|
||||
},
|
||||
};
|
||||
|
||||
const toolbarButtons: Button[] = [
|
||||
{
|
||||
id: 'MeasurementTools',
|
||||
uiType: 'ohif.splitButton',
|
||||
props: {
|
||||
groupId: 'MeasurementTools',
|
||||
// group evaluate to determine which item should move to the top
|
||||
evaluate: 'evaluate.group.promoteToPrimaryIfCornerstoneToolNotActiveInTheList',
|
||||
primary: createButton({
|
||||
id: 'Length',
|
||||
icon: 'tool-length',
|
||||
label: 'Length',
|
||||
tooltip: 'Length Tool',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: 'evaluate.cornerstoneTool',
|
||||
}),
|
||||
secondary: {
|
||||
icon: 'chevron-down',
|
||||
tooltip: 'More Measure Tools',
|
||||
},
|
||||
items: [
|
||||
createButton({
|
||||
id: 'Length',
|
||||
icon: 'tool-length',
|
||||
label: 'Length',
|
||||
tooltip: 'Length Tool',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: 'evaluate.cornerstoneTool',
|
||||
}),
|
||||
createButton({
|
||||
id: 'Bidirectional',
|
||||
icon: 'tool-bidirectional',
|
||||
label: 'Bidirectional',
|
||||
tooltip: 'Bidirectional Tool',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: 'evaluate.cornerstoneTool',
|
||||
}),
|
||||
createButton({
|
||||
id: 'ArrowAnnotate',
|
||||
icon: 'tool-annotate',
|
||||
label: 'Annotation',
|
||||
tooltip: 'Arrow Annotate',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: 'evaluate.cornerstoneTool',
|
||||
}),
|
||||
createButton({
|
||||
id: 'EllipticalROI',
|
||||
icon: 'tool-ellipse',
|
||||
label: 'Ellipse',
|
||||
tooltip: 'Ellipse ROI',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: 'evaluate.cornerstoneTool',
|
||||
}),
|
||||
createButton({
|
||||
id: 'RectangleROI',
|
||||
icon: 'tool-rectangle',
|
||||
label: 'Rectangle',
|
||||
tooltip: 'Rectangle ROI',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: 'evaluate.cornerstoneTool',
|
||||
}),
|
||||
createButton({
|
||||
id: 'CircleROI',
|
||||
icon: 'tool-circle',
|
||||
label: 'Circle',
|
||||
tooltip: 'Circle Tool',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: 'evaluate.cornerstoneTool',
|
||||
}),
|
||||
createButton({
|
||||
id: 'PlanarFreehandROI',
|
||||
icon: 'icon-tool-freehand-roi',
|
||||
label: 'Freehand ROI',
|
||||
tooltip: 'Freehand ROI',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: 'evaluate.cornerstoneTool',
|
||||
}),
|
||||
createButton({
|
||||
id: 'SplineROI',
|
||||
icon: 'icon-tool-spline-roi',
|
||||
label: 'Spline ROI',
|
||||
tooltip: 'Spline ROI',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: 'evaluate.cornerstoneTool',
|
||||
}),
|
||||
createButton({
|
||||
id: 'LivewireContour',
|
||||
icon: 'icon-tool-livewire',
|
||||
label: 'Livewire tool',
|
||||
tooltip: 'Livewire tool',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: 'evaluate.cornerstoneTool',
|
||||
}),
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'Zoom',
|
||||
uiType: 'ohif.radioGroup',
|
||||
props: {
|
||||
icon: 'tool-zoom',
|
||||
label: 'Zoom',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: 'evaluate.cornerstoneTool',
|
||||
},
|
||||
},
|
||||
// Window Level
|
||||
{
|
||||
id: 'WindowLevel',
|
||||
uiType: 'ohif.radioGroup',
|
||||
props: {
|
||||
icon: 'tool-window-level',
|
||||
label: 'Window Level',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: [
|
||||
'evaluate.cornerstoneTool',
|
||||
{
|
||||
name: 'evaluate.viewport.supported',
|
||||
unsupportedViewportTypes: ['wholeSlide'],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
// Pan...
|
||||
{
|
||||
id: 'Pan',
|
||||
uiType: 'ohif.radioGroup',
|
||||
props: {
|
||||
type: 'tool',
|
||||
icon: 'tool-move',
|
||||
label: 'Pan',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: 'evaluate.cornerstoneTool',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'TrackballRotate',
|
||||
uiType: 'ohif.radioGroup',
|
||||
props: {
|
||||
type: 'tool',
|
||||
icon: 'tool-3d-rotate',
|
||||
label: '3D Rotate',
|
||||
commands: setToolActiveToolbar,
|
||||
evaluate: {
|
||||
name: 'evaluate.cornerstoneTool',
|
||||
disabledText: 'Select a 3D viewport to enable this tool',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'Capture',
|
||||
uiType: 'ohif.radioGroup',
|
||||
props: {
|
||||
icon: 'tool-capture',
|
||||
label: 'Capture',
|
||||
commands: 'showDownloadViewportModal',
|
||||
evaluate: [
|
||||
'evaluate.action',
|
||||
{
|
||||
name: 'evaluate.viewport.supported',
|
||||
unsupportedViewportTypes: ['video', 'wholeSlide'],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'Layout',
|
||||
uiType: 'ohif.layoutSelector',
|
||||
props: {
|
||||
rows: 3,
|
||||
columns: 4,
|
||||
evaluate: 'evaluate.action',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'Crosshairs',
|
||||
uiType: 'ohif.radioGroup',
|
||||
props: {
|
||||
type: 'tool',
|
||||
icon: 'tool-crosshair',
|
||||
label: 'Crosshairs',
|
||||
commands: {
|
||||
commandName: 'setToolActiveToolbar',
|
||||
commandOptions: {
|
||||
toolGroupIds: ['mpr'],
|
||||
},
|
||||
},
|
||||
evaluate: {
|
||||
name: 'evaluate.cornerstoneTool',
|
||||
disabledText: 'Select an MPR viewport to enable this tool',
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export default toolbarButtons;
|
||||
Reference in New Issue
Block a user