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:
Bill WallaceandAlireza authored and GitHub committed 2023-02-10 16:46:09 -05:00
1 parent a97fb2fc9a
commit 8af0362d12
97 files changed
+934 -908

No files matched your search

+26 -26
View File
@@ -20,13 +20,13 @@ const commandsModule = ({
extensionManager,
}) => {
const {
ViewportGridService,
UINotificationService,
DisplaySetService,
HangingProtocolService,
ToolGroupService,
CornerstoneViewportService,
SegmentationService,
viewportGridService,
uiNotificationService,
displaySetService,
hangingProtocolService,
toolGroupService,
cornerstoneViewportService,
segmentationService,
} = servicesManager.services;
const utilityModule = extensionManager.getModuleEntry(
@@ -36,14 +36,14 @@ const commandsModule = ({
const { getEnabledElement } = utilityModule.exports;
function _getActiveViewportsEnabledElement() {
const { activeViewportIndex } = ViewportGridService.getState();
const { activeViewportIndex } = viewportGridService.getState();
const { element } = getEnabledElement(activeViewportIndex) || {};
const enabledElement = cs.getEnabledElement(element);
return enabledElement;
}
function _getMatchedViewportsToolGroupIds() {
const { viewportMatchDetails } = HangingProtocolService.getMatchDetails();
const { viewportMatchDetails } = hangingProtocolService.getMatchDetails();
const toolGroupIds = [];
viewportMatchDetails.forEach((value, key) => {
const { viewportOptions } = value;
@@ -67,7 +67,7 @@ const commandsModule = ({
for (const [viewportIndex, viewportDetails] of viewportMatchDetails) {
const { displaySetsInfo } = viewportDetails;
const displaySets = displaySetsInfo.map(({ displaySetInstanceUID }) =>
DisplaySetService.getDisplaySetByUID(displaySetInstanceUID)
displaySetService.getDisplaySetByUID(displaySetInstanceUID)
);
if (!displaySets || displaySets.length === 0) {
@@ -121,17 +121,17 @@ const commandsModule = ({
createNewLabelmapFromPT: async () => {
// Create a segmentation of the same resolution as the source data
// using volumeLoader.createAndCacheDerivedVolume.
const { viewportMatchDetails } = HangingProtocolService.getMatchDetails();
const { viewportMatchDetails } = hangingProtocolService.getMatchDetails();
const ptDisplaySet = actions.getMatchingPTDisplaySet({
viewportMatchDetails,
});
if (!ptDisplaySet) {
UINotificationService.error('No matching PT display set found');
uiNotificationService.error('No matching PT display set found');
return;
}
const segmentationId = await SegmentationService.createSegmentationForDisplaySet(
const segmentationId = await segmentationService.createSegmentationForDisplaySet(
ptDisplaySet.displaySetInstanceUID
);
@@ -142,14 +142,14 @@ const commandsModule = ({
for (const toolGroupId of toolGroupIds) {
const hydrateSegmentation = true;
await SegmentationService.addSegmentationRepresentationToToolGroup(
await segmentationService.addSegmentationRepresentationToToolGroup(
toolGroupId,
segmentationId,
hydrateSegmentation,
representationType
);
SegmentationService.setActiveSegmentationForToolGroup(
segmentationService.setActiveSegmentationForToolGroup(
segmentationId,
toolGroupId
);
@@ -161,7 +161,7 @@ const commandsModule = ({
const toolGroupIds = _getMatchedViewportsToolGroupIds();
toolGroupIds.forEach(toolGroupId => {
SegmentationService.setActiveSegmentationForToolGroup(
segmentationService.setActiveSegmentationForToolGroup(
segmentationId,
toolGroupId
);
@@ -193,7 +193,7 @@ const commandsModule = ({
);
if (annotationUIDs.length === 0) {
UINotificationService.show({
uiNotificationService.show({
title: 'Commands Module',
message: 'No ROIThreshold Tool is Selected',
type: 'error',
@@ -289,7 +289,7 @@ const commandsModule = ({
},
calculateTMTV: ({ segmentations }) => {
const labelmaps = segmentations.map(s =>
SegmentationService.getLabelmapVolume(s.id)
segmentationService.getLabelmapVolume(s.id)
);
if (!labelmaps.length) {
@@ -314,7 +314,7 @@ const commandsModule = ({
},
getTotalLesionGlycolysis: ({ segmentations }) => {
const labelmapVolumes = segmentations.map(s =>
SegmentationService.getLabelmapVolume(s.id)
segmentationService.getLabelmapVolume(s.id)
);
let mergedLabelmap;
@@ -448,7 +448,7 @@ const commandsModule = ({
},
getSegmentationCSVReport: ({ segmentations }) => {
if (!segmentations || !segmentations.length) {
segmentations = SegmentationService.getSegmentations();
segmentations = segmentationService.getSegmentations();
}
let report = {};
@@ -474,7 +474,7 @@ const commandsModule = ({
}
});
const labelmapVolume = SegmentationService.getLabelmapVolume(id);
const labelmapVolume = segmentationService.getLabelmapVolume(id);
if (!labelmapVolume) {
report[id] = segReport;
@@ -484,7 +484,7 @@ const commandsModule = ({
const referencedVolumeId = labelmapVolume.referencedVolumeId;
segReport.referencedVolumeId = referencedVolumeId;
const referencedVolume = SegmentationService.getLabelmapVolume(
const referencedVolume = segmentationService.getLabelmapVolume(
referencedVolumeId
);
@@ -525,8 +525,8 @@ const commandsModule = ({
dicomRTAnnotationExport(annotations);
},
setFusionPTColormap: ({ toolGroupId, colormap }) => {
const toolGroup = ToolGroupService.getToolGroup(toolGroupId);
const { viewportMatchDetails } = HangingProtocolService.getMatchDetails();
const toolGroup = toolGroupService.getToolGroup(toolGroupId);
const { viewportMatchDetails } = hangingProtocolService.getMatchDetails();
const ptDisplaySet = actions.getMatchingPTDisplaySet({
viewportMatchDetails,
@@ -540,7 +540,7 @@ const commandsModule = ({
let viewports = [];
fusionViewportIds.forEach(viewportId => {
const viewportInfo = CornerstoneViewportService.getViewportInfo(
const viewportInfo = cornerstoneViewportService.getViewportInfo(
viewportId
);
@@ -552,7 +552,7 @@ const commandsModule = ({
});
viewports.push(
CornerstoneViewportService.getCornerstoneViewport(viewportId)
cornerstoneViewportService.getCornerstoneViewport(viewportId)
);
});