Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e1142910e4 | ||
|
|
067e6c769b | ||
|
|
d375d02a4b | ||
|
|
63594d36b0 | ||
|
|
6c160f517f | ||
|
|
23305cec9c | ||
|
|
36a741f0bc | ||
|
|
695ad732e1 |
No files matched your search
@@ -1,6 +1,9 @@
|
||||
# Viewer: Configuration
|
||||
|
||||
We maintain a number of common viewer application configurations at [`<root>/platform/viewer/public/configs`][config-dir]. How these values are passed to the viewer depend on how it's deployed, but the two most common paths are:
|
||||
We maintain a number of common viewer application configurations at
|
||||
[`<root>/platform/viewer/public/configs`][config-dir]. How these values are
|
||||
passed to the viewer depend on how it's deployed, but the two most common paths
|
||||
are:
|
||||
|
||||
- `index.html` looks for `https://your-website.com/app-config.js` OR
|
||||
- `index.html` passes the values to `OHIF.installViewer()`
|
||||
@@ -42,8 +45,16 @@ window.config = {
|
||||
keys: ['v'],
|
||||
},
|
||||
],
|
||||
// Config to pass to the bundled cornerstone extension
|
||||
cornerstoneExtensionConfig: {},
|
||||
/* Configuration passed to the bundled cornerstone extension
|
||||
*
|
||||
* The cornerstone extension is currently tightly coupled to the platform.
|
||||
* Until we're able to decouple it, this key will serve as a workaround to
|
||||
* pass it configuration.
|
||||
*/
|
||||
cornerstoneExtensionConfig: {
|
||||
/* Whether to show/hide annotation "handles" */
|
||||
hideHandles: true,
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
|
||||
@@ -3,6 +3,17 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [2.2.0](https://github.com/OHIF/Viewers/compare/@ohif/extension-cornerstone@2.1.1...@ohif/extension-cornerstone@2.2.0) (2019-12-20)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* 🎸 Configuration so viewer tools can nix handles ([#1304](https://github.com/OHIF/Viewers/issues/1304)) ([63594d3](https://github.com/OHIF/Viewers/commit/63594d36b0bdba59f0901095aed70b75fb05172d)), closes [#1223](https://github.com/OHIF/Viewers/issues/1223)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [2.1.1](https://github.com/OHIF/Viewers/compare/@ohif/extension-cornerstone@2.1.0...@ohif/extension-cornerstone@2.1.1) (2019-12-16)
|
||||
|
||||
|
||||
|
||||
@@ -85,6 +85,20 @@ Tools can be configured through extension configuration using the tools key:
|
||||
...
|
||||
```
|
||||
|
||||
## Annotate Tools Configuration
|
||||
|
||||
*We currently support one property for annotation tools.*
|
||||
|
||||
### Hide handles
|
||||
This extension configuration allows you to toggle on/off handle rendering for all annotate tools:
|
||||
|
||||
```js
|
||||
...
|
||||
cornerstoneExtensionConfig: {
|
||||
hideHandles: true,
|
||||
},
|
||||
...
|
||||
|
||||
## Resources
|
||||
|
||||
### Repositories
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ohif/extension-cornerstone",
|
||||
"version": "2.1.1",
|
||||
"version": "2.2.0",
|
||||
"description": "OHIF extension for Cornerstone",
|
||||
"author": "OHIF",
|
||||
"license": "MIT",
|
||||
@@ -32,7 +32,7 @@
|
||||
"@ohif/ui": "^0.50.0",
|
||||
"cornerstone-core": "^2.2.8",
|
||||
"cornerstone-math": "^0.1.8",
|
||||
"cornerstone-tools": "^4.8.0",
|
||||
"cornerstone-tools": "^4.9.0",
|
||||
"cornerstone-wado-image-loader": "^3.0.0",
|
||||
"dcmjs": "^0.8.2",
|
||||
"dicom-parser": "^1.8.3",
|
||||
|
||||
@@ -76,31 +76,35 @@ export default function init({ servicesManager, configuration }) {
|
||||
|
||||
initCornerstoneTools(defaultCsToolsConfig);
|
||||
|
||||
// ~~ Toooools 🙌
|
||||
const tools = [
|
||||
csTools.PanTool,
|
||||
csTools.ZoomTool,
|
||||
csTools.WwwcTool,
|
||||
csTools.WwwcRegionTool,
|
||||
csTools.MagnifyTool,
|
||||
csTools.StackScrollTool,
|
||||
csTools.StackScrollMouseWheelTool,
|
||||
// Touch
|
||||
csTools.PanMultiTouchTool,
|
||||
csTools.ZoomTouchPinchTool,
|
||||
// Annotations
|
||||
csTools.ArrowAnnotateTool,
|
||||
csTools.EraserTool,
|
||||
csTools.BidirectionalTool,
|
||||
csTools.LengthTool,
|
||||
csTools.AngleTool,
|
||||
csTools.FreehandRoiTool,
|
||||
csTools.EllipticalRoiTool,
|
||||
csTools.DragProbeTool,
|
||||
csTools.RectangleRoiTool,
|
||||
// Segmentation
|
||||
csTools.BrushTool,
|
||||
];
|
||||
const toolsGroupedByType = {
|
||||
touch: [csTools.PanMultiTouchTool, csTools.ZoomTouchPinchTool],
|
||||
annotations: [
|
||||
csTools.ArrowAnnotateTool,
|
||||
csTools.EraserTool,
|
||||
csTools.BidirectionalTool,
|
||||
csTools.LengthTool,
|
||||
csTools.AngleTool,
|
||||
csTools.FreehandRoiTool,
|
||||
csTools.EllipticalRoiTool,
|
||||
csTools.DragProbeTool,
|
||||
csTools.RectangleRoiTool,
|
||||
],
|
||||
segmentation: [csTools.BrushTool],
|
||||
other: [
|
||||
csTools.PanTool,
|
||||
csTools.ZoomTool,
|
||||
csTools.WwwcTool,
|
||||
csTools.WwwcRegionTool,
|
||||
csTools.MagnifyTool,
|
||||
csTools.StackScrollTool,
|
||||
csTools.StackScrollMouseWheelTool,
|
||||
],
|
||||
};
|
||||
|
||||
let tools = [];
|
||||
Object.keys(toolsGroupedByType).forEach(toolsGroup =>
|
||||
tools.push(...toolsGroupedByType[toolsGroup])
|
||||
);
|
||||
|
||||
/* Add extension tools configuration here. */
|
||||
const internalToolsConfig = {
|
||||
@@ -114,13 +118,48 @@ export default function init({ servicesManager, configuration }) {
|
||||
},
|
||||
};
|
||||
|
||||
/* Abstract tools configuration using extension configuration. */
|
||||
const parseToolProps = (props, tool) => {
|
||||
const { annotations } = toolsGroupedByType;
|
||||
// An alternative approach would be to remove the `drawHandlesOnHover` config
|
||||
// from the supported configuration properties in `cornerstone-tools`
|
||||
const toolsWithHideableHandles = annotations.filter(
|
||||
tool => !['RectangleRoiTool', 'EllipticalRoiTool'].includes(tool.name)
|
||||
);
|
||||
|
||||
let parsedProps = { ...props };
|
||||
|
||||
/**
|
||||
* drawHandles - Never/Always show handles
|
||||
* drawHandlesOnHover - Only show handles on handle hover (pointNearHandle)
|
||||
*
|
||||
* Does not apply to tools where handles aren't placed in predictable
|
||||
* locations.
|
||||
*/
|
||||
if (
|
||||
configuration.hideHandles !== false &&
|
||||
toolsWithHideableHandles.includes(tool)
|
||||
) {
|
||||
if (props.configuration) {
|
||||
parsedProps.configuration.drawHandlesOnHover = true;
|
||||
} else {
|
||||
parsedProps.configuration = { drawHandlesOnHover: true };
|
||||
}
|
||||
}
|
||||
|
||||
return parsedProps;
|
||||
};
|
||||
|
||||
/* Add tools with its custom props through extension configuration. */
|
||||
tools.forEach(tool => {
|
||||
const toolName = tool.name.replace('Tool', '');
|
||||
const externalToolsConfig = configuration.tools || {};
|
||||
const externalToolProps = externalToolsConfig[toolName] || {};
|
||||
const internalToolProps = internalToolsConfig[toolName] || {};
|
||||
const props = merge(internalToolProps, externalToolProps);
|
||||
const props = merge(
|
||||
internalToolProps,
|
||||
parseToolProps(externalToolProps, tool)
|
||||
);
|
||||
csTools.addTool(tool, props);
|
||||
});
|
||||
|
||||
|
||||
@@ -3,6 +3,41 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.2.1](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@1.2.0...@ohif/extension-vtk@1.2.1) (2019-12-20)
|
||||
|
||||
**Note:** Version bump only for package @ohif/extension-vtk
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [1.2.0](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@1.1.7...@ohif/extension-vtk@1.2.0) (2019-12-20)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* 🎸 Configuration so viewer tools can nix handles ([#1304](https://github.com/OHIF/Viewers/issues/1304)) ([63594d3](https://github.com/OHIF/Viewers/commit/63594d36b0bdba59f0901095aed70b75fb05172d)), closes [#1223](https://github.com/OHIF/Viewers/issues/1223)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [1.1.7](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@1.1.6...@ohif/extension-vtk@1.1.7) (2019-12-19)
|
||||
|
||||
**Note:** Version bump only for package @ohif/extension-vtk
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [1.1.6](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@1.1.5...@ohif/extension-vtk@1.1.6) (2019-12-18)
|
||||
|
||||
**Note:** Version bump only for package @ohif/extension-vtk
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [1.1.5](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@1.1.4...@ohif/extension-vtk@1.1.5) (2019-12-16)
|
||||
|
||||
**Note:** Version bump only for package @ohif/extension-vtk
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ohif/extension-vtk",
|
||||
"version": "1.1.5",
|
||||
"version": "1.2.1",
|
||||
"description": "OHIF extension for VTK.js",
|
||||
"author": "OHIF",
|
||||
"license": "MIT",
|
||||
@@ -52,9 +52,9 @@
|
||||
"react-vtkjs-viewport": "^0.3.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ohif/core": "^2.2.0",
|
||||
"@ohif/ui": "^1.1.4",
|
||||
"cornerstone-tools": "^4.8.0",
|
||||
"@ohif/core": "^2.3.0",
|
||||
"@ohif/ui": "^1.1.6",
|
||||
"cornerstone-tools": "^4.9.0",
|
||||
"cornerstone-wado-image-loader": "^3.0.0",
|
||||
"dicom-parser": "^1.8.3",
|
||||
"gh-pages": "^2.0.1",
|
||||
|
||||
@@ -3,6 +3,25 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
# [2.3.0](https://github.com/OHIF/Viewers/compare/@ohif/core@2.2.1...@ohif/core@2.3.0) (2019-12-20)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* 🎸 Configuration so viewer tools can nix handles ([#1304](https://github.com/OHIF/Viewers/issues/1304)) ([63594d3](https://github.com/OHIF/Viewers/commit/63594d36b0bdba59f0901095aed70b75fb05172d)), closes [#1223](https://github.com/OHIF/Viewers/issues/1223)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [2.2.1](https://github.com/OHIF/Viewers/compare/@ohif/core@2.2.0...@ohif/core@2.2.1) (2019-12-18)
|
||||
|
||||
**Note:** Version bump only for package @ohif/core
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [2.2.0](https://github.com/OHIF/Viewers/compare/@ohif/core@2.1.1...@ohif/core@2.2.0) (2019-12-16)
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ohif/core",
|
||||
"version": "2.2.0",
|
||||
"version": "2.3.0",
|
||||
"description": "Generic business logic for web-based medical imaging applications",
|
||||
"author": "OHIF Core Team",
|
||||
"license": "MIT",
|
||||
@@ -32,13 +32,14 @@
|
||||
},
|
||||
"peerDependencies": {
|
||||
"cornerstone-core": "^2.2.8",
|
||||
"cornerstone-tools": "^4.8.0",
|
||||
"cornerstone-tools": "^4.9.0",
|
||||
"cornerstone-wado-image-loader": "^3.0.0",
|
||||
"dicom-parser": "^1.8.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.5.5",
|
||||
"ajv": "^6.10.0",
|
||||
"dcmjs": "^0.8.3",
|
||||
"dicomweb-client": "^0.5.2",
|
||||
"isomorphic-base64": "^1.0.2",
|
||||
"lodash.clonedeep": "^4.5.0",
|
||||
|
||||
+10
-3
@@ -1,5 +1,10 @@
|
||||
import { log, studies, utils } from '@ohif/core';
|
||||
import { retrieveMeasurementFromSR, stowSRFromMeasurements } from './handleStructuredReport';
|
||||
import log from '../log';
|
||||
import studies from '../studies';
|
||||
import utils from '../utils';
|
||||
import {
|
||||
retrieveMeasurementFromSR,
|
||||
stowSRFromMeasurements,
|
||||
} from './handleStructuredReport';
|
||||
import findMostRecentStructuredReport from './utils/findMostRecentStructuredReport';
|
||||
|
||||
/**
|
||||
@@ -65,7 +70,9 @@ const storeMeasurements = async (measurementData, filter, server) => {
|
||||
message: 'Measurements were saved with success',
|
||||
};
|
||||
} catch (error) {
|
||||
log.error(`[DICOMSR] Error while saving the measurements: ${error.message}`);
|
||||
log.error(
|
||||
`[DICOMSR] Error while saving the measurements: ${error.message}`
|
||||
);
|
||||
throw new Error('Error while saving the measurements.');
|
||||
}
|
||||
};
|
||||
+9
-9
@@ -1,11 +1,11 @@
|
||||
import * as dcmjs from 'dcmjs';
|
||||
import { DICOMWeb } from '@ohif/core';
|
||||
import { api } from 'dicomweb-client';
|
||||
|
||||
import DICOMWeb from '../DICOMWeb';
|
||||
import parseDicomStructuredReport from './parseDicomStructuredReport';
|
||||
import parseMeasurementsData from './parseMeasurementsData';
|
||||
import getAllDisplaySets from './utils/getAllDisplaySets';
|
||||
|
||||
import { api } from 'dicomweb-client';
|
||||
|
||||
const VERSION_NAME = 'dcmjs-0.0';
|
||||
const TRANSFER_SYNTAX_UID = '1.2.840.10008.1.2.1';
|
||||
|
||||
@@ -34,7 +34,10 @@ const retrieveMeasurementFromSR = async (series, studies, serverUrl) => {
|
||||
|
||||
const part10SRArrayBuffer = await dicomWeb.retrieveInstance(options);
|
||||
const displaySets = getAllDisplaySets(studies);
|
||||
const measurementsData = parseDicomStructuredReport(part10SRArrayBuffer, displaySets);
|
||||
const measurementsData = parseDicomStructuredReport(
|
||||
part10SRArrayBuffer,
|
||||
displaySets
|
||||
);
|
||||
|
||||
return measurementsData;
|
||||
};
|
||||
@@ -47,13 +50,10 @@ const retrieveMeasurementFromSR = async (series, studies, serverUrl) => {
|
||||
* @returns {Promise}
|
||||
*/
|
||||
const stowSRFromMeasurements = async (measurements, serverUrl) => {
|
||||
const { dataset } = parseMeasurementsData(
|
||||
measurements
|
||||
);
|
||||
const { dataset } = parseMeasurementsData(measurements);
|
||||
const { DicomMetaDictionary, DicomDict } = dcmjs.data;
|
||||
const meta = {
|
||||
FileMetaInformationVersion:
|
||||
dataset._meta.FileMetaInformationVersion.Value,
|
||||
FileMetaInformationVersion: dataset._meta.FileMetaInformationVersion.Value,
|
||||
MediaStorageSOPClassUID: dataset.SOPClassUID,
|
||||
MediaStorageSOPInstanceUID: dataset.SOPInstanceUID,
|
||||
TransferSyntaxUID: TRANSFER_SYNTAX_UID,
|
||||
File renamed without changes.
+17
-4
@@ -1,4 +1,5 @@
|
||||
import * as dcmjs from 'dcmjs';
|
||||
|
||||
import findInstanceMetadataBySopInstanceUid from './utils/findInstanceMetadataBySopInstanceUid';
|
||||
|
||||
/**
|
||||
@@ -37,7 +38,12 @@ const parseDicomStructuredReport = (part10SRArrayBuffer, displaySets) => {
|
||||
const { studyInstanceUid, patientId } = study;
|
||||
const { seriesInstanceUid } = series;
|
||||
const { sopInstanceUid, frameIndex } = measurement;
|
||||
const imagePath = getImagePath(studyInstanceUid, seriesInstanceUid, sopInstanceUid, frameIndex);
|
||||
const imagePath = getImagePath(
|
||||
studyInstanceUid,
|
||||
seriesInstanceUid,
|
||||
sopInstanceUid,
|
||||
frameIndex
|
||||
);
|
||||
|
||||
const imageId = instanceMetadata.getImageId();
|
||||
if (!imageId) {
|
||||
@@ -75,8 +81,15 @@ const parseDicomStructuredReport = (part10SRArrayBuffer, displaySets) => {
|
||||
* @param {string} frameIndex
|
||||
* @returns
|
||||
*/
|
||||
const getImagePath = (studyInstanceUid, seriesInstanceUid, sopInstanceUid, frameIndex) => {
|
||||
return [studyInstanceUid, seriesInstanceUid, sopInstanceUid, frameIndex].join('_');
|
||||
}
|
||||
const getImagePath = (
|
||||
studyInstanceUid,
|
||||
seriesInstanceUid,
|
||||
sopInstanceUid,
|
||||
frameIndex
|
||||
) => {
|
||||
return [studyInstanceUid, seriesInstanceUid, sopInstanceUid, frameIndex].join(
|
||||
'_'
|
||||
);
|
||||
};
|
||||
|
||||
export default parseDicomStructuredReport;
|
||||
+3
-1
@@ -1,6 +1,8 @@
|
||||
import * as dcmjs from 'dcmjs';
|
||||
import { log, measurements } from '@ohif/core';
|
||||
import cornerstone from 'cornerstone-core';
|
||||
|
||||
import log from '../log';
|
||||
import measurements from '../measurements';
|
||||
import isToolSupported from './utils/isToolSupported';
|
||||
|
||||
/**
|
||||
+3
-1
@@ -11,7 +11,9 @@ const findInstanceMetadataBySopInstanceUid = (displaySets, sopInstanceUid) => {
|
||||
displaySets.find(displaySet => {
|
||||
if (!displaySet.images) return false;
|
||||
|
||||
instanceFound = displaySet.images.find(instanceMetadata => instanceMetadata._sopInstanceUID === sopInstanceUid);
|
||||
instanceFound = displaySet.images.find(
|
||||
instanceMetadata => instanceMetadata._sopInstanceUID === sopInstanceUid
|
||||
);
|
||||
|
||||
return !!instanceFound;
|
||||
});
|
||||
+12
-9
@@ -4,15 +4,17 @@
|
||||
* @param {Array} studies
|
||||
* @returns {Object} Series
|
||||
*/
|
||||
const findMostRecentStructuredReport = (studies) => {
|
||||
const findMostRecentStructuredReport = studies => {
|
||||
let mostRecentStructuredReport;
|
||||
|
||||
studies.forEach(study => {
|
||||
const allSeries = study.getSeries ? study.getSeries() : [];
|
||||
allSeries.forEach(series => {
|
||||
|
||||
if (isStructuredReportSeries(series)) {
|
||||
if (!mostRecentStructuredReport || compareSeriesDate(series, mostRecentStructuredReport)) {
|
||||
if (
|
||||
!mostRecentStructuredReport ||
|
||||
compareSeriesDate(series, mostRecentStructuredReport)
|
||||
) {
|
||||
mostRecentStructuredReport = series;
|
||||
}
|
||||
}
|
||||
@@ -28,7 +30,7 @@ const findMostRecentStructuredReport = (studies) => {
|
||||
* @param {Object} series - Series metadata
|
||||
* @returns {boolean}
|
||||
*/
|
||||
const isStructuredReportSeries = (series) => {
|
||||
const isStructuredReportSeries = series => {
|
||||
const supportedSopClassUIDs = [
|
||||
'1.2.840.10008.5.1.4.1.1.88.22',
|
||||
'1.2.840.10008.5.1.4.1.1.11.1',
|
||||
@@ -38,7 +40,7 @@ const isStructuredReportSeries = (series) => {
|
||||
const sopClassUid = firstInstance._instance.sopClassUid;
|
||||
|
||||
return supportedSopClassUIDs.includes(sopClassUid);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Checkes if series1 is newer than series2
|
||||
@@ -48,10 +50,11 @@ const isStructuredReportSeries = (series) => {
|
||||
* @returns {boolean} true/false if series1 is newer than series2
|
||||
*/
|
||||
const compareSeriesDate = (series1, series2) => {
|
||||
return series1._data.seriesDate > series2._data.seriesDate ||
|
||||
return (
|
||||
series1._data.seriesDate > series2._data.seriesDate ||
|
||||
(series1._data.seriesDate === series2._data.seriesDate &&
|
||||
series1._data.seriesTime > series2._data.seriesTime);
|
||||
}
|
||||
|
||||
series1._data.seriesTime > series2._data.seriesTime)
|
||||
);
|
||||
};
|
||||
|
||||
export default findMostRecentStructuredReport;
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
* @param {Object} studies - List of studies loaded into the viewer
|
||||
* @returns {Object} List of DisplaySets
|
||||
*/
|
||||
const getAllDisplaySets = (studies) => {
|
||||
const getAllDisplaySets = studies => {
|
||||
let allDisplaySets = [];
|
||||
|
||||
studies.forEach(study => {
|
||||
File renamed without changes.
@@ -5,6 +5,7 @@ import { ServicesManager } from './services';
|
||||
import classes, { CommandsManager, HotkeysManager } from './classes/';
|
||||
|
||||
import DICOMWeb from './DICOMWeb';
|
||||
import DICOMSR from './DICOMSR';
|
||||
import cornerstone from './cornerstone.js';
|
||||
import hangingProtocols from './hanging-protocols';
|
||||
import header from './header.js';
|
||||
@@ -46,6 +47,7 @@ const OHIF = {
|
||||
object,
|
||||
log,
|
||||
DICOMWeb,
|
||||
DICOMSR,
|
||||
viewer: {},
|
||||
measurements,
|
||||
hangingProtocols,
|
||||
@@ -76,6 +78,7 @@ export {
|
||||
object,
|
||||
log,
|
||||
DICOMWeb,
|
||||
DICOMSR,
|
||||
measurements,
|
||||
hangingProtocols,
|
||||
//
|
||||
|
||||
@@ -28,6 +28,7 @@ describe('Top level exports', () => {
|
||||
'object',
|
||||
'log',
|
||||
'DICOMWeb',
|
||||
'DICOMSR',
|
||||
'OHIF', //
|
||||
'measurements',
|
||||
'hangingProtocols',
|
||||
|
||||
@@ -3,6 +3,25 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.1.6](https://github.com/OHIF/Viewers/compare/@ohif/ui@1.1.5...@ohif/ui@1.1.6) (2019-12-20)
|
||||
|
||||
**Note:** Version bump only for package @ohif/ui
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [1.1.5](https://github.com/OHIF/Viewers/compare/@ohif/ui@1.1.4...@ohif/ui@1.1.5) (2019-12-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 🐛 Fix drag-n-drop of local files into OHIF ([#1319](https://github.com/OHIF/Viewers/issues/1319)) ([23305ce](https://github.com/OHIF/Viewers/commit/23305cec9c0f514e73a8dd17f984ffc87ad8d131)), closes [#1307](https://github.com/OHIF/Viewers/issues/1307)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [1.1.4](https://github.com/OHIF/Viewers/compare/@ohif/ui@1.1.3...@ohif/ui@1.1.4) (2019-12-16)
|
||||
|
||||
**Note:** Version bump only for package @ohif/ui
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ohif/ui",
|
||||
"version": "1.1.4",
|
||||
"version": "1.1.6",
|
||||
"description": "A set of React components for Medical Imaging Viewers",
|
||||
"author": "OHIF Contributors",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -79,7 +79,11 @@ class MeasurementTable extends Component {
|
||||
</ScrollableArea>
|
||||
<div className="measurementTableFooter">
|
||||
{saveFunction && (
|
||||
<button onClick={this.saveFunction} className="saveBtn">
|
||||
<button
|
||||
onClick={this.saveFunction}
|
||||
className="saveBtn"
|
||||
data-cy="save-measurements-btn"
|
||||
>
|
||||
<Icon name="save" width="14px" height="14px" />
|
||||
Save measurements
|
||||
</button>
|
||||
|
||||
@@ -152,6 +152,7 @@ const DialogProvider = ({ children, service }) => {
|
||||
onStart,
|
||||
onStop,
|
||||
onDrag,
|
||||
showOverlay,
|
||||
} = dialog;
|
||||
|
||||
let position =
|
||||
@@ -160,7 +161,7 @@ const DialogProvider = ({ children, service }) => {
|
||||
position = centerPositions.find(position => position.id === id);
|
||||
}
|
||||
|
||||
return (
|
||||
const dragableItem = () => (
|
||||
<Draggable
|
||||
key={id}
|
||||
disabled={!isDraggable}
|
||||
@@ -217,6 +218,16 @@ const DialogProvider = ({ children, service }) => {
|
||||
</div>
|
||||
</Draggable>
|
||||
);
|
||||
|
||||
return (
|
||||
showOverlay ? (
|
||||
<div className="Overlay" key={id}>
|
||||
{dragableItem()}
|
||||
</div>
|
||||
) : (
|
||||
dragableItem()
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -238,13 +249,11 @@ const DialogProvider = ({ children, service }) => {
|
||||
|
||||
return (
|
||||
<DialogContext.Provider value={{ create, dismiss, dismissAll, isEmpty }}>
|
||||
<div className="DraggableArea">
|
||||
{dialogs.some(dialog => dialog.showOverlay) ? (
|
||||
<div className="Overlay active">{renderDialogs()}</div>
|
||||
) : (
|
||||
renderDialogs()
|
||||
)}
|
||||
</div>
|
||||
{!isEmpty() &&
|
||||
<div className="DraggableArea">
|
||||
{renderDialogs()}
|
||||
</div>
|
||||
}
|
||||
{children}
|
||||
</DialogContext.Provider>
|
||||
);
|
||||
|
||||
@@ -6,17 +6,16 @@
|
||||
div
|
||||
cursor: grabbing !important
|
||||
|
||||
.DraggableArea, .Overlay
|
||||
.DraggableArea
|
||||
width: 100%
|
||||
height: 100%
|
||||
position: absolute
|
||||
|
||||
.Overlay.active
|
||||
position: fixed
|
||||
z-index: 999
|
||||
left: 0
|
||||
top: 0
|
||||
width: 100%
|
||||
height: 100%
|
||||
overflow: auto
|
||||
background: rgba(0,0,0,.1)
|
||||
.Overlay
|
||||
position: fixed
|
||||
z-index: 999
|
||||
left: 0
|
||||
top: 0
|
||||
width: 100%
|
||||
height: 100%
|
||||
overflow: auto
|
||||
background: rgba(0,0,0,.1)
|
||||
@@ -3,6 +3,44 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [3.3.1](https://github.com/OHIF/Viewers/compare/@ohif/viewer@3.3.0...@ohif/viewer@3.3.1) (2019-12-20)
|
||||
|
||||
**Note:** Version bump only for package @ohif/viewer
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.3.0](https://github.com/OHIF/Viewers/compare/@ohif/viewer@3.2.2...@ohif/viewer@3.3.0) (2019-12-20)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* 🎸 Configuration so viewer tools can nix handles ([#1304](https://github.com/OHIF/Viewers/issues/1304)) ([63594d3](https://github.com/OHIF/Viewers/commit/63594d36b0bdba59f0901095aed70b75fb05172d)), closes [#1223](https://github.com/OHIF/Viewers/issues/1223)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.2.2](https://github.com/OHIF/Viewers/compare/@ohif/viewer@3.2.1...@ohif/viewer@3.2.2) (2019-12-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 🐛 Fix drag-n-drop of local files into OHIF ([#1319](https://github.com/OHIF/Viewers/issues/1319)) ([23305ce](https://github.com/OHIF/Viewers/commit/23305cec9c0f514e73a8dd17f984ffc87ad8d131)), closes [#1307](https://github.com/OHIF/Viewers/issues/1307)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [3.2.1](https://github.com/OHIF/Viewers/compare/@ohif/viewer@3.2.0...@ohif/viewer@3.2.1) (2019-12-18)
|
||||
|
||||
**Note:** Version bump only for package @ohif/viewer
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# [3.2.0](https://github.com/OHIF/Viewers/compare/@ohif/viewer@3.1.12...@ohif/viewer@3.2.0) (2019-12-16)
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,149 @@
|
||||
describe('OHIF Save Measurements', function() {
|
||||
before(() => {
|
||||
cy.openStudy('Fall 1');
|
||||
cy.expectMinimumThumbnails(2);
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
// Drags Study thumbnail into viewport
|
||||
cy.get('[data-cy="thumbnail-list"]:nth-child(1)')
|
||||
.scrollIntoView()
|
||||
.drag('.viewport-drop-target');
|
||||
|
||||
// Wait image to load on viewport
|
||||
cy.wait(2000);
|
||||
|
||||
cy.resetViewport();
|
||||
cy.initCommonElementsAliases();
|
||||
});
|
||||
|
||||
it('saves new measurement annotation', function() {
|
||||
// Add measurement in the viewport
|
||||
cy.addLengthMeasurement();
|
||||
|
||||
// Verify if measurement annotation was added into the measurements panel
|
||||
cy.get('@measurementsBtn').click();
|
||||
cy.get('.measurementItem')
|
||||
.its('length')
|
||||
.should('be.at.least', 1);
|
||||
|
||||
// Save new measurement
|
||||
cy.get('[data-cy="save-measurements-btn"]').click();
|
||||
|
||||
// Verify that success message overlay is displayed
|
||||
cy.get('.sb-success')
|
||||
.should('be.visible')
|
||||
.and('contains.text', 'Measurements were saved with success');
|
||||
|
||||
// Visual test comparison
|
||||
cy.screenshot('Save Measurements - new measurement added');
|
||||
cy.percyCanvasSnapshot('Save Measurements - new measurement added');
|
||||
});
|
||||
|
||||
it('retrieves saved measurements', function() {
|
||||
// Add measurement in the viewport
|
||||
cy.addLengthMeasurement();
|
||||
|
||||
// Verify if measurement annotation was added into the measurements panel
|
||||
cy.get('@measurementsBtn').click();
|
||||
cy.get('.measurementDisplayText') // Get label size of the recently added measurement
|
||||
.last()
|
||||
.then($measurementSizeLabel => {
|
||||
// Save new measurement
|
||||
cy.get('[data-cy="save-measurements-btn"]').click();
|
||||
|
||||
// Verify that success message overlay is displayed
|
||||
cy.get('.sb-success').should('be.visible');
|
||||
|
||||
// Reload the page
|
||||
cy.reload();
|
||||
|
||||
//Verify that recently added measurement was retrieved
|
||||
cy.get('@measurementsBtn').click();
|
||||
cy.get('.measurementDisplayText') // Get label size of the recently added measurement
|
||||
.last()
|
||||
.then($retrivedMeasurementSizeLabel => {
|
||||
expect($retrivedMeasurementSizeLabel.textContent).to.eq(
|
||||
$measurementSizeLabel.textContent
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('checks error message when saving without any measurement', function() {
|
||||
// Checks that measurement list is empty
|
||||
cy.get('.numberOfItems').should('have.text', '0');
|
||||
|
||||
// Click on Save Measurement button
|
||||
cy.get('[data-cy="save-measurements-btn"]').click();
|
||||
|
||||
// Verify that error message overlay is displayed
|
||||
cy.get('.sb-error')
|
||||
.should('be.visible')
|
||||
.and('contains.text', 'Error while saving the measurements');
|
||||
// Close message overlay
|
||||
cy.get('.sb-closeIcon').click();
|
||||
});
|
||||
|
||||
it('checks if warning message is displayed on measurements of unsupported tools', function() {
|
||||
// Add measurement for unsupported tool in the viewport
|
||||
cy.addAngleMeasurement();
|
||||
|
||||
// Verify if measurement annotation was added into the measurements panel
|
||||
cy.get('@measurementsBtn').click();
|
||||
cy.get('.measurementItem')
|
||||
.its('length')
|
||||
.should('be.at.least', 1);
|
||||
|
||||
// Check that warning is displayed for unsupported tool
|
||||
cy.get('.hasWarnings').should('be.visible');
|
||||
|
||||
// Save new measurement
|
||||
cy.get('[data-cy="save-measurements-btn"]').click();
|
||||
|
||||
// Verify that error message overlay is displayed
|
||||
cy.get('.sb-error')
|
||||
.should('be.visible')
|
||||
.and('contains.text', 'Error while saving the measurements');
|
||||
// Close message overlay
|
||||
cy.get('.sb-closeIcon').click();
|
||||
// Close Measurements panel
|
||||
cy.get('@measurementsBtn').click();
|
||||
});
|
||||
|
||||
it('checks if measurements of unsupported tools were not saved', function() {
|
||||
// Add measurement for supported tool in the viewport
|
||||
cy.addLengthMeasurement();
|
||||
// Add measurement for unsupported tool in the viewport
|
||||
cy.addAngleMeasurement();
|
||||
|
||||
// Verify if measurement annotation was added into the measurements panel
|
||||
cy.get('@measurementsBtn').click();
|
||||
cy.get('.measurementItem')
|
||||
.its('length')
|
||||
.should('be.eq', 2);
|
||||
|
||||
// Check that warning is displayed for unsupported tool
|
||||
cy.get('.hasWarnings').should('be.visible');
|
||||
|
||||
// Save new measurement
|
||||
cy.get('[data-cy="save-measurements-btn"]').click();
|
||||
|
||||
// Verify that success message overlay is displayed
|
||||
cy.get('.sb-success')
|
||||
.should('be.visible')
|
||||
.and('contains.text', 'Measurements were saved with success');
|
||||
|
||||
// Reload the page
|
||||
cy.reload();
|
||||
|
||||
//Verify that measurement for unsupported tool was not saved
|
||||
cy.get('@measurementsBtn').click();
|
||||
cy.get('.measurementItem')
|
||||
.its('length')
|
||||
.should('be.eq', 1);
|
||||
|
||||
// Close Measurements panel
|
||||
cy.get('@measurementsBtn').click();
|
||||
});
|
||||
});
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@ohif/viewer",
|
||||
"version": "3.2.0",
|
||||
"version": "3.3.1",
|
||||
"description": "OHIF Viewer",
|
||||
"author": "OHIF Contributors",
|
||||
"license": "MIT",
|
||||
@@ -45,20 +45,20 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.5.5",
|
||||
"@ohif/core": "^2.2.0",
|
||||
"@ohif/extension-cornerstone": "^2.1.1",
|
||||
"@ohif/core": "^2.3.0",
|
||||
"@ohif/extension-cornerstone": "^2.2.0",
|
||||
"@ohif/extension-dicom-html": "^1.1.0",
|
||||
"@ohif/extension-dicom-microscopy": "^0.50.6",
|
||||
"@ohif/extension-dicom-pdf": "^1.0.1",
|
||||
"@ohif/extension-vtk": "^1.1.5",
|
||||
"@ohif/extension-vtk": "^1.2.1",
|
||||
"@ohif/i18n": "^0.52.4",
|
||||
"@ohif/ui": "^1.1.4",
|
||||
"@ohif/ui": "^1.1.6",
|
||||
"@tanem/react-nprogress": "^1.1.25",
|
||||
"classnames": "^2.2.6",
|
||||
"core-js": "^3.2.1",
|
||||
"cornerstone-core": "^2.2.8",
|
||||
"cornerstone-math": "^0.1.8",
|
||||
"cornerstone-tools": "^4.8.0",
|
||||
"cornerstone-tools": "^4.9.0",
|
||||
"cornerstone-wado-image-loader": "^3.0.0",
|
||||
"dcmjs": "^0.8.2",
|
||||
"dicom-parser": "^1.8.3",
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { MeasurementTable } from '@ohif/ui';
|
||||
import OHIF from '@ohif/core';
|
||||
import OHIF, { DICOMSR } from '@ohif/core';
|
||||
import moment from 'moment';
|
||||
import cornerstone from 'cornerstone-core';
|
||||
import DICOMSR from './../../lib/DICOMSR';
|
||||
|
||||
import jumpToRowItem from './jumpToRowItem.js';
|
||||
|
||||
@@ -32,9 +31,7 @@ function groupBy(list, props) {
|
||||
*/
|
||||
function getAllTools(toolGroups = []) {
|
||||
let tools = [];
|
||||
toolGroups.forEach(
|
||||
toolGroup => (tools = tools.concat(toolGroup.childTools))
|
||||
);
|
||||
toolGroups.forEach(toolGroup => (tools = tools.concat(toolGroup.childTools)));
|
||||
|
||||
return tools;
|
||||
}
|
||||
|
||||
@@ -80,6 +80,7 @@ export default function init({
|
||||
id: 'labelling',
|
||||
isDraggable: false,
|
||||
showOverlay: true,
|
||||
centralize: true,
|
||||
content: LabellingFlow,
|
||||
contentProps: {
|
||||
measurementData,
|
||||
|
||||
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
|
||||
import { MODULE_TYPES } from '@ohif/core';
|
||||
import OHIF from '@ohif/core';
|
||||
import OHIF, { DICOMSR } from '@ohif/core';
|
||||
import { withDialog } from '@ohif/ui';
|
||||
import moment from 'moment';
|
||||
import ConnectedHeader from './ConnectedHeader.js';
|
||||
@@ -12,7 +12,6 @@ import ConnectedStudyBrowser from './ConnectedStudyBrowser.js';
|
||||
import ConnectedViewerMain from './ConnectedViewerMain.js';
|
||||
import SidePanel from './../components/SidePanel.js';
|
||||
import { extensionManager } from './../App.js';
|
||||
import DICOMSR from '../lib/DICOMSR';
|
||||
|
||||
// Contexts
|
||||
import WhiteLabellingContext from '../context/WhiteLabellingContext.js';
|
||||
|
||||
@@ -5962,10 +5962,10 @@ cornerstone-math@^0.1.8:
|
||||
resolved "https://registry.yarnpkg.com/cornerstone-math/-/cornerstone-math-0.1.8.tgz#68ab1f9e4fdcd7c5cb23a0d2eb4263f9f894f1c5"
|
||||
integrity sha512-x7NEQHBtVG7j1yeyj/aRoKTpXv1Vh2/H9zNLMyqYJDtJkNng8C4Q8M3CgZ1qer0Yr7eVq2x+Ynmj6kfOm5jXKw==
|
||||
|
||||
cornerstone-tools@^4.8.0:
|
||||
version "4.8.0"
|
||||
resolved "https://registry.yarnpkg.com/cornerstone-tools/-/cornerstone-tools-4.8.0.tgz#1972546e13e9a09b8aa25a3541ffc345283eec01"
|
||||
integrity sha512-PO7/jYbVwc+ddF9JW/o/JXqNPFZV7y1PUTzlRATC9FeXLXNKIkSFBCF5SA1EGJoyjzRYGDBgTZuTYhfm96AlAA==
|
||||
cornerstone-tools@^4.9.0:
|
||||
version "4.9.0"
|
||||
resolved "https://registry.yarnpkg.com/cornerstone-tools/-/cornerstone-tools-4.9.0.tgz#8b68603c32aceb84baf860f4dd0d36ac176e8b75"
|
||||
integrity sha512-6yHzXm4qn7VuHMRiaV/oS3khdMidtTho6P1OIYICqZ2pmorsH8jN8LvNgqz+Ky9Nf+wvrvi7ul8ZzcD1sJTkWA==
|
||||
dependencies:
|
||||
"@babel/runtime" "7.1.2"
|
||||
cornerstone-math "0.1.7"
|
||||
@@ -6545,6 +6545,16 @@ dcmjs@^0.8.2:
|
||||
loglevelnext "^3.0.1"
|
||||
ndarray "^1.0.18"
|
||||
|
||||
dcmjs@^0.8.3:
|
||||
version "0.8.3"
|
||||
resolved "https://registry.yarnpkg.com/dcmjs/-/dcmjs-0.8.3.tgz#fff1b030b6cb2d6e2afb1aa99840bfa853724c31"
|
||||
integrity sha512-eXQjqgtJf9+oseraKDNDm2A5F3Th4B2GJeZtjStj0IFXxjlbPOzdq3PfCyxdwfRaKOBIwr0q3YK/Vfs2CpQY8Q==
|
||||
dependencies:
|
||||
"@babel/polyfill" "^7.6.0"
|
||||
"@babel/runtime" "^7.6.3"
|
||||
loglevelnext "^3.0.1"
|
||||
ndarray "^1.0.18"
|
||||
|
||||
debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.1, debug@^2.6.3, debug@^2.6.6, debug@^2.6.8, debug@^2.6.9:
|
||||
version "2.6.9"
|
||||
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
|
||||
|
||||
Reference in new issue
Block a user