Working cornerstone tools buttons, needs UI updates + onClicks wrapped in toolbarService

This commit is contained in:
James A. Petts committed 2020-05-20 18:49:17 +02:00
commit a3e1c216c4
13 files changed
+179 -219

No files matched your search

+46 -17
View File
@@ -1,19 +1,48 @@
window.config = function(props) {
var servicesManager = props.servicesManager;
return {
routerBasename: '/',
enableGoogleCloudAdapter: true,
enableGoogleCloudAdapterUI: false,
showStudyList: true,
httpErrorHandler: error => {
// This is 429 when rejected from the public idc sandbox too often.
console.warn(error.status);
// Could use services manager here to bring up a dialog/modal if needed.
console.warn('test, navigate to https://ohif.org/');
window.location = 'https://ohif.org/';
window.config = {
routerBasename: '/',
enableGoogleCloudAdapter: true,
servers: {
// This is an array, but we'll only use the first entry for now
dicomWeb: [],
},
// This is an array, but we'll only use the first entry for now
oidc: [
{
// ~ REQUIRED
// Authorization Server URL
authority: 'https://accounts.google.com',
client_id:
'723928408739-k9k9r3i44j32rhu69vlnibipmmk9i57p.apps.googleusercontent.com',
redirect_uri: '/callback', // `OHIFStandaloneViewer.js`
response_type: 'id_token token',
scope:
'email profile openid https://www.googleapis.com/auth/cloudplatformprojects.readonly https://www.googleapis.com/auth/cloud-healthcare', // email profile openid
// ~ OPTIONAL
post_logout_redirect_uri: '/logout-redirect.html',
revoke_uri: 'https://accounts.google.com/o/oauth2/revoke?token=',
automaticSilentRenew: true,
revokeAccessTokenOnSignout: true,
},
healthcareApiEndpoint: 'https://idc-sandbox-002.appspot.com/v1beta1',
};
],
studyListFunctionsEnabled: true,
};
// window.config = function(props) {
// var servicesManager = props.servicesManager;
// return {
// routerBasename: '/',
// enableGoogleCloudAdapter: true,
// enableGoogleCloudAdapterUI: false,
// showStudyList: true,
// httpErrorHandler: error => {
// // This is 429 when rejected from the public idc sandbox too often.
// console.warn(error.status);
// // Could use services manager here to bring up a dialog/modal if needed.
// console.warn('test, navigate to https://ohif.org/');
// window.location = 'https://ohif.org/';
// },
// healthcareApiEndpoint: 'https://idc-sandbox-002.appspot.com/v1beta1',
// };
// };
+2
View File
@@ -8,6 +8,7 @@ import {
UIDialogService,
MeasurementService,
DisplaySetService,
ToolBarSerivce,
// utils,
// redux as reduxOHIF,
} from '@ohif/core';
@@ -45,6 +46,7 @@ function appInit(appConfigOrFunc, defaultExtensions) {
UIDialogService,
MeasurementService,
DisplaySetService,
ToolBarSerivce,
]);
/**
@@ -1,55 +0,0 @@
import { useEffect, useCallback } from 'react';
import {
displaySetManager,
ToolBarManager,
useViewModel,
useToolbarLayout,
} from '@ohif/core';
export default function DisplaySetCreator({
location,
mode,
dataSourceName,
extensionManager,
DisplaySetService,
}) {
console.warn('DisplaySetCreator rerendering');
const { routes, sopClassHandlers } = mode;
const dataSources = extensionManager.getDataSources(dataSourceName);
// TODO: For now assume one unique datasource.
const dataSource = dataSources[0];
const route = routes[0];
// Add toolbar state to the view model context?
const { displaySetInstanceUIDs, setDisplaySetInstanceUIDs } = useViewModel();
const { toolBarLayout, setToolBarLayout } = useToolbarLayout();
useEffect(() => {
let toolBarManager = new ToolBarManager(extensionManager, setToolBarLayout);
route.init({ toolBarManager });
}, [mode, dataSourceName, location]);
const createDisplaySets = useCallback(() => {
// Add SOPClassHandlers to a new SOPClassManager.
displaySetManager.init(extensionManager, sopClassHandlers, {
displaySetInstanceUIDs,
setDisplaySetInstanceUIDs,
});
const queryParams = location.search;
// Call the data source to start building the view model?
dataSource.retrieve.series.metadata(
queryParams,
displaySetManager.makeDisplaySets
);
}, [displaySetInstanceUIDs, location]);
useEffect(() => {
createDisplaySets();
}, [mode, dataSourceName, location]);
return null;
}
+1 -5
View File
@@ -2,13 +2,11 @@ import React, { useEffect, useCallback } from 'react';
import { useParams } from 'react-router';
import PropTypes from 'prop-types';
//
import { ToolBarManager } from '@ohif/core';
import { DragAndDropProvider } from '@ohif/ui';
//
import { useQuery } from '@hooks';
import ViewportGrid from '@components/ViewportGrid';
import Compose from './Compose';
//import DisplaySetCreator from './DisplaySetCreator';
export default function ModeRoute({
location,
@@ -69,9 +67,7 @@ export default function ModeRoute({
}
useEffect(() => {
// TODO -> Make this into a service
let toolBarManager = new ToolBarManager(extensionManager); //, setToolBarLayout);
route.init({ toolBarManager });
route.init({ servicesManager, extensionManager });
}, [mode, dataSourceName, location]);
// This queries for series, but... What does it do with them?