feat(ViewportActionMenu): window level per viewport / new patient info / colorbars/ 3D presets and 3D volume rendering (#3963)
Co-authored-by: Joe Boccanfuso <109477394+jbocce@users.noreply.github.com>
This commit is contained in:
1 parent
07301fc020
commit
b7f90e3951
164 files changed
+5887
-932
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import MODULE_TYPES from './MODULE_TYPES';
|
||||
import log from '../log';
|
||||
import { AppConfig } from '../types/AppConfig';
|
||||
import { PubSubService, ServicesManager } from '../services';
|
||||
import { PubSubService, ServiceProvidersManager, ServicesManager } from '../services';
|
||||
import { HotkeysManager, CommandsManager } from '../classes';
|
||||
import { DataSourceDefinition } from '../types';
|
||||
|
||||
@@ -10,6 +10,7 @@ import { DataSourceDefinition } from '../types';
|
||||
*/
|
||||
export interface ExtensionConstructor {
|
||||
servicesManager: ServicesManager;
|
||||
serviceProvidersManager: ServiceProvidersManager;
|
||||
commandsManager: CommandsManager;
|
||||
hotkeysManager: HotkeysManager;
|
||||
appConfig: AppConfig;
|
||||
@@ -28,6 +29,7 @@ export type ExtensionConfiguration = Record<string, unknown>;
|
||||
export interface ExtensionParams extends ExtensionConstructor {
|
||||
extensionManager: ExtensionManager;
|
||||
servicesManager: ServicesManager;
|
||||
serviceProvidersManager: ServiceProvidersManager;
|
||||
configuration?: ExtensionConfiguration;
|
||||
}
|
||||
|
||||
@@ -71,6 +73,7 @@ export default class ExtensionManager extends PubSubService {
|
||||
private _commandsManager: CommandsManager;
|
||||
private _servicesManager: ServicesManager;
|
||||
private _hotkeysManager: HotkeysManager;
|
||||
private _serviceProvidersManager: ServiceProvidersManager;
|
||||
private modulesMap: Record<string, unknown>;
|
||||
private modules: Record<string, any[]>;
|
||||
private registeredExtensionIds: string[];
|
||||
@@ -88,6 +91,7 @@ export default class ExtensionManager extends PubSubService {
|
||||
constructor({
|
||||
commandsManager,
|
||||
servicesManager,
|
||||
serviceProvidersManager,
|
||||
hotkeysManager,
|
||||
appConfig = {},
|
||||
}: ExtensionConstructor) {
|
||||
@@ -98,6 +102,7 @@ export default class ExtensionManager extends PubSubService {
|
||||
//
|
||||
this._commandsManager = commandsManager;
|
||||
this._servicesManager = servicesManager;
|
||||
this._serviceProvidersManager = serviceProvidersManager;
|
||||
this._hotkeysManager = hotkeysManager;
|
||||
this._appConfig = appConfig;
|
||||
|
||||
@@ -256,6 +261,7 @@ export default class ExtensionManager extends PubSubService {
|
||||
if (extension.preRegistration) {
|
||||
await extension.preRegistration({
|
||||
servicesManager: this._servicesManager,
|
||||
serviceProvidersManager: this._serviceProvidersManager,
|
||||
commandsManager: this._commandsManager,
|
||||
hotkeysManager: this._hotkeysManager,
|
||||
extensionManager: this,
|
||||
|
||||
@@ -9,6 +9,7 @@ describe('Top level exports', () => {
|
||||
'ExtensionManager',
|
||||
'HotkeysManager',
|
||||
'ServicesManager',
|
||||
'ServiceProvidersManager',
|
||||
//
|
||||
'defaults',
|
||||
'utils',
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ExtensionManager, MODULE_TYPES } from './extensions';
|
||||
import { ServicesManager } from './services';
|
||||
import { ServiceProvidersManager, ServicesManager } from './services';
|
||||
import classes, { CommandsManager, HotkeysManager } from './classes';
|
||||
|
||||
import DICOMWeb from './DICOMWeb';
|
||||
@@ -51,6 +51,7 @@ const OHIF = {
|
||||
ExtensionManager,
|
||||
HotkeysManager,
|
||||
ServicesManager,
|
||||
ServiceProvidersManager,
|
||||
//
|
||||
defaults,
|
||||
utils,
|
||||
@@ -92,6 +93,7 @@ export {
|
||||
ExtensionManager,
|
||||
HotkeysManager,
|
||||
ServicesManager,
|
||||
ServiceProvidersManager,
|
||||
//
|
||||
defaults,
|
||||
utils,
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
import log from './../log.js';
|
||||
|
||||
/**
|
||||
* The ServiceProvidersManager allows for a React context provider class to be registered
|
||||
* for a particular service. This allows for extensions to register services
|
||||
* with context providers and the providers will be instantiated and added to the
|
||||
* DOM dynamically.
|
||||
*/
|
||||
export default class ServiceProvidersManager {
|
||||
public providers = {};
|
||||
|
||||
public constructor() {
|
||||
this.providers = {};
|
||||
}
|
||||
|
||||
registerProvider(serviceName, provider) {
|
||||
if (!serviceName) {
|
||||
log.warn(
|
||||
'Attempting to register a provider to a null/undefined service name. Exiting early.'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!provider) {
|
||||
log.warn('Attempting to register a null/undefined provider. Exiting early.');
|
||||
return;
|
||||
}
|
||||
|
||||
this.providers[serviceName] = provider;
|
||||
}
|
||||
}
|
||||
@@ -42,6 +42,9 @@ class UIModalService {
|
||||
closeButton = true,
|
||||
title = null,
|
||||
customClassName = null,
|
||||
movable = false,
|
||||
containerDimensions = null,
|
||||
contentDimensions = null,
|
||||
}) {
|
||||
return serviceImplementation._show({
|
||||
content,
|
||||
@@ -51,6 +54,9 @@ class UIModalService {
|
||||
closeButton,
|
||||
title,
|
||||
customClassName,
|
||||
movable,
|
||||
containerDimensions,
|
||||
contentDimensions,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import MeasurementService from './MeasurementService';
|
||||
import ServicesManager from './ServicesManager';
|
||||
import ServiceProvidersManager from './ServiceProvidersManager';
|
||||
import UIDialogService from './UIDialogService';
|
||||
import UIModalService from './UIModalService';
|
||||
import UINotificationService from './UINotificationService';
|
||||
@@ -22,6 +23,7 @@ export {
|
||||
Services,
|
||||
MeasurementService,
|
||||
ServicesManager,
|
||||
ServiceProvidersManager,
|
||||
CustomizationService,
|
||||
StateSyncService,
|
||||
UIDialogService,
|
||||
|
||||
@@ -133,6 +133,7 @@ export type SyncGroup = {
|
||||
id: string;
|
||||
source?: boolean;
|
||||
target?: boolean;
|
||||
options?: object;
|
||||
};
|
||||
|
||||
/** Declares a custom option, that is a computed type value */
|
||||
|
||||
@@ -33,4 +33,5 @@ export default interface Services {
|
||||
cornerstoneCacheService?: unknown;
|
||||
segmentationService?: unknown;
|
||||
panelService?: unknown;
|
||||
colorbarService?: unknown;
|
||||
}
|
||||
Reference in new issue
Block a user