Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c73cfbc110 | ||
|
|
5716b71d40 | ||
|
|
a3028ad1f6 | ||
|
|
352407c71a | ||
|
|
1b5a5a2963 | ||
|
|
cf5136899e | ||
|
|
8c4e96bb3d | ||
|
|
5b334175c3 |
No files matched your search
@@ -16,6 +16,7 @@
|
|||||||
},
|
},
|
||||||
"globals": {
|
"globals": {
|
||||||
"cy": true,
|
"cy": true,
|
||||||
|
"before": true,
|
||||||
"context": true,
|
"context": true,
|
||||||
"Cypress": true,
|
"Cypress": true,
|
||||||
"assert": true
|
"assert": true
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
{
|
{
|
||||||
"editor.rulers": [
|
"editor.rulers": [80, 120],
|
||||||
80,
|
|
||||||
120
|
|
||||||
],
|
|
||||||
// ===
|
// ===
|
||||||
// Spacing
|
// Spacing
|
||||||
// ===
|
// ===
|
||||||
@@ -29,7 +26,7 @@
|
|||||||
"autoFix": true
|
"autoFix": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"prettier.disableLanguages": [],
|
"prettier.disableLanguages": ["html"],
|
||||||
"prettier.endOfLine": "lf",
|
"prettier.endOfLine": "lf",
|
||||||
"workbench.colorCustomizations": {}
|
"workbench.colorCustomizations": {}
|
||||||
}
|
}
|
||||||
@@ -3,6 +3,17 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [1.0.1](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-html@1.0.0...@ohif/extension-dicom-html@1.0.1) (2019-10-29)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Set SR viewport as active by interaction ([#1118](https://github.com/OHIF/Viewers/issues/1118)) ([5b33417](https://github.com/OHIF/Viewers/commit/5b334175c370afb930b4b6dbd307ddece8f850e3))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# [1.0.0](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-html@0.50.8...@ohif/extension-dicom-html@1.0.0) (2019-09-27)
|
# [1.0.0](https://github.com/OHIF/Viewers/compare/@ohif/extension-dicom-html@0.50.8...@ohif/extension-dicom-html@1.0.0) (2019-09-27)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ohif/extension-dicom-html",
|
"name": "@ohif/extension-dicom-html",
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"description": "OHIF extension for rendering structured reports to HTML",
|
"description": "OHIF extension for rendering structured reports to HTML",
|
||||||
"author": "OHIF",
|
"author": "OHIF",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
import OHIF from '@ohif/core';
|
||||||
|
import { connect } from 'react-redux';
|
||||||
|
import DicomHtmlViewport from './DicomHtmlViewport';
|
||||||
|
|
||||||
|
const { setViewportActive } = OHIF.redux.actions;
|
||||||
|
|
||||||
|
const mapStateToProps = (state, ownProps) => {
|
||||||
|
const { viewportIndex, byteArray } = ownProps;
|
||||||
|
const activeViewportIndex = state.viewports;
|
||||||
|
|
||||||
|
return {
|
||||||
|
viewportIndex,
|
||||||
|
activeViewportIndex,
|
||||||
|
byteArray,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const mapDispatchToProps = (dispatch, ownProps) => {
|
||||||
|
const { viewportIndex } = ownProps;
|
||||||
|
|
||||||
|
return {
|
||||||
|
setViewportActive: () => {
|
||||||
|
dispatch(setViewportActive(viewportIndex));
|
||||||
|
},
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
const ConnectedDicomHtmlViewport = connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(DicomHtmlViewport);
|
||||||
|
|
||||||
|
export default ConnectedDicomHtmlViewport;
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
import * as dcmjs from 'dcmjs';
|
import * as dcmjs from 'dcmjs';
|
||||||
import TypedArrayProp from './TypedArrayProp';
|
import TypedArrayProp from './TypedArrayProp';
|
||||||
|
|
||||||
import './DicomHtmlViewport.css';
|
import './DicomHtmlViewport.css';
|
||||||
|
|
||||||
function getRelationshipString(data) {
|
function getRelationshipString(data) {
|
||||||
@@ -30,7 +32,7 @@ function getValueString(data) {
|
|||||||
const {
|
const {
|
||||||
CodeMeaning,
|
CodeMeaning,
|
||||||
CodeValue,
|
CodeValue,
|
||||||
CodingSchemeDesignator
|
CodingSchemeDesignator,
|
||||||
} = data.ConceptNameCodeSequence;
|
} = data.ConceptNameCodeSequence;
|
||||||
|
|
||||||
return `${CodeMeaning} (${CodeValue}, ${CodingSchemeDesignator})`;
|
return `${CodeMeaning} (${CodeValue}, ${CodingSchemeDesignator})`;
|
||||||
@@ -75,7 +77,7 @@ function constructContentSequence(data, header) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const result = {
|
const result = {
|
||||||
items
|
items,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (header) {
|
if (header) {
|
||||||
@@ -106,9 +108,7 @@ const { DicomMetaDictionary, DicomMessage } = dcmjs.data;
|
|||||||
function getMainData(data) {
|
function getMainData(data) {
|
||||||
const root = [];
|
const root = [];
|
||||||
|
|
||||||
const patientValue = `${data.PatientName} (${data.PatientSex}, #${
|
const patientValue = `${data.PatientName} (${data.PatientSex}, #${data.PatientID})`;
|
||||||
data.PatientID
|
|
||||||
})`;
|
|
||||||
root.push(getMainDataItem('Patient', patientValue));
|
root.push(getMainDataItem('Patient', patientValue));
|
||||||
|
|
||||||
const studyValue = data.StudyDescription;
|
const studyValue = data.StudyDescription;
|
||||||
@@ -117,15 +117,13 @@ function getMainData(data) {
|
|||||||
const seriesValue = `${data.SeriesDescription} (#${data.SeriesNumber})`;
|
const seriesValue = `${data.SeriesDescription} (#${data.SeriesNumber})`;
|
||||||
root.push(getMainDataItem('Series', seriesValue));
|
root.push(getMainDataItem('Series', seriesValue));
|
||||||
|
|
||||||
const manufacturerValue = `${data.Manufacturer} (${
|
const manufacturerValue = `${data.Manufacturer} (${data.ManufacturerModelName}, #${data.DeviceSerialNumber})`;
|
||||||
data.ManufacturerModelName
|
|
||||||
}, #${data.DeviceSerialNumber})`;
|
|
||||||
|
|
||||||
root.push(getMainDataItem('Manufacturer', manufacturerValue));
|
root.push(getMainDataItem('Manufacturer', manufacturerValue));
|
||||||
|
|
||||||
const mainDataObjects = {
|
const mainDataObjects = {
|
||||||
CompletionFlag: 'Completion flag',
|
CompletionFlag: 'Completion flag',
|
||||||
VerificationFlag: 'Verification flag'
|
VerificationFlag: 'Verification flag',
|
||||||
};
|
};
|
||||||
|
|
||||||
Object.keys(mainDataObjects).forEach(key => {
|
Object.keys(mainDataObjects).forEach(key => {
|
||||||
@@ -154,7 +152,7 @@ const getContentSequence = (data, level = 1) => {
|
|||||||
const {
|
const {
|
||||||
CodeMeaning,
|
CodeMeaning,
|
||||||
CodeValue,
|
CodeValue,
|
||||||
CodingSchemeDesignator
|
CodingSchemeDesignator,
|
||||||
} = data.ConceptNameCodeSequence;
|
} = data.ConceptNameCodeSequence;
|
||||||
|
|
||||||
header = `${CodeMeaning} (${CodeValue} - ${CodingSchemeDesignator})`;
|
header = `${CodeMeaning} (${CodeValue} - ${CodingSchemeDesignator})`;
|
||||||
@@ -198,11 +196,14 @@ function getMainDataItem(key, value) {
|
|||||||
class DicomHtmlViewport extends Component {
|
class DicomHtmlViewport extends Component {
|
||||||
state = {
|
state = {
|
||||||
content: null,
|
content: null,
|
||||||
error: null
|
error: null,
|
||||||
};
|
};
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
byteArray: TypedArrayProp.uint8
|
byteArray: TypedArrayProp.uint8,
|
||||||
|
setViewportActive: PropTypes.func.isRequired,
|
||||||
|
viewportIndex: PropTypes.number.isRequired,
|
||||||
|
activeViewportIndex: PropTypes.number.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
@@ -225,15 +226,34 @@ class DicomHtmlViewport extends Component {
|
|||||||
);
|
);
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
content
|
content,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setViewportActiveHandler = () => {
|
||||||
|
const {
|
||||||
|
setViewportActive,
|
||||||
|
viewportIndex,
|
||||||
|
activeViewportIndex,
|
||||||
|
} = this.props;
|
||||||
|
|
||||||
|
if (viewportIndex !== activeViewportIndex) {
|
||||||
|
setViewportActive();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
const { content, error } = this.state;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={'DicomHtmlViewport'}>
|
<div
|
||||||
{this.state.content}
|
data-cy="dicom-html-viewport"
|
||||||
{this.state.error && <h2>{JSON.stringify(this.state.error)}</h2>}
|
className="DicomHtmlViewport"
|
||||||
|
onClick={this.setViewportActiveHandler}
|
||||||
|
onScroll={this.setViewportActiveHandler}
|
||||||
|
>
|
||||||
|
{content}
|
||||||
|
{error && <h2>{JSON.stringify(error)}</h2>}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import DicomHtmlViewport from './DicomHtmlViewport';
|
|
||||||
import OHIF from '@ohif/core';
|
import OHIF from '@ohif/core';
|
||||||
|
import ConnectedDicomHtmlViewport from './ConnectedDicomHtmlViewport';
|
||||||
|
|
||||||
const { DicomLoaderService } = OHIF.utils;
|
const { DicomLoaderService } = OHIF.utils;
|
||||||
|
|
||||||
class OHIFDicomHtmlViewport extends Component {
|
class OHIFDicomHtmlViewport extends Component {
|
||||||
@@ -9,6 +10,7 @@ class OHIFDicomHtmlViewport extends Component {
|
|||||||
studies: PropTypes.object,
|
studies: PropTypes.object,
|
||||||
displaySet: PropTypes.object,
|
displaySet: PropTypes.object,
|
||||||
viewportIndex: PropTypes.number,
|
viewportIndex: PropTypes.number,
|
||||||
|
viewportData: PropTypes.object,
|
||||||
};
|
};
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
@@ -40,7 +42,10 @@ class OHIFDicomHtmlViewport extends Component {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{this.state.byteArray && (
|
{this.state.byteArray && (
|
||||||
<DicomHtmlViewport byteArray={this.state.byteArray} />
|
<ConnectedDicomHtmlViewport
|
||||||
|
byteArray={this.state.byteArray}
|
||||||
|
viewportIndex={this.props.viewportIndex}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
{this.state.error && <h2>{JSON.stringify(this.state.error)}</h2>}
|
{this.state.error && <h2>{JSON.stringify(this.state.error)}</h2>}
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -3,6 +3,14 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [0.52.25](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.52.24...@ohif/extension-vtk@0.52.25) (2019-10-29)
|
||||||
|
|
||||||
|
**Note:** Version bump only for package @ohif/extension-vtk
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [0.52.24](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.52.23...@ohif/extension-vtk@0.52.24) (2019-10-29)
|
## [0.52.24](https://github.com/OHIF/Viewers/compare/@ohif/extension-vtk@0.52.23...@ohif/extension-vtk@0.52.24) (2019-10-29)
|
||||||
|
|
||||||
**Note:** Version bump only for package @ohif/extension-vtk
|
**Note:** Version bump only for package @ohif/extension-vtk
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ohif/extension-vtk",
|
"name": "@ohif/extension-vtk",
|
||||||
"version": "0.52.24",
|
"version": "0.52.25",
|
||||||
"description": "OHIF extension for VTK.js",
|
"description": "OHIF extension for VTK.js",
|
||||||
"author": "OHIF",
|
"author": "OHIF",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@ohif/core": "^1.6.0",
|
"@ohif/core": "^1.6.0",
|
||||||
"@ohif/ui": "^0.58.1",
|
"@ohif/ui": "^0.58.2",
|
||||||
"cornerstone-tools": "^4.0.9",
|
"cornerstone-tools": "^4.0.9",
|
||||||
"cornerstone-wado-image-loader": "^3.0.0",
|
"cornerstone-wado-image-loader": "^3.0.0",
|
||||||
"dcmjs": "^0.6.1",
|
"dcmjs": "^0.6.1",
|
||||||
|
|||||||
@@ -38,7 +38,8 @@
|
|||||||
[context.deploy-preview]
|
[context.deploy-preview]
|
||||||
base = ""
|
base = ""
|
||||||
publish = ".netlify/www/"
|
publish = ".netlify/www/"
|
||||||
command = "yarn config set workspaces-experimental true && chmod +x .netlify/build-deploy-preview.sh && .netlify/build-deploy-preview.sh"
|
command = "chmod +x .netlify/build-deploy-preview.sh && .netlify/build-deploy-preview.sh"
|
||||||
|
# command = "yarn config set workspaces-experimental true && chmod +x .netlify/build-deploy-preview.sh && .netlify/build-deploy-preview.sh"
|
||||||
|
|
||||||
[[headers]]
|
[[headers]]
|
||||||
# Define which paths this specific [[headers]] block will cover.
|
# Define which paths this specific [[headers]] block will cover.
|
||||||
|
|||||||
@@ -72,6 +72,7 @@
|
|||||||
"eslint-plugin-react": "7.x",
|
"eslint-plugin-react": "7.x",
|
||||||
"eslint-plugin-react-hooks": "1.5.0",
|
"eslint-plugin-react-hooks": "1.5.0",
|
||||||
"extract-css-chunks-webpack-plugin": "^4.5.4",
|
"extract-css-chunks-webpack-plugin": "^4.5.4",
|
||||||
|
"favicons-webpack-plugin": "^1.0.2",
|
||||||
"html-webpack-plugin": "^3.2.0",
|
"html-webpack-plugin": "^3.2.0",
|
||||||
"husky": "^3.0.0",
|
"husky": "^3.0.0",
|
||||||
"jest": "^24.8.0",
|
"jest": "^24.8.0",
|
||||||
@@ -102,7 +103,7 @@
|
|||||||
"webpack-dev-server": "^3.7.2",
|
"webpack-dev-server": "^3.7.2",
|
||||||
"webpack-hot-middleware": "^2.25.0",
|
"webpack-hot-middleware": "^2.25.0",
|
||||||
"webpack-merge": "^4.2.1",
|
"webpack-merge": "^4.2.1",
|
||||||
"workbox-webpack-plugin": "^4.3.1",
|
"workbox-webpack-plugin": "^5.0.0-beta.1",
|
||||||
"worker-loader": "^2.0.0"
|
"worker-loader": "^2.0.0"
|
||||||
},
|
},
|
||||||
"husky": {
|
"husky": {
|
||||||
|
|||||||
@@ -3,6 +3,17 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [0.58.2](https://github.com/OHIF/Viewers/compare/@ohif/ui@0.58.1...@ohif/ui@0.58.2) (2019-10-29)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 Limit image download size to avoid browser issues ([#1112](https://github.com/OHIF/Viewers/issues/1112)) ([5716b71](https://github.com/OHIF/Viewers/commit/5716b71d409ee1c6f13393c8cb7f50222415e198)), closes [#1099](https://github.com/OHIF/Viewers/issues/1099)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [0.58.1](https://github.com/OHIF/Viewers/compare/@ohif/ui@0.58.0...@ohif/ui@0.58.1) (2019-10-29)
|
## [0.58.1](https://github.com/OHIF/Viewers/compare/@ohif/ui@0.58.0...@ohif/ui@0.58.1) (2019-10-29)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ohif/ui",
|
"name": "@ohif/ui",
|
||||||
"version": "0.58.1",
|
"version": "0.58.2",
|
||||||
"description": "A set of React components for Medical Imaging Viewers",
|
"description": "A set of React components for Medical Imaging Viewers",
|
||||||
"author": "OHIF Contributors",
|
"author": "OHIF Contributors",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ const DownloadDialog = ({
|
|||||||
downloadBlob,
|
downloadBlob,
|
||||||
defaultSize,
|
defaultSize,
|
||||||
minimumSize,
|
minimumSize,
|
||||||
|
maximumSize,
|
||||||
canvasClass,
|
canvasClass,
|
||||||
}) => {
|
}) => {
|
||||||
const [filename, setFilename] = useState(DEFAULT_FILENAME);
|
const [filename, setFilename] = useState(DEFAULT_FILENAME);
|
||||||
@@ -75,24 +76,24 @@ const DownloadDialog = ({
|
|||||||
}, [defaultSize, disableViewport, enableViewport, viewportElement]);
|
}, [defaultSize, disableViewport, enableViewport, viewportElement]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
const validSize = value => (value >= minimumSize ? value : minimumSize);
|
||||||
const loadAndUpdateViewports = async () => {
|
const loadAndUpdateViewports = async () => {
|
||||||
const {
|
const {
|
||||||
image,
|
image,
|
||||||
width: scaledWidth,
|
width: scaledWidth,
|
||||||
height: scaledHeight,
|
height: scaledHeight,
|
||||||
} = await loadImage(activeViewport, viewportElement, width, height);
|
} = await loadImage(activeViewport, viewportElement, width, height);
|
||||||
|
|
||||||
setLastImage(image);
|
setLastImage(image);
|
||||||
|
|
||||||
toggleAnnotations(showAnnotations, viewportElement);
|
toggleAnnotations(showAnnotations, viewportElement);
|
||||||
|
|
||||||
setViewportElementHeight(scaledHeight);
|
setViewportElementHeight(validSize(scaledHeight));
|
||||||
setViewportElementWidth(scaledWidth);
|
setViewportElementWidth(validSize(scaledWidth));
|
||||||
|
|
||||||
setDownloadCanvas(state => ({
|
setDownloadCanvas(state => ({
|
||||||
...state,
|
...state,
|
||||||
height: scaledHeight,
|
height: validSize(scaledHeight),
|
||||||
width: scaledWidth,
|
width: validSize(scaledWidth),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const {
|
const {
|
||||||
@@ -108,8 +109,8 @@ const DownloadDialog = ({
|
|||||||
setViewportPreview(state => ({
|
setViewportPreview(state => ({
|
||||||
...state,
|
...state,
|
||||||
src: dataUrl,
|
src: dataUrl,
|
||||||
width: viewportElementWidth,
|
width: validSize(viewportElementWidth),
|
||||||
height: viewportElementHeight,
|
height: validSize(viewportElementHeight),
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -125,10 +126,12 @@ const DownloadDialog = ({
|
|||||||
updateViewportPreview,
|
updateViewportPreview,
|
||||||
fileType,
|
fileType,
|
||||||
downloadCanvas.ref,
|
downloadCanvas.ref,
|
||||||
|
minimumSize,
|
||||||
|
maximumSize,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const onHeightChange = () => {
|
const onHeightChange = event => {
|
||||||
const newHeight = event.target.value;
|
const newHeight = Math.min(event.target.value, maximumSize);
|
||||||
setHeight(newHeight);
|
setHeight(newHeight);
|
||||||
|
|
||||||
setViewportElementHeight(newHeight);
|
setViewportElementHeight(newHeight);
|
||||||
@@ -153,7 +156,7 @@ const DownloadDialog = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onWidthChange = event => {
|
const onWidthChange = event => {
|
||||||
const newWidth = event.target.value;
|
const newWidth = Math.min(event.target.value, maximumSize);
|
||||||
setWidth(newWidth);
|
setWidth(newWidth);
|
||||||
|
|
||||||
setViewportElementWidth(newWidth);
|
setViewportElementWidth(newWidth);
|
||||||
@@ -212,6 +215,7 @@ const DownloadDialog = ({
|
|||||||
<TextInput
|
<TextInput
|
||||||
type="number"
|
type="number"
|
||||||
min={minimumSize}
|
min={minimumSize}
|
||||||
|
max={maximumSize}
|
||||||
value={width}
|
value={width}
|
||||||
label={t('Image width (px)')}
|
label={t('Image width (px)')}
|
||||||
onChange={onWidthChange}
|
onChange={onWidthChange}
|
||||||
@@ -221,6 +225,7 @@ const DownloadDialog = ({
|
|||||||
<TextInput
|
<TextInput
|
||||||
type="number"
|
type="number"
|
||||||
min={minimumSize}
|
min={minimumSize}
|
||||||
|
max={maximumSize}
|
||||||
value={height}
|
value={height}
|
||||||
label={t('Image height (px)')}
|
label={t('Image height (px)')}
|
||||||
onChange={onHeightChange}
|
onChange={onHeightChange}
|
||||||
@@ -329,6 +334,7 @@ DownloadDialog.propTypes = {
|
|||||||
downloadBlob: PropTypes.func.isRequired,
|
downloadBlob: PropTypes.func.isRequired,
|
||||||
defaultSize: PropTypes.number.isRequired,
|
defaultSize: PropTypes.number.isRequired,
|
||||||
minimumSize: PropTypes.number.isRequired,
|
minimumSize: PropTypes.number.isRequired,
|
||||||
|
maximumSize: PropTypes.number.isRequired,
|
||||||
canvasClass: PropTypes.string.isRequired,
|
canvasClass: PropTypes.string.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// https://developers.google.com/web/tools/workbox/guides/codelabs/webpack
|
||||||
// ~~ WebPack
|
// ~~ WebPack
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const merge = require('webpack-merge');
|
const merge = require('webpack-merge');
|
||||||
@@ -9,8 +10,9 @@ const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
|
|||||||
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
||||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||||
const ExtractCssChunksPlugin = require('extract-css-chunks-webpack-plugin');
|
const ExtractCssChunksPlugin = require('extract-css-chunks-webpack-plugin');
|
||||||
|
// const FaviconsWebpackPlugin = require('favicons-webpack-plugin');
|
||||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
const WorkboxPlugin = require('workbox-webpack-plugin');
|
const { InjectManifest } = require('workbox-webpack-plugin');
|
||||||
const TerserJSPlugin = require('terser-webpack-plugin');
|
const TerserJSPlugin = require('terser-webpack-plugin');
|
||||||
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
|
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
|
||||||
// ~~ Rules
|
// ~~ Rules
|
||||||
@@ -80,12 +82,14 @@ module.exports = (env, argv) => {
|
|||||||
templateParameters: {
|
templateParameters: {
|
||||||
PUBLIC_URL: PUBLIC_URL,
|
PUBLIC_URL: PUBLIC_URL,
|
||||||
},
|
},
|
||||||
// favicon: `${PUBLIC_DIR}/favicon.ico`,
|
|
||||||
}),
|
}),
|
||||||
new WorkboxPlugin.GenerateSW({
|
// No longer maintained; but good for generating icons + manifest
|
||||||
|
// new FaviconsWebpackPlugin( path.join(PUBLIC_DIR, 'assets', 'icons-512.png')),
|
||||||
|
new InjectManifest({
|
||||||
swDest: 'sw.js',
|
swDest: 'sw.js',
|
||||||
clientsClaim: true,
|
swSrc: path.join(SRC_DIR, 'service-worker.js'),
|
||||||
skipWaiting: true,
|
// Increase the limit to 4mb:
|
||||||
|
// maximumFileSizeToCacheInBytes: 4 * 1024 * 1024
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
// https://webpack.js.org/configuration/dev-server/
|
// https://webpack.js.org/configuration/dev-server/
|
||||||
|
|||||||
@@ -3,6 +3,50 @@
|
|||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||||
|
|
||||||
|
## [2.3.2](https://github.com/OHIF/Viewers/compare/@ohif/viewer@2.3.1...@ohif/viewer@2.3.2) (2019-10-29)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* 🐛 Limit image download size to avoid browser issues ([#1112](https://github.com/OHIF/Viewers/issues/1112)) ([5716b71](https://github.com/OHIF/Viewers/commit/5716b71d409ee1c6f13393c8cb7f50222415e198)), closes [#1099](https://github.com/OHIF/Viewers/issues/1099)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [2.3.1](https://github.com/OHIF/Viewers/compare/@ohif/viewer@2.3.0...@ohif/viewer@2.3.1) (2019-10-29)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* rollbar template needs PUBLIC_URL defined ([#1127](https://github.com/OHIF/Viewers/issues/1127)) ([352407c](https://github.com/OHIF/Viewers/commit/352407c71ae93946e9ebad41446d6086cfbc237b))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# [2.3.0](https://github.com/OHIF/Viewers/compare/@ohif/viewer@2.2.2...@ohif/viewer@2.3.0) (2019-10-29)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* service worker ([#1045](https://github.com/OHIF/Viewers/issues/1045)) ([cf51368](https://github.com/OHIF/Viewers/commit/cf5136899eac08300ec4f15474a6440129ef7a9a))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## [2.2.2](https://github.com/OHIF/Viewers/compare/@ohif/viewer@2.2.1...@ohif/viewer@2.2.2) (2019-10-29)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Set SR viewport as active by interaction ([#1118](https://github.com/OHIF/Viewers/issues/1118)) ([5b33417](https://github.com/OHIF/Viewers/commit/5b334175c370afb930b4b6dbd307ddece8f850e3))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## [2.2.1](https://github.com/OHIF/Viewers/compare/@ohif/viewer@2.2.0...@ohif/viewer@2.2.1) (2019-10-29)
|
## [2.2.1](https://github.com/OHIF/Viewers/compare/@ohif/viewer@2.2.0...@ohif/viewer@2.2.1) (2019-10-29)
|
||||||
|
|
||||||
**Note:** Version bump only for package @ohif/viewer
|
**Note:** Version bump only for package @ohif/viewer
|
||||||
|
|||||||
@@ -22,4 +22,23 @@ describe('OHIF HTML Extension', () => {
|
|||||||
'Imaging Measurement Report'
|
'Imaging Measurement Report'
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('checks if the HTML viewport has been set to active by interaction', () => {
|
||||||
|
cy.setLayout('3', '3');
|
||||||
|
|
||||||
|
// check if viewport has been set as active by CLICKING
|
||||||
|
cy.get('[data-cy=viewprt-grid] > :nth-child(4)')
|
||||||
|
.click()
|
||||||
|
.then($viewport => {
|
||||||
|
cy.wrap($viewport).should('have.class', 'active');
|
||||||
|
});
|
||||||
|
|
||||||
|
// check if viewport has been set as active by SCROLLING
|
||||||
|
cy.get('[data-cy=viewprt-grid] > :nth-child(7)').then($viewport => {
|
||||||
|
cy.wrap($viewport)
|
||||||
|
.find('[data-cy=dicom-html-viewport]')
|
||||||
|
.scrollTo('bottom');
|
||||||
|
cy.wrap($viewport).should('have.class', 'active');
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
@@ -328,6 +328,21 @@ Cypress.Commands.add('percyCanvasSnapshot', (name, options = {}) => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Cypress.Commands.add('setLayout', (columns = 1, rows = 1) => {
|
||||||
|
cy.get('.toolbar-button-label')
|
||||||
|
.contains('Layout')
|
||||||
|
.click();
|
||||||
|
|
||||||
|
cy.get('.layoutChooser')
|
||||||
|
.find('tr')
|
||||||
|
.eq(rows - 1)
|
||||||
|
.find('td')
|
||||||
|
.eq(columns - 1)
|
||||||
|
.click();
|
||||||
|
|
||||||
|
cy.wait(1000);
|
||||||
|
});
|
||||||
|
|
||||||
function convertCanvas(documentClone) {
|
function convertCanvas(documentClone) {
|
||||||
documentClone
|
documentClone
|
||||||
.querySelectorAll('canvas')
|
.querySelectorAll('canvas')
|
||||||
@@ -364,4 +379,4 @@ function canvasToImage(selectorOrEl) {
|
|||||||
canvas.setAttribute('data-percy-canvas', true);
|
canvas.setAttribute('data-percy-canvas', true);
|
||||||
canvas.parentElement.appendChild(image);
|
canvas.parentElement.appendChild(image);
|
||||||
canvas.style = 'display: none';
|
canvas.style = 'display: none';
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@ohif/viewer",
|
"name": "@ohif/viewer",
|
||||||
"version": "2.2.1",
|
"version": "2.3.2",
|
||||||
"description": "OHIF Viewer",
|
"description": "OHIF Viewer",
|
||||||
"author": "OHIF Contributors",
|
"author": "OHIF Contributors",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
@@ -47,12 +47,12 @@
|
|||||||
"@babel/runtime": "^7.5.5",
|
"@babel/runtime": "^7.5.5",
|
||||||
"@ohif/core": "^1.6.0",
|
"@ohif/core": "^1.6.0",
|
||||||
"@ohif/extension-cornerstone": "^2.0.0",
|
"@ohif/extension-cornerstone": "^2.0.0",
|
||||||
"@ohif/extension-dicom-html": "^1.0.0",
|
"@ohif/extension-dicom-html": "^1.0.1",
|
||||||
"@ohif/extension-dicom-microscopy": "^0.50.6",
|
"@ohif/extension-dicom-microscopy": "^0.50.6",
|
||||||
"@ohif/extension-dicom-pdf": "^1.0.0",
|
"@ohif/extension-dicom-pdf": "^1.0.0",
|
||||||
"@ohif/extension-vtk": "^0.52.24",
|
"@ohif/extension-vtk": "^0.52.25",
|
||||||
"@ohif/i18n": "^0.51.0",
|
"@ohif/i18n": "^0.51.0",
|
||||||
"@ohif/ui": "^0.58.1",
|
"@ohif/ui": "^0.58.2",
|
||||||
"@tanem/react-nprogress": "^1.1.25",
|
"@tanem/react-nprogress": "^1.1.25",
|
||||||
"classnames": "^2.2.6",
|
"classnames": "^2.2.6",
|
||||||
"core-js": "^3.2.1",
|
"core-js": "^3.2.1",
|
||||||
|
|||||||
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 423 B |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 585 B |
|
After Width: | Height: | Size: 4.9 KiB |
|
After Width: | Height: | Size: 773 B |
|
After Width: | Height: | Size: 949 B |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 607 B |
|
After Width: | Height: | Size: 510 B |
|
After Width: | Height: | Size: 773 B |
|
After Width: | Height: | Size: 802 B |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 14 KiB |
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<browserconfig>
|
||||||
|
<msapplication>
|
||||||
|
<tile>
|
||||||
|
<square70x70logo src="/assets/mstile-70x70.png"/>
|
||||||
|
<square150x150logo src="/assets/mstile-150x150.png"/>
|
||||||
|
<wide310x150logo src="/assets/mstile-310x150.png"/>
|
||||||
|
<square310x310logo src="/assets/mstile-310x310.png"/>
|
||||||
|
<TileColor>#fff</TileColor>
|
||||||
|
</tile>
|
||||||
|
</msapplication>
|
||||||
|
</browserconfig>
|
||||||
|
After Width: | Height: | Size: 2.5 KiB |
|
After Width: | Height: | Size: 214 B |
|
After Width: | Height: | Size: 325 B |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 7.4 KiB |
|
After Width: | Height: | Size: 685 B |
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"version": "2.2.1",
|
||||||
|
"name": "OHIF Viewer",
|
||||||
|
"description": "OHIF Viewer",
|
||||||
|
"icons": {
|
||||||
|
"60": "/assets/firefox_app_60x60.png",
|
||||||
|
"128": "/assets/firefox_app_128x128.png",
|
||||||
|
"512": "/assets/firefox_app_512x512.png"
|
||||||
|
},
|
||||||
|
"developer": {
|
||||||
|
"name": "OHIF Contributors",
|
||||||
|
"url": "https://github.com/ohif/viewers"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 3.0 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 8.2 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 546 B |
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"version": "2.2.1",
|
||||||
|
"api_version": 1,
|
||||||
|
"layout": {
|
||||||
|
"logo": "/assets/yandex-browser-50x50.png",
|
||||||
|
"color": "#fff",
|
||||||
|
"show_title": true
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,35 +1,74 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||||
|
<meta name="theme-color" content="#000000" />
|
||||||
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
|
<meta name="application-name" content="OHIF Viewer">
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||||
|
<meta name="apple-mobile-web-app-title" content="@ohif/viewer">
|
||||||
|
<meta name="msapplication-TileColor" content="#fff">
|
||||||
|
<meta name="msapplication-TileImage" content="<%= PUBLIC_URL %>assets/mstile-144x144.png">
|
||||||
|
<meta name="msapplication-config" content="<%= PUBLIC_URL %>assets/browserconfig.xml">
|
||||||
|
<link rel="manifest" href="<%= PUBLIC_URL %>manifest.json">
|
||||||
|
|
||||||
<head>
|
<link rel="shortcut icon" href="<%= PUBLIC_URL %>assets/favicon.ico">
|
||||||
<meta charset="utf-8" />
|
<link rel="icon" type="image/png" sizes="16x16" href="<%= PUBLIC_URL %>assets/favicon-16x16.png">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
<link rel="icon" type="image/png" sizes="32x32" href="<%= PUBLIC_URL %>assets/favicon-32x32.png">
|
||||||
<meta name="theme-color" content="#000000" />
|
<link rel="apple-touch-icon" sizes="57x57" href="<%= PUBLIC_URL %>assets/apple-touch-icon-57x57.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="60x60" href="<%= PUBLIC_URL %>assets/apple-touch-icon-60x60.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="72x72" href="<%= PUBLIC_URL %>assets/apple-touch-icon-72x72.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="76x76" href="<%= PUBLIC_URL %>assets/apple-touch-icon-76x76.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="114x114" href="<%= PUBLIC_URL %>assets/apple-touch-icon-114x114.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="120x120" href="<%= PUBLIC_URL %>assets/apple-touch-icon-120x120.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="144x144" href="<%= PUBLIC_URL %>assets/apple-touch-icon-144x144.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="152x152" href="<%= PUBLIC_URL %>assets/apple-touch-icon-152x152.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="167x167" href="<%= PUBLIC_URL %>assets/apple-touch-icon-167x167.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="180x180" href="<%= PUBLIC_URL %>assets/apple-touch-icon-180x180.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="1024x1024" href="<%= PUBLIC_URL %>assets/apple-touch-icon-1024x1024.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 1)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-320x460.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 2)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-640x920.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-640x1096.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-750x1294.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 736px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 3)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-1182x2208.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 736px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 3)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-1242x2148.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 1)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-748x1024.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 1)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-768x1004.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 2)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-1496x2048.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-1536x2008.png">
|
||||||
|
<link rel="icon" type="image/png" sizes="228x228" href="<%= PUBLIC_URL %>assets/coast-228x228.png">
|
||||||
|
<link rel="yandex-tableau-widget" href="<%= PUBLIC_URL %>assets/yandex-browser-manifest.json">
|
||||||
|
|
||||||
<link rel="manifest" href="<%= PUBLIC_URL %>manifest.json" />
|
<!-- Built with: https://polyfill.io/v3/url-builder/ -->
|
||||||
<!-- Built with: https://polyfill.io/v3/url-builder/ -->
|
<!-- Targets IE11 -->
|
||||||
<!-- Targets IE11 -->
|
<script src="https://polyfill.io/v3/polyfill.min.js?flags=gated&features=default%2CObject.values%2CArray.prototype.flat%2CObject.entries%2CSymbol%2CArray.prototype.includes%2CString.prototype.repeat%2CArray.prototype.find"></script>
|
||||||
<script
|
<script type="text/javascript">
|
||||||
src="https://polyfill.io/v3/polyfill.min.js?flags=gated&features=default%2CObject.values%2CArray.prototype.flat%2CObject.entries%2CSymbol%2CArray.prototype.includes%2CString.prototype.repeat%2CArray.prototype.find"></script>
|
window.PUBLIC_URL = '<%= PUBLIC_URL %>';
|
||||||
<script type="text/javascript" src="<%= PUBLIC_URL %>app-config.js"></script>
|
</script>
|
||||||
|
<script type="text/javascript" src="<%= PUBLIC_URL %>app-config.js"></script>
|
||||||
|
<script type="module" src="<%= PUBLIC_URL %>init-service-worker.js"></script>
|
||||||
|
|
||||||
<title>OHIF Viewer</title>
|
<title>OHIF Viewer</title>
|
||||||
|
|
||||||
<!-- WEB FONTS -->
|
<!-- WEB FONTS -->
|
||||||
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700&display=swap" rel="stylesheet" />
|
<link
|
||||||
|
href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700&display=swap"
|
||||||
|
rel="stylesheet"
|
||||||
|
/>
|
||||||
|
|
||||||
<!-- EXTENSIONS -->
|
<!-- EXTENSIONS -->
|
||||||
<!-- <script type="text/javascript" src="path/to/some-extension.js"></script>
|
<!-- <script type="text/javascript" src="path/to/some-extension.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
window.config.extensions = [SomeExtension];
|
window.config.extensions = [SomeExtension];
|
||||||
</script> -->
|
</script> -->
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<noscript> You need to enable JavaScript to run this app. </noscript>
|
<noscript> You need to enable JavaScript to run this app. </noscript>
|
||||||
|
|
||||||
<div id="root"></div>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
|
<div id="root"></div>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -1,50 +1,86 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
||||||
|
<meta name="theme-color" content="#000000" />
|
||||||
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
|
<meta name="application-name" content="OHIF Viewer">
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
||||||
|
<meta name="apple-mobile-web-app-title" content="@ohif/viewer">
|
||||||
|
<meta name="msapplication-TileColor" content="#fff">
|
||||||
|
<meta name="msapplication-TileImage" content="<%= PUBLIC_URL %>assets/mstile-144x144.png">
|
||||||
|
<meta name="msapplication-config" content="<%= PUBLIC_URL %>assets/browserconfig.xml">
|
||||||
|
<link rel="manifest" href="<%= PUBLIC_URL %>manifest.json">
|
||||||
|
|
||||||
<head>
|
<link rel="shortcut icon" href="<%= PUBLIC_URL %>assets/favicon.ico">
|
||||||
<meta charset="utf-8" />
|
<link rel="icon" type="image/png" sizes="16x16" href="<%= PUBLIC_URL %>assets/favicon-16x16.png">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
|
<link rel="icon" type="image/png" sizes="32x32" href="<%= PUBLIC_URL %>assets/favicon-32x32.png">
|
||||||
<meta name="theme-color" content="#000000" />
|
<link rel="apple-touch-icon" sizes="57x57" href="<%= PUBLIC_URL %>assets/apple-touch-icon-57x57.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="60x60" href="<%= PUBLIC_URL %>assets/apple-touch-icon-60x60.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="72x72" href="<%= PUBLIC_URL %>assets/apple-touch-icon-72x72.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="76x76" href="<%= PUBLIC_URL %>assets/apple-touch-icon-76x76.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="114x114" href="<%= PUBLIC_URL %>assets/apple-touch-icon-114x114.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="120x120" href="<%= PUBLIC_URL %>assets/apple-touch-icon-120x120.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="144x144" href="<%= PUBLIC_URL %>assets/apple-touch-icon-144x144.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="152x152" href="<%= PUBLIC_URL %>assets/apple-touch-icon-152x152.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="167x167" href="<%= PUBLIC_URL %>assets/apple-touch-icon-167x167.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="180x180" href="<%= PUBLIC_URL %>assets/apple-touch-icon-180x180.png">
|
||||||
|
<link rel="apple-touch-icon" sizes="1024x1024" href="<%= PUBLIC_URL %>assets/apple-touch-icon-1024x1024.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 1)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-320x460.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 320px) and (device-height: 480px) and (-webkit-device-pixel-ratio: 2)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-640x920.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 320px) and (device-height: 568px) and (-webkit-device-pixel-ratio: 2)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-640x1096.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-750x1294.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 736px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 3)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-1182x2208.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 414px) and (device-height: 736px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 3)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-1242x2148.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 1)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-748x1024.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 1)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-768x1004.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (orientation: landscape) and (-webkit-device-pixel-ratio: 2)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-1496x2048.png">
|
||||||
|
<link rel="apple-touch-startup-image" media="(device-width: 768px) and (device-height: 1024px) and (orientation: portrait) and (-webkit-device-pixel-ratio: 2)" href="<%= PUBLIC_URL %>assets/apple-touch-startup-image-1536x2008.png">
|
||||||
|
<link rel="icon" type="image/png" sizes="228x228" href="<%= PUBLIC_URL %>assets/coast-228x228.png">
|
||||||
|
<link rel="yandex-tableau-widget" href="<%= PUBLIC_URL %>assets/yandex-browser-manifest.json">
|
||||||
|
|
||||||
<link rel="manifest" href="<%= PUBLIC_URL %>manifest.json" />
|
<!-- Built with: https://polyfill.io/v3/url-builder/ -->
|
||||||
<!-- Built with: https://polyfill.io/v3/url-builder/ -->
|
<!-- Targets IE11 -->
|
||||||
<!-- Targets IE11 -->
|
<script src="https://polyfill.io/v3/polyfill.min.js?flags=gated&features=default%2CObject.values%2CArray.prototype.flat%2CObject.entries%2CSymbol%2CArray.prototype.includes%2CString.prototype.repeat%2CArray.prototype.find"></script>
|
||||||
<script
|
<script type="text/javascript">
|
||||||
src="https://polyfill.io/v3/polyfill.min.js?flags=gated&features=default%2CObject.values%2CArray.prototype.flat%2CObject.entries%2CSymbol%2CArray.prototype.includes%2CString.prototype.repeat%2CArray.prototype.find"></script>
|
window.PUBLIC_URL = '<%= PUBLIC_URL %>';
|
||||||
<script type="text/javascript" src="<%= PUBLIC_URL %>app-config.js"></script>
|
</script>
|
||||||
|
<script type="text/javascript" src="<%= PUBLIC_URL %>app-config.js"></script>
|
||||||
|
<script type="module" src="<%= PUBLIC_URL %>init-service-worker.js"></script>
|
||||||
|
|
||||||
<title>OHIF Viewer</title>
|
<title>OHIF Viewer</title>
|
||||||
|
|
||||||
<!-- WEB FONTS -->
|
<!-- WEB FONTS -->
|
||||||
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700&display=swap" rel="stylesheet" />
|
<link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,700&display=swap" rel="stylesheet" />
|
||||||
|
|
||||||
<!-- EXTENSIONS -->
|
<!-- EXTENSIONS -->
|
||||||
<!-- <script type="text/javascript" src="path/to/some-extension.js"></script>
|
<!-- <script type="text/javascript" src="path/to/some-extension.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
window.config.extensions = [SomeExtension];
|
||||||
|
</script> -->
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<noscript> You need to enable JavaScript to run this app. </noscript>
|
||||||
|
|
||||||
|
<div id="root"></div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
window.config.extensions = [SomeExtension];
|
// Note: This is a client access token so there is no issue with having it publicly available
|
||||||
</script> -->
|
var _rollbarConfig = {
|
||||||
</head>
|
accessToken: "739c64cd39e84592ba062bc29aac9769",
|
||||||
|
captureUncaught: true,
|
||||||
<body>
|
captureUnhandledRejections: true,
|
||||||
<noscript> You need to enable JavaScript to run this app. </noscript>
|
payload: {
|
||||||
|
environment: "viewer.ohif.org"
|
||||||
<div id="root"></div>
|
}
|
||||||
|
};
|
||||||
<script>
|
// Rollbar Snippet
|
||||||
// Note: This is a client access token so there is no issue with having it publicly available
|
!function (r) { var e = {}; function o(n) { if (e[n]) return e[n].exports; var t = e[n] = { i: n, l: !1, exports: {} }; return r[n].call(t.exports, t, t.exports, o), t.l = !0, t.exports } o.m = r, o.c = e, o.d = function (r, e, n) { o.o(r, e) || Object.defineProperty(r, e, { enumerable: !0, get: n }) }, o.r = function (r) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(r, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(r, "__esModule", { value: !0 }) }, o.t = function (r, e) { if (1 & e && (r = o(r)), 8 & e) return r; if (4 & e && "object" == typeof r && r && r.__esModule) return r; var n = Object.create(null); if (o.r(n), Object.defineProperty(n, "default", { enumerable: !0, value: r }), 2 & e && "string" != typeof r) for (var t in r) o.d(n, t, function (e) { return r[e] }.bind(null, t)); return n }, o.n = function (r) { var e = r && r.__esModule ? function () { return r.default } : function () { return r }; return o.d(e, "a", e), e }, o.o = function (r, e) { return Object.prototype.hasOwnProperty.call(r, e) }, o.p = "", o(o.s = 0) }([function (r, e, o) { var n = o(1), t = o(4); _rollbarConfig = _rollbarConfig || {}, _rollbarConfig.rollbarJsUrl = _rollbarConfig.rollbarJsUrl || "https://cdnjs.cloudflare.com/ajax/libs/rollbar.js/2.7.1/rollbar.min.js", _rollbarConfig.async = void 0 === _rollbarConfig.async || _rollbarConfig.async; var a = n.setupShim(window, _rollbarConfig), l = t(_rollbarConfig); window.rollbar = n.Rollbar, a.loadFull(window, document, !_rollbarConfig.async, _rollbarConfig, l) }, function (r, e, o) { var n = o(2); function t(r) { return function () { try { return r.apply(this, arguments) } catch (r) { try { console.error("[Rollbar]: Internal error", r) } catch (r) { } } } } var a = 0; function l(r, e) { this.options = r, this._rollbarOldOnError = null; var o = a++; this.shimId = function () { return o }, "undefined" != typeof window && window._rollbarShims && (window._rollbarShims[o] = { handler: e, messages: [] }) } var i = o(3), d = function (r, e) { return new l(r, e) }, c = function (r) { return new i(d, r) }; function s(r) { return t(function () { var e = Array.prototype.slice.call(arguments, 0), o = { shim: this, method: r, args: e, ts: new Date }; window._rollbarShims[this.shimId()].messages.push(o) }) } l.prototype.loadFull = function (r, e, o, n, a) { var l = !1, i = e.createElement("script"), d = e.getElementsByTagName("script")[0], c = d.parentNode; i.crossOrigin = "", i.src = n.rollbarJsUrl, o || (i.async = !0), i.onload = i.onreadystatechange = t(function () { if (!(l || this.readyState && "loaded" !== this.readyState && "complete" !== this.readyState)) { i.onload = i.onreadystatechange = null; try { c.removeChild(i) } catch (r) { } l = !0, function () { var e; if (void 0 === r._rollbarDidLoad) { e = new Error("rollbar.js did not load"); for (var o, n, t, l, i = 0; o = r._rollbarShims[i++];)for (o = o.messages || []; n = o.shift();)for (t = n.args || [], i = 0; i < t.length; ++i)if ("function" == typeof (l = t[i])) { l(e); break } } "function" == typeof a && a(e) }() } }), c.insertBefore(i, d) }, l.prototype.wrap = function (r, e, o) { try { var n; if (n = "function" == typeof e ? e : function () { return e || {} }, "function" != typeof r) return r; if (r._isWrap) return r; if (!r._rollbar_wrapped && (r._rollbar_wrapped = function () { o && "function" == typeof o && o.apply(this, arguments); try { return r.apply(this, arguments) } catch (o) { var e = o; throw e && ("string" == typeof e && (e = new String(e)), e._rollbarContext = n() || {}, e._rollbarContext._wrappedSource = r.toString(), window._rollbarWrappedError = e), e } }, r._rollbar_wrapped._isWrap = !0, r.hasOwnProperty)) for (var t in r) r.hasOwnProperty(t) && (r._rollbar_wrapped[t] = r[t]); return r._rollbar_wrapped } catch (e) { return r } }; for (var p = "log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleUnhandledRejection,captureEvent,captureDomContentLoaded,captureLoad".split(","), u = 0; u < p.length; ++u)l.prototype[p[u]] = s(p[u]); r.exports = { setupShim: function (r, e) { if (r) { var o = e.globalAlias || "Rollbar"; if ("object" == typeof r[o]) return r[o]; r._rollbarShims = {}, r._rollbarWrappedError = null; var a = new c(e); return t(function () { e.captureUncaught && (a._rollbarOldOnError = r.onerror, n.captureUncaughtExceptions(r, a, !0), n.wrapGlobals(r, a, !0)), e.captureUnhandledRejections && n.captureUnhandledRejections(r, a, !0); var t = e.autoInstrument; return !1 !== e.enabled && (void 0 === t || !0 === t || "object" == typeof t && t.network) && r.addEventListener && (r.addEventListener("load", a.captureLoad.bind(a)), r.addEventListener("DOMContentLoaded", a.captureDomContentLoaded.bind(a))), r[o] = a, a })() } }, Rollbar: c } }, function (r, e) { function o(r, e, o) { if (e.hasOwnProperty && e.hasOwnProperty("addEventListener")) { for (var n = e.addEventListener; n._rollbarOldAdd && n.belongsToShim;)n = n._rLine truncated
|
||||||
var _rollbarConfig = {
|
// End Rollbar Snippet
|
||||||
accessToken: "739c64cd39e84592ba062bc29aac9769",
|
</script>
|
||||||
captureUncaught: true,
|
</body>
|
||||||
captureUnhandledRejections: true,
|
|
||||||
payload: {
|
|
||||||
environment: "viewer.ohif.org"
|
|
||||||
}
|
|
||||||
};
|
|
||||||
// Rollbar Snippet
|
|
||||||
!function (r) { var e = {}; function o(n) { if (e[n]) return e[n].exports; var t = e[n] = { i: n, l: !1, exports: {} }; return r[n].call(t.exports, t, t.exports, o), t.l = !0, t.exports } o.m = r, o.c = e, o.d = function (r, e, n) { o.o(r, e) || Object.defineProperty(r, e, { enumerable: !0, get: n }) }, o.r = function (r) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(r, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(r, "__esModule", { value: !0 }) }, o.t = function (r, e) { if (1 & e && (r = o(r)), 8 & e) return r; if (4 & e && "object" == typeof r && r && r.__esModule) return r; var n = Object.create(null); if (o.r(n), Object.defineProperty(n, "default", { enumerable: !0, value: r }), 2 & e && "string" != typeof r) for (var t in r) o.d(n, t, function (e) { return r[e] }.bind(null, t)); return n }, o.n = function (r) { var e = r && r.__esModule ? function () { return r.default } : function () { return r }; return o.d(e, "a", e), e }, o.o = function (r, e) { return Object.prototype.hasOwnProperty.call(r, e) }, o.p = "", o(o.s = 0) }([function (r, e, o) { var n = o(1), t = o(4); _rollbarConfig = _rollbarConfig || {}, _rollbarConfig.rollbarJsUrl = _rollbarConfig.rollbarJsUrl || "https://cdnjs.cloudflare.com/ajax/libs/rollbar.js/2.7.1/rollbar.min.js", _rollbarConfig.async = void 0 === _rollbarConfig.async || _rollbarConfig.async; var a = n.setupShim(window, _rollbarConfig), l = t(_rollbarConfig); window.rollbar = n.Rollbar, a.loadFull(window, document, !_rollbarConfig.async, _rollbarConfig, l) }, function (r, e, o) { var n = o(2); function t(r) { return function () { try { return r.apply(this, arguments) } catch (r) { try { console.error("[Rollbar]: Internal error", r) } catch (r) { } } } } var a = 0; function l(r, e) { this.options = r, this._rollbarOldOnError = null; var o = a++; this.shimId = function () { return o }, "undefined" != typeof window && window._rollbarShims && (window._rollbarShims[o] = { handler: e, messages: [] }) } var i = o(3), d = function (r, e) { return new l(r, e) }, c = function (r) { return new i(d, r) }; function s(r) { return t(function () { var e = Array.prototype.slice.call(arguments, 0), o = { shim: this, method: r, args: e, ts: new Date }; window._rollbarShims[this.shimId()].messages.push(o) }) } l.prototype.loadFull = function (r, e, o, n, a) { var l = !1, i = e.createElement("script"), d = e.getElementsByTagName("script")[0], c = d.parentNode; i.crossOrigin = "", i.src = n.rollbarJsUrl, o || (i.async = !0), i.onload = i.onreadystatechange = t(function () { if (!(l || this.readyState && "loaded" !== this.readyState && "complete" !== this.readyState)) { i.onload = i.onreadystatechange = null; try { c.removeChild(i) } catch (r) { } l = !0, function () { var e; if (void 0 === r._rollbarDidLoad) { e = new Error("rollbar.js did not load"); for (var o, n, t, l, i = 0; o = r._rollbarShims[i++];)for (o = o.messages || []; n = o.shift();)for (t = n.args || [], i = 0; i < t.length; ++i)if ("function" == typeof (l = t[i])) { l(e); break } } "function" == typeof a && a(e) }() } }), c.insertBefore(i, d) }, l.prototype.wrap = function (r, e, o) { try { var n; if (n = "function" == typeof e ? e : function () { return e || {} }, "function" != typeof r) return r; if (r._isWrap) return r; if (!r._rollbar_wrapped && (r._rollbar_wrapped = function () { o && "function" == typeof o && o.apply(this, arguments); try { return r.apply(this, arguments) } catch (o) { var e = o; throw e && ("string" == typeof e && (e = new String(e)), e._rollbarContext = n() || {}, e._rollbarContext._wrappedSource = r.toString(), window._rollbarWrappedError = e), e } }, r._rollbar_wrapped._isWrap = !0, r.hasOwnProperty)) for (var t in r) r.hasOwnProperty(t) && (r._rollbar_wrapped[t] = r[t]); return r._rollbar_wrapped } catch (e) { return r } }; for (var p = "log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleUnhandledRejection,captureEvent,captureDomContentLoaded,captureLoad".split(","), u = 0; u < p.length; ++u)l.prototype[p[u]] = s(p[u]); r.exports = { setupShim: function (r, e) { if (r) { var o = e.globalAlias || "Rollbar"; if ("object" == typeof r[o]) return r[o]; r._rollbarShims = {}, r._rollbarWrappedError = null; var a = new c(e); return t(function () { e.captureUncaught && (a._rollbarOldOnError = r.onerror, n.captureUncaughtExceptions(r, a, !0), n.wrapGlobals(r, a, !0)), e.captureUnhandledRejections && n.captureUnhandledRejections(r, a, !0); var t = e.autoInstrument; return !1 !== e.enabled && (void 0 === t || !0 === t || "object" == typeof t && t.network) && r.addEventListener && (r.addEventListener("load", a.captureLoad.bind(a)), r.addEventListener("DOMContentLoaded", a.captureDomContentLoaded.bind(a))), r[o] = a, a })() } }, Rollbar: c } }, function (r, e) { function o(r, e, o) { if (e.hasOwnProperty && e.hasOwnProperty("addEventListener")) { for (var n = e.addEventListener; n._rollbarOldAdd && n.belongsToShim;)n = n._rolLine truncated
|
|
||||||
// End Rollbar Snippet
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
// https://developers.google.com/web/tools/workbox/modules/workbox-window
|
||||||
|
// All major browsers that support service worker also support native JavaScript
|
||||||
|
// modules, so it's perfectly fine to serve this code to any browsers
|
||||||
|
// (older browsers will just ignore it)
|
||||||
|
//
|
||||||
|
import { Workbox } from 'https://storage.googleapis.com/workbox-cdn/releases/5.0.0-beta.1/workbox-window.prod.mjs';
|
||||||
|
|
||||||
|
var supportsServiceWorker = 'serviceWorker' in navigator;
|
||||||
|
var isNotLocalDevelopment =
|
||||||
|
['localhost', '127'].indexOf(location.hostname) === -1;
|
||||||
|
|
||||||
|
if (supportsServiceWorker && isNotLocalDevelopment) {
|
||||||
|
const swFileLocation = (window.PUBLIC_URL || '/') + 'sw.js';
|
||||||
|
const wb = new Workbox(swFileLocation);
|
||||||
|
|
||||||
|
// Add an event listener to detect when the registered
|
||||||
|
// service worker has installed but is waiting to activate.
|
||||||
|
wb.addEventListener('waiting', event => {
|
||||||
|
// customize the UI prompt accordingly.
|
||||||
|
const isFirstTimeUpdatedServiceWorkerIsWaiting =
|
||||||
|
event.wasWaitingBeforeRegister === false;
|
||||||
|
console.log(
|
||||||
|
'isFirstTimeUpdatedServiceWorkerIsWaiting',
|
||||||
|
isFirstTimeUpdatedServiceWorkerIsWaiting
|
||||||
|
);
|
||||||
|
|
||||||
|
// Assumes your app has some sort of prompt UI element
|
||||||
|
// that a user can either accept or reject.
|
||||||
|
// const prompt = createUIPrompt({
|
||||||
|
// onAccept: async () => {
|
||||||
|
// Assuming the user accepted the update, set up a listener
|
||||||
|
// that will reload the page as soon as the previously waiting
|
||||||
|
// service worker has taken control.
|
||||||
|
wb.addEventListener('controlling', event => {
|
||||||
|
window.location.reload();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Send a message telling the service worker to skip waiting.
|
||||||
|
// This will trigger the `controlling` event handler above.
|
||||||
|
// Note: for this to work, you have to add a message
|
||||||
|
// listener in your service worker. See below.
|
||||||
|
wb.messageSW({ type: 'SKIP_WAITING' });
|
||||||
|
// },
|
||||||
|
|
||||||
|
// onReject: () => {
|
||||||
|
// prompt.dismiss();
|
||||||
|
// },
|
||||||
|
// });
|
||||||
|
});
|
||||||
|
|
||||||
|
wb.register();
|
||||||
|
}
|
||||||
@@ -1,8 +1,59 @@
|
|||||||
{
|
{
|
||||||
"short_name": "react-cornerstone-viewport",
|
"name": "OHIF Viewer",
|
||||||
"name": "react-cornerstone-viewport",
|
"short_name": "Viewer",
|
||||||
|
"description": "OHIF Viewer",
|
||||||
|
"dir": "auto",
|
||||||
|
"lang": "en-US",
|
||||||
|
"orientation": "any",
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "/assets/android-chrome-36x36.png",
|
||||||
|
"sizes": "36x36",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/assets/android-chrome-48x48.png",
|
||||||
|
"sizes": "48x48",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/assets/android-chrome-72x72.png",
|
||||||
|
"sizes": "72x72",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/assets/android-chrome-96x96.png",
|
||||||
|
"sizes": "96x96",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/assets/android-chrome-144x144.png",
|
||||||
|
"sizes": "144x144",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/assets/android-chrome-192x192.png",
|
||||||
|
"sizes": "192x192",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/assets/android-chrome-256x256.png",
|
||||||
|
"sizes": "256x256",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/assets/android-chrome-384x384.png",
|
||||||
|
"sizes": "384x384",
|
||||||
|
"type": "image/png"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/assets/android-chrome-512x512.png",
|
||||||
|
"sizes": "512x512",
|
||||||
|
"type": "image/png"
|
||||||
|
}
|
||||||
|
],
|
||||||
"start_url": "./index.html",
|
"start_url": "./index.html",
|
||||||
|
"background_color": "#000000",
|
||||||
"display": "standalone",
|
"display": "standalone",
|
||||||
"theme_color": "#000000",
|
"theme_color": "#20a5d6"
|
||||||
"background_color": "#ffffff"
|
|
||||||
}
|
}
|
||||||
@@ -6,6 +6,7 @@ import cornerstoneTools from 'cornerstone-tools';
|
|||||||
|
|
||||||
const MINIMUM_SIZE = 100;
|
const MINIMUM_SIZE = 100;
|
||||||
const DEFAULT_SIZE = 512;
|
const DEFAULT_SIZE = 512;
|
||||||
|
const MAX_TEXTURE_SIZE = 10000;
|
||||||
|
|
||||||
const mapStateToProps = (state, ownProps) => {
|
const mapStateToProps = (state, ownProps) => {
|
||||||
const { viewportSpecificData, activeViewportIndex } = state.viewports;
|
const { viewportSpecificData, activeViewportIndex } = state.viewports;
|
||||||
@@ -14,6 +15,7 @@ const mapStateToProps = (state, ownProps) => {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
minimumSize: MINIMUM_SIZE,
|
minimumSize: MINIMUM_SIZE,
|
||||||
|
maximumSize: MAX_TEXTURE_SIZE,
|
||||||
defaultSize: DEFAULT_SIZE,
|
defaultSize: DEFAULT_SIZE,
|
||||||
canvasClass: 'cornerstone-canvas',
|
canvasClass: 'cornerstone-canvas',
|
||||||
onClose: ownProps.toggleDownloadDialog,
|
onClose: ownProps.toggleDownloadDialog,
|
||||||
@@ -74,7 +76,6 @@ const mapStateToProps = (state, ownProps) => {
|
|||||||
cornerstone.setViewport(viewportElement, viewport);
|
cornerstone.setViewport(viewportElement, viewport);
|
||||||
cornerstone.resize(viewportElement, true);
|
cornerstone.resize(viewportElement, true);
|
||||||
|
|
||||||
const MAX_TEXTURE_SIZE = 16384;
|
|
||||||
const newWidth = Math.min(width || image.width, MAX_TEXTURE_SIZE);
|
const newWidth = Math.min(width || image.width, MAX_TEXTURE_SIZE);
|
||||||
const newHeight = Math.min(
|
const newHeight = Math.min(
|
||||||
height || image.height,
|
height || image.height,
|
||||||
@@ -108,7 +109,15 @@ const mapStateToProps = (state, ownProps) => {
|
|||||||
return window.navigator.msSaveBlob(blob, file);
|
return window.navigator.msSaveBlob(blob, file);
|
||||||
}
|
}
|
||||||
|
|
||||||
return cornerstoneTools.SaveAs(viewportElement, file, mimetype);
|
viewportElement.querySelector('canvas').toBlob(blob => {
|
||||||
|
const URLObj = window.URL || window.webkitURL;
|
||||||
|
const a = document.createElement('a');
|
||||||
|
a.href = URLObj.createObjectURL(blob);
|
||||||
|
a.download = file;
|
||||||
|
document.body.appendChild(a);
|
||||||
|
a.click();
|
||||||
|
document.body.removeChild(a);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,67 @@
|
|||||||
|
// https://developers.google.com/web/tools/workbox/guides/troubleshoot-and-debug
|
||||||
|
importScripts(
|
||||||
|
'https://storage.googleapis.com/workbox-cdn/releases/5.0.0-beta.1/workbox-sw.js'
|
||||||
|
);
|
||||||
|
|
||||||
|
// Install newest
|
||||||
|
// https://developers.google.com/web/tools/workbox/modules/workbox-core
|
||||||
|
workbox.core.skipWaiting();
|
||||||
|
workbox.core.clientsClaim();
|
||||||
|
|
||||||
|
// Cache static assets that aren't precached
|
||||||
|
workbox.routing.registerRoute(
|
||||||
|
/\.(?:js|css)$/,
|
||||||
|
new workbox.strategies.StaleWhileRevalidate({
|
||||||
|
cacheName: 'static-resources',
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
// Cache the Google Fonts stylesheets with a stale-while-revalidate strategy.
|
||||||
|
workbox.routing.registerRoute(
|
||||||
|
/^https:\/\/fonts\.googleapis\.com/,
|
||||||
|
new workbox.strategies.StaleWhileRevalidate({
|
||||||
|
cacheName: 'google-fonts-stylesheets',
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
// Cache the underlying font files with a cache-first strategy for 1 year.
|
||||||
|
workbox.routing.registerRoute(
|
||||||
|
/^https:\/\/fonts\.gstatic\.com/,
|
||||||
|
new workbox.strategies.CacheFirst({
|
||||||
|
cacheName: 'google-fonts-webfonts',
|
||||||
|
plugins: [
|
||||||
|
new workbox.cacheableResponse.CacheableResponsePlugin({
|
||||||
|
statuses: [0, 200],
|
||||||
|
}),
|
||||||
|
new workbox.expiration.ExpirationPlugin({
|
||||||
|
maxAgeSeconds: 60 * 60 * 24 * 365, // 1 Year
|
||||||
|
maxEntries: 30,
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
// MESSAGE HANDLER
|
||||||
|
self.addEventListener('message', event => {
|
||||||
|
if (event.data && event.data.type === 'SKIP_WAITING') {
|
||||||
|
switch (event.data.type) {
|
||||||
|
case 'SKIP_WAITING':
|
||||||
|
// TODO: We'll eventually want this to be user prompted
|
||||||
|
// workbox.core.skipWaiting();
|
||||||
|
// workbox.core.clientsClaim();
|
||||||
|
// TODO: Global notification to indicate incoming reload
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
console.warn(`SW: Invalid message type: ${event.data.type}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
workbox.precaching.precacheAndRoute(self.__WB_MANIFEST);
|
||||||
|
|
||||||
|
// TODO: Cache API
|
||||||
|
// https://developers.google.com/web/fundamentals/instant-and-offline/web-storage/cache-api
|
||||||
|
// Store DICOMs?
|
||||||
|
// Clear Service Worker cache?
|
||||||
|
// navigator.storage.estimate().then(est => console.log(est)); (2GB?)
|
||||||