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
@@ -65,7 +65,7 @@
|
||||
"cornerstone-math": "^0.1.9",
|
||||
"cornerstone-wado-image-loader": "^4.2.1",
|
||||
"dayjs": "^1.11.6",
|
||||
"dcmjs": "^0.28.3",
|
||||
"dcmjs": "0.29.4",
|
||||
"detect-gpu": "^4.0.16",
|
||||
"dicom-parser": "^1.8.9",
|
||||
"dotenv-webpack": "^1.7.0",
|
||||
|
||||
@@ -30,10 +30,10 @@ function ViewerViewportGrid(props) {
|
||||
|
||||
// TODO -> Need some way of selecting which displaySets hit the viewports.
|
||||
const {
|
||||
DisplaySetService,
|
||||
MeasurementService,
|
||||
HangingProtocolService,
|
||||
UINotificationService,
|
||||
displaySetService,
|
||||
measurementService,
|
||||
hangingProtocolService,
|
||||
uiNotificationService,
|
||||
} = servicesManager.services;
|
||||
|
||||
/**
|
||||
@@ -48,7 +48,7 @@ function ViewerViewportGrid(props) {
|
||||
const {
|
||||
viewportMatchDetails,
|
||||
hpAlreadyApplied,
|
||||
} = HangingProtocolService.getMatchDetails();
|
||||
} = hangingProtocolService.getMatchDetails();
|
||||
|
||||
if (!viewportMatchDetails.size) {
|
||||
return;
|
||||
@@ -104,7 +104,7 @@ function ViewerViewportGrid(props) {
|
||||
|
||||
const suppressEvent = true;
|
||||
const applied = true;
|
||||
HangingProtocolService.setHangingProtocolAppliedForViewport(
|
||||
hangingProtocolService.setHangingProtocolAppliedForViewport(
|
||||
viewportIndex,
|
||||
applied,
|
||||
suppressEvent
|
||||
@@ -119,13 +119,13 @@ function ViewerViewportGrid(props) {
|
||||
(viewportIndex, displaySetInstanceUID) => {
|
||||
let updatedViewports = [];
|
||||
try {
|
||||
updatedViewports = HangingProtocolService.getViewportsRequireUpdate(
|
||||
updatedViewports = hangingProtocolService.getViewportsRequireUpdate(
|
||||
viewportIndex,
|
||||
displaySetInstanceUID
|
||||
);
|
||||
} catch (error) {
|
||||
console.warn(error);
|
||||
UINotificationService.show({
|
||||
uiNotificationService.show({
|
||||
title: 'Drag and Drop',
|
||||
message:
|
||||
'The selected display sets could not be added to the viewport due to a mismatch in the Hanging Protocol rules.',
|
||||
@@ -136,18 +136,18 @@ function ViewerViewportGrid(props) {
|
||||
|
||||
return updatedViewports;
|
||||
},
|
||||
[HangingProtocolService, UINotificationService]
|
||||
[hangingProtocolService, uiNotificationService]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
const displaySets = DisplaySetService.getActiveDisplaySets();
|
||||
const displaySets = displaySetService.getActiveDisplaySets();
|
||||
updateDisplaySetsForViewports(displaySets);
|
||||
}, [numRows, numCols]);
|
||||
|
||||
// Layout change based on hanging protocols
|
||||
useEffect(() => {
|
||||
const { unsubscribe } = HangingProtocolService.subscribe(
|
||||
HangingProtocolService.EVENTS.NEW_LAYOUT,
|
||||
const { unsubscribe } = hangingProtocolService.subscribe(
|
||||
hangingProtocolService.EVENTS.NEW_LAYOUT,
|
||||
({ layoutType, numRows, numCols, layoutOptions }) => {
|
||||
viewportGridService.setLayout({
|
||||
numRows,
|
||||
@@ -165,10 +165,10 @@ function ViewerViewportGrid(props) {
|
||||
|
||||
// Using Hanging protocol engine to match the displaySets
|
||||
useEffect(() => {
|
||||
const { unsubscribe } = HangingProtocolService.subscribe(
|
||||
HangingProtocolService.EVENTS.PROTOCOL_CHANGED,
|
||||
const { unsubscribe } = hangingProtocolService.subscribe(
|
||||
hangingProtocolService.EVENTS.PROTOCOL_CHANGED,
|
||||
() => {
|
||||
const displaySets = DisplaySetService.getActiveDisplaySets();
|
||||
const displaySets = displaySetService.getActiveDisplaySets();
|
||||
updateDisplaySetsForViewports(displaySets);
|
||||
}
|
||||
);
|
||||
@@ -179,8 +179,8 @@ function ViewerViewportGrid(props) {
|
||||
}, [viewports]);
|
||||
|
||||
useEffect(() => {
|
||||
const { unsubscribe } = MeasurementService.subscribe(
|
||||
MeasurementService.EVENTS.JUMP_TO_MEASUREMENT,
|
||||
const { unsubscribe } = measurementService.subscribe(
|
||||
measurementService.EVENTS.JUMP_TO_MEASUREMENT,
|
||||
({ viewportIndex, measurement }) => {
|
||||
const {
|
||||
displaySetInstanceUID: referencedDisplaySetInstanceUID,
|
||||
@@ -198,7 +198,7 @@ function ViewerViewportGrid(props) {
|
||||
}
|
||||
}
|
||||
|
||||
const displaySet = DisplaySetService.getDisplaySetByUID(
|
||||
const displaySet = displaySetService.getDisplaySetByUID(
|
||||
referencedDisplaySetInstanceUID
|
||||
);
|
||||
|
||||
@@ -335,7 +335,7 @@ function ViewerViewportGrid(props) {
|
||||
const displaySets = displaySetInstanceUIDsToUse.map(
|
||||
displaySetInstanceUID => {
|
||||
return (
|
||||
DisplaySetService.getDisplaySetByUID(displaySetInstanceUID) || {}
|
||||
displaySetService.getDisplaySetByUID(displaySetInstanceUID) || {}
|
||||
);
|
||||
}
|
||||
);
|
||||
@@ -343,7 +343,7 @@ function ViewerViewportGrid(props) {
|
||||
const ViewportComponent = _getViewportComponent(
|
||||
displaySets,
|
||||
viewportComponents,
|
||||
UINotificationService
|
||||
uiNotificationService
|
||||
);
|
||||
|
||||
// look inside displaySets to see if they need reRendering
|
||||
@@ -403,7 +403,7 @@ function ViewerViewportGrid(props) {
|
||||
}, [viewports, activeViewportIndex, viewportComponents, dataSource]);
|
||||
|
||||
/**
|
||||
* Loading indicator until numCols and numRows are gotten from the HangingProtocolService
|
||||
* Loading indicator until numCols and numRows are gotten from the hangingProtocolService
|
||||
*/
|
||||
if (!numRows || !numCols) {
|
||||
return null;
|
||||
@@ -428,7 +428,7 @@ ViewerViewportGrid.defaultProps = {
|
||||
function _getViewportComponent(
|
||||
displaySets,
|
||||
viewportComponents,
|
||||
UINotificationService
|
||||
uiNotificationService
|
||||
) {
|
||||
if (!displaySets || !displaySets.length) {
|
||||
return EmptyViewport;
|
||||
@@ -453,7 +453,7 @@ function _getViewportComponent(
|
||||
}
|
||||
|
||||
console.log("Can't show displaySet", SOPClassHandlerId, displaySets[0]);
|
||||
UINotificationService.show({
|
||||
uiNotificationService.show({
|
||||
title: 'Viewport Not Supported Yet',
|
||||
message: `Cannot display SOPClassId of ${displaySets[0].SOPClassUID} yet`,
|
||||
type: 'error',
|
||||
|
||||
@@ -23,8 +23,8 @@ function defaultRouteInit(
|
||||
hangingProtocol
|
||||
) {
|
||||
const {
|
||||
DisplaySetService,
|
||||
HangingProtocolService,
|
||||
displaySetService,
|
||||
hangingProtocolService,
|
||||
} = servicesManager.services;
|
||||
|
||||
const unsubscriptions = [];
|
||||
@@ -38,7 +38,7 @@ function defaultRouteInit(
|
||||
SeriesInstanceUID
|
||||
);
|
||||
|
||||
DisplaySetService.makeDisplaySets(seriesMetadata.instances, madeInClient);
|
||||
displaySetService.makeDisplaySets(seriesMetadata.instances, madeInClient);
|
||||
}
|
||||
);
|
||||
|
||||
@@ -58,7 +58,7 @@ function defaultRouteInit(
|
||||
// until we run the hanging protocol matching service.
|
||||
|
||||
Promise.allSettled(allRetrieves).then(() => {
|
||||
const displaySets = DisplaySetService.getActiveDisplaySets();
|
||||
const displaySets = displaySetService.getActiveDisplaySets();
|
||||
|
||||
if (!displaySets || !displaySets.length) {
|
||||
return;
|
||||
@@ -84,7 +84,7 @@ function defaultRouteInit(
|
||||
|
||||
// run the hanging protocol matching on the displaySets with the predefined
|
||||
// hanging protocol in the mode configuration
|
||||
HangingProtocolService.run(
|
||||
hangingProtocolService.run(
|
||||
{ studies, activeStudy, displaySets },
|
||||
hangingProtocol
|
||||
);
|
||||
@@ -119,8 +119,8 @@ export default function ModeRoute({
|
||||
}
|
||||
|
||||
const {
|
||||
DisplaySetService,
|
||||
HangingProtocolService: hangingProtocolService,
|
||||
displaySetService,
|
||||
hangingProtocolService,
|
||||
} = servicesManager.services;
|
||||
|
||||
const { extensions, sopClassHandlers, hotkeys, hangingProtocol } = mode;
|
||||
@@ -242,7 +242,7 @@ export default function ModeRoute({
|
||||
// Extension
|
||||
|
||||
// Add SOPClassHandlers to a new SOPClassManager.
|
||||
DisplaySetService.init(extensionManager, sopClassHandlers);
|
||||
displaySetService.init(extensionManager, sopClassHandlers);
|
||||
|
||||
extensionManager.onModeEnter({
|
||||
servicesManager,
|
||||
|
||||
Reference in new issue
Block a user