feat(tmtv-mode): Add Brush tools and move SUV peak calculation to web worker (#4053)

This commit is contained in:
Alireza authored and GitHub committed 2024-04-19 15:11:31 -04:00
1 parent 8c5ab942b9
commit 8192e348ec
27 files changed
+593 -212

No files matched your search

+5 -5
View File
@@ -38,7 +38,7 @@
"@cornerstonejs/codec-libjpeg-turbo-8bit": "^1.2.2",
"@cornerstonejs/codec-openjpeg": "^1.2.2",
"@cornerstonejs/codec-openjph": "^2.4.2",
"@cornerstonejs/dicom-image-loader": "^1.70.9",
"@cornerstonejs/dicom-image-loader": "^1.70.10",
"@icr/polyseg-wasm": "^0.4.0",
"@ohif/core": "3.8.0-beta.86",
"@ohif/ui": "3.8.0-beta.86",
@@ -55,10 +55,10 @@
},
"dependencies": {
"@babel/runtime": "^7.20.13",
"@cornerstonejs/adapters": "^1.70.9",
"@cornerstonejs/core": "^1.70.9",
"@cornerstonejs/streaming-image-volume-loader": "^1.70.9",
"@cornerstonejs/tools": "^1.70.9",
"@cornerstonejs/adapters": "^1.70.10",
"@cornerstonejs/core": "^1.70.10",
"@cornerstonejs/streaming-image-volume-loader": "^1.70.10",
"@cornerstonejs/tools": "^1.70.10",
"@icr/polyseg-wasm": "^0.4.0",
"@kitware/vtk.js": "30.3.3",
"html2canvas": "^1.4.1",
+2 -2
View File
@@ -346,9 +346,9 @@ function commandsModule({
}
}
},
setToolActiveToolbar: ({ value, itemId, toolGroupIds = [] }) => {
setToolActiveToolbar: ({ value, itemId, toolName, toolGroupIds = [] }) => {
// Sometimes it is passed as value (tools with options), sometimes as itemId (toolbar buttons)
const toolName = itemId || value;
toolName = toolName || itemId || value;
toolGroupIds = toolGroupIds.length ? toolGroupIds : toolGroupService.getToolGroupIds();
@@ -2,10 +2,12 @@ import { getWebWorkerManager } from '@cornerstonejs/core';
const workerManager = getWebWorkerManager();
const options = {
// maxWorkerInstances: 1,
// overwrite: false
autoTerminationOnIdle: 1000,
const WorkerOptions = {
maxWorkerInstances: 1,
autoTerminateOnIdle: {
enabled: true,
idleTimeThreshold: 1000,
},
};
// Register the task
@@ -15,9 +17,9 @@ const workerFn = () => {
});
};
workerManager.registerWorker('histogram-worker', workerFn, options);
const getViewportVolumeHistogram = async (viewport, volume, options?) => {
workerManager.registerWorker('histogram-worker', workerFn, WorkerOptions);
if (!volume?.loadStatus.loaded) {
return undefined;
}
+11 -12
View File
@@ -279,19 +279,18 @@ export default async function init({
eventTarget.addEventListener(EVENTS.ELEMENT_DISABLED, elementDisabledHandler.bind(null));
colormaps.forEach(registerColormap);
// Create a debounced function that shows the notification
const debouncedShowNotification = debounce(detail => {
uiNotificationService.show({
title: detail.type,
message: detail.message,
type: 'error',
});
}, 300);
// Event listener
eventTarget.addEventListener(EVENTS.ERROR_EVENT, ({ detail }) => {
debouncedShowNotification(detail);
});
eventTarget.addEventListenerDebounced(
EVENTS.ERROR_EVENT,
({ detail }) => {
uiNotificationService.show({
title: detail.type,
message: detail.message,
type: 'error',
});
},
1000
);
}
function CPUModal() {