fix(typescript): rename services to fix typescript (#3165)
* fix: Rename services to lower camel case, hp, measure * fix: Rename DisplaySetService instances to displaySetService * fix: Rename CornerstoneViewportService to lower camel case * fix: Added lower case segmentationService rename * rename other services (#3166) * rename uiDialogService * rename toolGroupService * rename uiNotificationService * rename viewportGridService * rename syncGroupService * rename CornerstoneCacheService * Fix a syntax error in hotkeys * Fix a couple of rename issues that were missed --------- Co-authored-by: Alireza <ar.sedghi@gmail.com>
This commit is contained in:
1 parent
a97fb2fc9a
commit
8af0362d12
97 files changed
+934
-908
No files matched your search
+16
-6
@@ -1,5 +1,5 @@
|
||||
import { ServicesManager } from '@ohif/core';
|
||||
import { cache as cs3DCache, Enums, volumeLoader } from '@cornerstonejs/core';
|
||||
import { utils } from '@ohif/core';
|
||||
|
||||
import getCornerstoneViewportType from '../../utils/getCornerstoneViewportType';
|
||||
import {
|
||||
@@ -10,6 +10,16 @@ import {
|
||||
const VOLUME_LOADER_SCHEME = 'cornerstoneStreamingImageVolume';
|
||||
|
||||
class CornerstoneCacheService {
|
||||
static REGISTRATION = (serviceManager: ServicesManager) => {
|
||||
return {
|
||||
name: 'cornerstoneCacheService',
|
||||
altName: 'CornerstoneCacheService',
|
||||
create: ({ configuration = {} }) => {
|
||||
return new CornerstoneCacheService(serviceManager);
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
stackImageIds: Map<string, string[]> = new Map();
|
||||
volumeImageIds: Map<string, string[]> = new Map();
|
||||
|
||||
@@ -69,7 +79,7 @@ class CornerstoneCacheService {
|
||||
viewportData: VolumeViewportData,
|
||||
invalidatedDisplaySetInstanceUID: string,
|
||||
dataSource,
|
||||
DisplaySetService
|
||||
displaySetService
|
||||
) {
|
||||
if (viewportData.viewportType === Enums.ViewportType.STACK) {
|
||||
throw new Error('Invalidation of StackViewport is not supported yet');
|
||||
@@ -85,7 +95,7 @@ class CornerstoneCacheService {
|
||||
}
|
||||
|
||||
const displaySets = viewportData.data.map(({ displaySetInstanceUID }) =>
|
||||
DisplaySetService.getDisplaySetByUID(displaySetInstanceUID)
|
||||
displaySetService.getDisplaySetByUID(displaySetInstanceUID)
|
||||
);
|
||||
|
||||
const newViewportData = await this._getVolumeViewportData(
|
||||
@@ -203,7 +213,7 @@ class CornerstoneCacheService {
|
||||
}
|
||||
|
||||
private _shouldRenderSegmentation(displaySets) {
|
||||
const { SegmentationService } = this.servicesManager.services;
|
||||
const { segmentationService } = this.servicesManager.services;
|
||||
|
||||
const viewportDisplaySetInstanceUIDs = displaySets.map(
|
||||
({ displaySetInstanceUID }) => displaySetInstanceUID
|
||||
@@ -211,12 +221,12 @@ class CornerstoneCacheService {
|
||||
|
||||
// check inside segmentations if any of them are referencing the displaySets
|
||||
// that are about to be displayed
|
||||
const segmentations = SegmentationService.getSegmentations();
|
||||
const segmentations = segmentationService.getSegmentations();
|
||||
|
||||
for (const segmentation of segmentations) {
|
||||
const segDisplaySetInstanceUID = segmentation.displaySetInstanceUID;
|
||||
|
||||
const shouldDisplaySeg = SegmentationService.shouldRenderSegmentation(
|
||||
const shouldDisplaySeg = segmentationService.shouldRenderSegmentation(
|
||||
viewportDisplaySetInstanceUIDs,
|
||||
segDisplaySetInstanceUID
|
||||
);
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
import CornerstoneCacheService from './CornerstoneCacheService';
|
||||
|
||||
export default function ExtendedCornerstoneCacheService(serviceManager) {
|
||||
return {
|
||||
name: 'CornerstoneCacheService',
|
||||
create: ({ configuration = {} }) => {
|
||||
return new CornerstoneCacheService(serviceManager);
|
||||
},
|
||||
};
|
||||
}
|
||||
export default CornerstoneCacheService;
|
||||
Reference in new issue
Block a user