feat(PDF):Add PDF viewer (#2730)
Display DICOM encapsulated PDF documents in a PDF viewer. Addressed the remaining PR comments, and am merging this.
This commit is contained in:
1 parent
f3822f98a3
commit
82df3eac03
23 files changed
+376
-71
No files matched your search
@@ -24,12 +24,16 @@ const ENTRY_TARGET = process.env.ENTRY_TARGET || `${SRC_DIR}/index.js`;
|
||||
const Dotenv = require('dotenv-webpack');
|
||||
|
||||
const setHeaders = (res, path) => {
|
||||
res.setHeader('Content-Type', 'text/plain')
|
||||
if (path.indexOf('.gz') !== -1) {
|
||||
res.setHeader('Content-Encoding', 'gzip')
|
||||
} else if (path.indexOf('.br') !== -1) {
|
||||
res.setHeader('Content-Encoding', 'br')
|
||||
}
|
||||
if (path.indexOf('.pdf') !== -1) {
|
||||
res.setHeader('Content-Type', 'application/pdf');
|
||||
} else {
|
||||
res.setHeader('Content-Type', 'application/json')
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = (env, argv) => {
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
describe('OHIF PDF Display', function () {
|
||||
before(() => {
|
||||
cy.openStudyInViewer(
|
||||
'2.25.317377619501274872606137091638706705333'
|
||||
);
|
||||
});
|
||||
|
||||
beforeEach(function () {
|
||||
cy.resetViewport().wait(50);
|
||||
});
|
||||
|
||||
it('checks if series thumbnails are being displayed', function () {
|
||||
cy.get('[data-cy="study-browser-thumbnail"]')
|
||||
.its('length')
|
||||
.should('be.gt', 0);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -57,7 +57,6 @@
|
||||
"@ohif/ui": "^2.0.0",
|
||||
"@types/react": "^16.0.0",
|
||||
"classnames": "^2.2.6",
|
||||
"config-point": "^0.3.4",
|
||||
"core-js": "^3.16.1",
|
||||
"cornerstone-math": "^0.1.9",
|
||||
"cornerstone-tools": "6.0.2",
|
||||
|
||||
@@ -23,6 +23,7 @@ window.config = {
|
||||
supportsFuzzyMatching: false,
|
||||
supportsWildcard: true,
|
||||
staticWado: true,
|
||||
singlepart: "video,thumbnail,pdf",
|
||||
},
|
||||
},
|
||||
// {
|
||||
|
||||
@@ -23,6 +23,7 @@ window.config = {
|
||||
supportsFuzzyMatching: false,
|
||||
supportsWildcard: true,
|
||||
staticWado: true,
|
||||
singlepart: "bulkdata,video,pdf",
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -17,7 +17,6 @@ import {
|
||||
errorHandler
|
||||
// utils,
|
||||
} from '@ohif/core';
|
||||
import ConfigPoint from 'config-point';
|
||||
|
||||
/**
|
||||
* @param {object|func} appConfigOrFunc - application configuration, or a function that returns application configuration
|
||||
@@ -50,10 +49,6 @@ function appInit(appConfigOrFunc, defaultExtensions) {
|
||||
appConfig,
|
||||
});
|
||||
|
||||
// Load the default theme settings
|
||||
const defaultTheme = config && config.defaultTheme || 'theme';
|
||||
ConfigPoint.load(defaultTheme, '/theme', 'theme');
|
||||
|
||||
servicesManager.registerServices([
|
||||
UINotificationService,
|
||||
UIModalService,
|
||||
|
||||
@@ -24,6 +24,7 @@ import OHIFCornerstoneExtension from '@ohif/extension-cornerstone';
|
||||
import OHIFMeasurementTrackingExtension from '@ohif/extension-measurement-tracking';
|
||||
import OHIFDICOMSRExtension from '@ohif/extension-dicom-sr';
|
||||
import OHIFDICOMVIDEOExtension from '@ohif/extension-dicom-video';
|
||||
import OHIFDICOMPDFExtension from '@ohif/extension-dicom-pdf';
|
||||
|
||||
/** Combine our appConfiguration and "baked-in" extensions */
|
||||
const appProps = {
|
||||
@@ -34,11 +35,11 @@ const appProps = {
|
||||
OHIFMeasurementTrackingExtension,
|
||||
OHIFDICOMSRExtension,
|
||||
OHIFDICOMVIDEOExtension,
|
||||
OHIFDICOMPDFExtension,
|
||||
],
|
||||
};
|
||||
|
||||
/** Create App */
|
||||
const app = React.createElement(App, appProps, null);
|
||||
|
||||
/** Render */
|
||||
ReactDOM.render(app, document.getElementById('root'));
|
||||
Reference in new issue
Block a user