wip, very broken as I moved stuff to ohif-core
This commit is contained in:
1 parent
7b66dec163
commit
d541c23117
418 files changed
+402
-19154
No files matched your search
@@ -1,4 +1,16 @@
|
||||
html,
|
||||
body,
|
||||
#root {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-color: black;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { Component } from 'react';
|
||||
import { withRouter } from 'react-router';
|
||||
import { Route, Switch } from 'react-router-dom';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
import { OHIF } from 'ohif-core';
|
||||
import ViewerRouting from "./ViewerRouting.js";
|
||||
import IHEInvokeImageDisplay from './IHEInvokeImageDisplay.js';
|
||||
import './App.css';
|
||||
@@ -20,6 +20,11 @@ function setContext(context) {
|
||||
|
||||
class App extends Component {
|
||||
componentDidMount() {
|
||||
// Temporary until the rest of the UI is in React
|
||||
window.router = {
|
||||
history: this.props.history
|
||||
};
|
||||
|
||||
this.unlisten = this.props.history.listen((location, action) => {
|
||||
setContext(window.location.pathname);
|
||||
});
|
||||
|
||||
@@ -1,7 +1,46 @@
|
||||
import React, {Component} from "react";
|
||||
import PropTypes from "prop-types";
|
||||
import Viewer from "./viewer/viewer.js";
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
import { OHIF } from 'ohif-core';
|
||||
|
||||
function createDisplaySets(studies) {
|
||||
// Define the OHIF.viewer.data global object
|
||||
OHIF.viewer.data = OHIF.viewer.data || {};
|
||||
|
||||
// @TypeSafeStudies
|
||||
// Clears OHIF.viewer.Studies collection
|
||||
OHIF.viewer.Studies.removeAll();
|
||||
|
||||
// @TypeSafeStudies
|
||||
// Clears OHIF.viewer.StudyMetadataList collection
|
||||
OHIF.viewer.StudyMetadataList.removeAll();
|
||||
|
||||
OHIF.viewer.data.studyInstanceUids = [];
|
||||
|
||||
const updatedStudies = studies.map(study => {
|
||||
const studyMetadata = new OHIF.metadata.OHIFStudyMetadata(study, study.studyInstanceUid);
|
||||
let displaySets = study.displaySets;
|
||||
|
||||
if (!study.displaySets) {
|
||||
displaySets = OHIF.viewerbase.sortingManager.getDisplaySets(studyMetadata);
|
||||
study.displaySets = displaySets;
|
||||
}
|
||||
|
||||
studyMetadata.setDisplaySets(displaySets);
|
||||
|
||||
study.selected = true;
|
||||
OHIF.viewer.Studies.insert(study);
|
||||
OHIF.viewer.StudyMetadataList.insert(studyMetadata);
|
||||
OHIF.viewer.data.studyInstanceUids.push(study.studyInstanceUid);
|
||||
|
||||
// Updates WADO-RS metaDataManager
|
||||
OHIF.viewerbase.updateMetaDataManager(study);
|
||||
|
||||
return study;
|
||||
});
|
||||
|
||||
return updatedStudies;
|
||||
}
|
||||
|
||||
class ViewerFromStudyData extends Component {
|
||||
constructor(props) {
|
||||
@@ -25,8 +64,11 @@ class ViewerFromStudyData extends Component {
|
||||
// Render the viewer when the data is ready
|
||||
promise.then(({ studies, viewerData }) => {
|
||||
OHIF.viewer.data = viewerData;
|
||||
|
||||
const updatedStudies = createDisplaySets(studies);
|
||||
|
||||
this.setState({
|
||||
studies,
|
||||
studies: updatedStudies,
|
||||
});
|
||||
}).catch(error => {
|
||||
this.setState({
|
||||
@@ -50,7 +92,7 @@ class ViewerFromStudyData extends Component {
|
||||
}
|
||||
|
||||
ViewerFromStudyData.propTypes = {
|
||||
studyInstanceUids: PropTypes.array,
|
||||
studyInstanceUids: PropTypes.array.isRequired,
|
||||
seriesInstanceUids: PropTypes.array
|
||||
};
|
||||
|
||||
|
||||
@@ -20,4 +20,13 @@ function ViewerRouting({ match }) {
|
||||
);
|
||||
}
|
||||
|
||||
ViewerRouting.propTypes = {
|
||||
match: PropTypes.shape({
|
||||
params: PropTypes.shape({
|
||||
studyInstanceUids: PropTypes.string.isRequired,
|
||||
seriesInstanceUids: PropTypes.string
|
||||
})
|
||||
})
|
||||
};
|
||||
|
||||
export default ViewerRouting;
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { Component } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
import { OHIF } from 'ohif-core';
|
||||
import { Viewerbase } from 'meteor/ohif:viewerbase';
|
||||
import { StudyBrowser } from 'react-viewerbase';
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@ import { BrowserRouter } from 'react-router-dom';
|
||||
import { Provider } from 'react-redux';
|
||||
import { createStore } from 'redux';
|
||||
import App from './App.js';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
import { OHIF } from 'ohif-core';
|
||||
|
||||
const store = createStore(OHIF.viewerbase.redux.combinedReducer);
|
||||
const store = createStore(OHIF.redux.combinedReducer);
|
||||
|
||||
// TODO[react] Use a provider when the whole tree is React
|
||||
window.store = store;
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { Template } from 'meteor/templating';
|
||||
import { Session } from 'meteor/session';
|
||||
import { ReactiveVar } from 'meteor/reactive-var';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
import { OHIF } from 'ohif-core';
|
||||
|
||||
import Viewer from '../viewer/viewer.js';
|
||||
|
||||
@@ -61,18 +60,8 @@ Template.ohifViewer.onCreated(() => {
|
||||
});
|
||||
|
||||
Template.ohifViewer.events({
|
||||
'click .js-toggle-studyList'(event, instance) {
|
||||
'click .js-toggle-studyList'(event) {
|
||||
event.preventDefault();
|
||||
const isViewer = Session.get('ViewerOpened');
|
||||
|
||||
/*if (isViewer) {
|
||||
Router.go('studylist');
|
||||
} else {
|
||||
const { studyInstanceUids } = OHIF.viewer.data;
|
||||
if (studyInstanceUids) {
|
||||
Router.go('viewerStudies', { studyInstanceUids });
|
||||
}
|
||||
}*/
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Template } from 'meteor/templating';
|
||||
import $ from 'jquery';
|
||||
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
import { OHIF } from 'ohif-core';
|
||||
import 'meteor/ohif:viewerbase';
|
||||
|
||||
function isThereSeries(studies) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { Component } from "react";
|
||||
import PropTypes from "prop-types";
|
||||
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
import { OHIF } from 'ohif-core';
|
||||
import { MeasurementTable } from 'meteor/ohif:measurement-table';
|
||||
|
||||
import { CineDialog } from 'react-viewerbase';
|
||||
@@ -79,51 +79,17 @@ class Viewer extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
|
||||
// Define the OHIF.viewer.data global object
|
||||
OHIF.viewer.data = OHIF.viewer.data || {};
|
||||
|
||||
// @TypeSafeStudies
|
||||
// Clears OHIF.viewer.Studies collection
|
||||
OHIF.viewer.Studies.removeAll();
|
||||
|
||||
// @TypeSafeStudies
|
||||
// Clears OHIF.viewer.StudyMetadataList collection
|
||||
OHIF.viewer.StudyMetadataList.removeAll();
|
||||
|
||||
OHIF.viewer.data.studyInstanceUids = [];
|
||||
|
||||
const studies = this.props.studies;
|
||||
studies.forEach(study => {
|
||||
const studyMetadata = new OHIF.metadata.StudyMetadata(study, study.studyInstanceUid);
|
||||
let displaySets = study.displaySets;
|
||||
|
||||
if (!study.displaySets) {
|
||||
displaySets = OHIF.viewerbase.sortingManager.getDisplaySets(studyMetadata);
|
||||
study.displaySets = displaySets;
|
||||
}
|
||||
|
||||
studyMetadata.setDisplaySets(displaySets);
|
||||
|
||||
study.selected = true;
|
||||
OHIF.viewer.Studies.insert(study);
|
||||
OHIF.viewer.StudyMetadataList.insert(studyMetadata);
|
||||
OHIF.viewer.data.studyInstanceUids.push(study.studyInstanceUid);
|
||||
|
||||
// Updates WADO-RS metaDataManager
|
||||
OHIF.viewerbase.updateMetaDataManager(study);
|
||||
});
|
||||
|
||||
this.state = {
|
||||
leftSidebar: 'studies',
|
||||
rightSidebar: 'measurements',
|
||||
studies
|
||||
studies: this.props.studies
|
||||
};
|
||||
}
|
||||
|
||||
render() {
|
||||
return (<>
|
||||
<div className='viewerDialogs'>
|
||||
<CineDialog/>
|
||||
{/*<CineDialog/>*/}
|
||||
</div>
|
||||
<div id="viewer" className='Viewer'>
|
||||
{/*<ToolbarSection/>*/}
|
||||
|
||||
Reference in new issue
Block a user