diff --git a/apps/desktop/electron/main.ts b/apps/desktop/electron/main.ts index 2cb3a11..b2d186e 100644 --- a/apps/desktop/electron/main.ts +++ b/apps/desktop/electron/main.ts @@ -39,7 +39,7 @@ const themeTitleBarStyles = { export const platform = process.platform === "darwin" ? "macos" : "windows"; app.commandLine.appendSwitch('disable-web-security'); -app.disableHardwareAcceleration() +// app.disableHardwareAcceleration() function createWindow() { win = new BrowserWindow({ diff --git a/apps/desktop/src/pages/Viewer/MprViewer/CornerstoneDicomLoader/setCtTransferFunctionForVolumeActor.ts b/apps/desktop/src/pages/Viewer/MprViewer/CornerstoneDicomLoader/setCtTransferFunctionForVolumeActor.ts index e3c5510..c7fbe7b 100644 --- a/apps/desktop/src/pages/Viewer/MprViewer/CornerstoneDicomLoader/setCtTransferFunctionForVolumeActor.ts +++ b/apps/desktop/src/pages/Viewer/MprViewer/CornerstoneDicomLoader/setCtTransferFunctionForVolumeActor.ts @@ -9,7 +9,6 @@ export interface CtTransferFunction { export default function setCtTransferFunctionForVolumeActor(p: CtTransferFunction) { const { volumeActor, defaultWindowCenter, defaultWindowWidth } = p - console.log(defaultWindowCenter, defaultWindowWidth) const lower = defaultWindowCenter - defaultWindowWidth / 2.0; const upper = defaultWindowCenter + defaultWindowWidth / 2.0; ctVoiRange = { lower, upper }; diff --git a/apps/desktop/src/pages/Viewer/index.tsx b/apps/desktop/src/pages/Viewer/index.tsx index 1340725..a24210a 100644 --- a/apps/desktop/src/pages/Viewer/index.tsx +++ b/apps/desktop/src/pages/Viewer/index.tsx @@ -47,6 +47,7 @@ const { const { MouseBindings } = csToolsEnums; const wadoRsRoot = "http://localhost:8042/dicom-web"; +const renderingEngineId = "renderEngineNo1"; const { ViewportType, OrientationAxis } = CoreEnums; const wwwl = { windowCenter: 50, windowWidth: 850 }; @@ -66,9 +67,8 @@ export const Viewer = () => { const SeriesInstanceUID = queryParams.get("SeriesInstanceUID"); const StudyInstanceUID = queryParams.get("StudyInstanceUID"); const [imageIds, setImageIds] = useState(); - const renderingEngineId = "renderEngineNo1"; const renderingEngineRef = useRef(); - const volumeRef = useRef>(); + const ts = "-" + Date.now(); // 每次都是新的volumeId useEffect(() => { cornerstoneTools.addTool(StackScrollMouseWheelTool); @@ -90,10 +90,13 @@ export const Viewer = () => { wadoRsRoot, }); // 这一步会对imageIds进行排序,如果不排序imageIds会错误乱,stackViewport顺序会错误 - volumeRef.current = await volumeLoader.createAndCacheVolume(volumeId, { - imageIds + const volume = await volumeLoader.createAndCacheVolume(volumeId + ts, { + imageIds, }); - volumeRef.current.load(); + volume.load(); + console.log("2222"); + console.log(SeriesInstanceUID); + console.log(StudyInstanceUID); const volumeViewportInput: PublicViewportInput[] = [ { @@ -142,14 +145,14 @@ export const Viewer = () => { stackViewportId ) as IStackViewport; - stackViewport.setStack(volumeRef.current.imageIds); - setImageIds(volumeRef.current.imageIds); + stackViewport.setStack(volume.imageIds); + setImageIds(volume.imageIds); await setVolumesForViewports( renderingEngineRef.current, [ { - volumeId: volumeId, + volumeId: volumeId + ts, callback: ({ volumeActor }) => setCtTransferFunctionForVolumeActor({ volumeActor, @@ -202,9 +205,8 @@ export const Viewer = () => { } // 默认windowWidtth - const { windowCenter, windowWidth } = - volumeRef.current.cornerstoneImageMetaData; - console.log("默认窗宽/位: ", windowCenter, windowWidth); + // const { windowCenter, windowWidth } = + // volumeRef.current.cornerstoneImageMetaData; }; initCornerstone(() => { @@ -221,7 +223,8 @@ export const Viewer = () => { ToolGroupManager.destroyToolGroup(toolGroupMprId); ToolGroupManager.destroyToolGroup(toolGroupStackId); - cornerstoneTools.removeTool(StackScrollMouseWheelTool);1 + cornerstoneTools.removeTool(StackScrollMouseWheelTool); + 1; cornerstoneTools.removeTool(CrosshairsTool); cornerstoneTools.removeTool(WindowLevelTool); cornerstoneTools.removeTool(ZoomTool);