2019-01-24 14:00:01 +01:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
import PropTypes from 'prop-types';
|
2018-12-14 15:23:48 +01:00
|
|
|
import cornerstone from 'cornerstone-core';
|
|
|
|
|
import cornerstoneTools from 'cornerstone-tools';
|
2018-12-17 17:23:03 +01:00
|
|
|
import OHIF from 'ohif-core';
|
2018-12-31 13:26:38 +01:00
|
|
|
//import { CineDialog } from 'react-viewerbase';
|
2018-12-29 12:02:18 -02:00
|
|
|
|
2019-01-24 14:00:01 +01:00
|
|
|
import WhiteLabellingContext from '../WhiteLabellingContext.js';
|
|
|
|
|
import Header from '../components/Header';
|
2019-01-17 17:00:21 +01:00
|
|
|
import ConnectedFlexboxLayout from './ConnectedFlexboxLayout.js';
|
2019-01-24 14:00:01 +01:00
|
|
|
import ConnectedToolbarRow from './ConnectedToolbarRow';
|
2019-01-10 13:30:39 +01:00
|
|
|
import ConnectedStudyLoadingMonitor from './ConnectedStudyLoadingMonitor.js';
|
2019-01-17 17:00:21 +01:00
|
|
|
import StudyPrefetcher from '../components/StudyPrefetcher.js';
|
2018-12-18 13:33:26 +01:00
|
|
|
import './Viewer.css';
|
2019-01-09 00:13:44 +01:00
|
|
|
|
2018-12-14 15:23:48 +01:00
|
|
|
/**
|
|
|
|
|
* Inits OHIF Hanging Protocol's onReady.
|
|
|
|
|
* It waits for OHIF Hanging Protocol to be ready to instantiate the ProtocolEngine
|
|
|
|
|
* Hanging Protocol will use OHIF LayoutManager to render viewports properly
|
|
|
|
|
*/
|
|
|
|
|
/*const initHangingProtocol = () => {
|
|
|
|
|
// When Hanging Protocol is ready
|
|
|
|
|
HP.ProtocolStore.onReady(() => {
|
|
|
|
|
|
|
|
|
|
// Gets all StudyMetadata objects: necessary for Hanging Protocol to access study metadata
|
|
|
|
|
const studyMetadataList = OHIF.viewer.StudyMetadataList.all();
|
|
|
|
|
|
|
|
|
|
// Instantiate StudyMetadataSource: necessary for Hanging Protocol to get study metadata
|
|
|
|
|
const studyMetadataSource = new OHIF.studies.classes.OHIFStudyMetadataSource();
|
|
|
|
|
|
|
|
|
|
// Get prior studies map
|
|
|
|
|
const studyPriorsMap = OHIF.studylist.functions.getStudyPriorsMap(studyMetadataList);
|
|
|
|
|
|
|
|
|
|
// Creates Protocol Engine object with required arguments
|
|
|
|
|
const ProtocolEngine = new HP.ProtocolEngine(layoutManager, studyMetadataList, studyPriorsMap, studyMetadataSource);
|
|
|
|
|
|
|
|
|
|
// Sets up Hanging Protocol engine
|
|
|
|
|
HP.setEngine(ProtocolEngine);
|
|
|
|
|
});
|
|
|
|
|
};*/
|
|
|
|
|
|
2018-12-17 17:23:03 +01:00
|
|
|
/*const viewportUtils = OHIF.viewerbase.viewportUtils;
|
2018-12-14 15:23:48 +01:00
|
|
|
|
|
|
|
|
OHIF.viewer.functionList = {
|
|
|
|
|
toggleCineDialog: viewportUtils.toggleCineDialog,
|
|
|
|
|
toggleCinePlay: viewportUtils.toggleCinePlay,
|
|
|
|
|
clearTools: viewportUtils.clearTools,
|
|
|
|
|
resetViewport: viewportUtils.resetViewport,
|
|
|
|
|
invert: viewportUtils.invert
|
2018-12-17 17:23:03 +01:00
|
|
|
};*/
|
2018-12-14 15:23:48 +01:00
|
|
|
|
|
|
|
|
class Viewer extends Component {
|
2019-01-24 14:00:01 +01:00
|
|
|
static propTypes = {
|
|
|
|
|
studies: PropTypes.array
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<WhiteLabellingContext.Consumer>
|
|
|
|
|
{whiteLabelling => (
|
|
|
|
|
<Header home={false}>{whiteLabelling.logoComponent}</Header>
|
|
|
|
|
)}
|
|
|
|
|
</WhiteLabellingContext.Consumer>
|
|
|
|
|
<div id="viewer" className="Viewer">
|
|
|
|
|
<ConnectedToolbarRow />
|
|
|
|
|
<ConnectedStudyLoadingMonitor studies={this.props.studies} />
|
|
|
|
|
<StudyPrefetcher studies={this.props.studies} />
|
|
|
|
|
<ConnectedFlexboxLayout studies={this.props.studies} />
|
|
|
|
|
</div>
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
}
|
2018-12-14 15:23:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default Viewer;
|