Files
ohif-viewer/Packages-react/ohif-viewer/src/connectedComponents/Viewer.js
T

76 lines
2.7 KiB
JavaScript
Raw Normal View History

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';
import OHIF from 'ohif-core';
//import { CineDialog } from 'react-viewerbase';
import WhiteLabellingContext from '../WhiteLabellingContext.js';
import Header from '../components/Header';
import ConnectedFlexboxLayout from './ConnectedFlexboxLayout.js';
import ConnectedToolbarRow from './ConnectedToolbarRow';
2019-01-10 13:30:39 +01:00
import ConnectedStudyLoadingMonitor from './ConnectedStudyLoadingMonitor.js';
import StudyPrefetcher from '../components/StudyPrefetcher.js';
import './Viewer.css';
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);
});
};*/
/*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-14 15:23:48 +01:00
class Viewer extends Component {
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;