Compare commits

..

No commits in common. "a0f4ca2f3a50ea68f7491e6efb64e94e3895117a" and "7291840ed86dd73993c409860889cc5b79ad47d3" have entirely different histories.

2 changed files with 11 additions and 14 deletions

View File

@ -7,7 +7,7 @@ export const initCornerstoneDICOMImageLoader = () => {
cornerstone.getConfiguration().rendering; cornerstone.getConfiguration().rendering;
console.log("dddd", cornerstone.getConfiguration().rendering); console.log("dddd", cornerstone.getConfiguration().rendering);
cornerstone.setUseSharedArrayBuffer(false); cornerstone.setUseSharedArrayBuffer(true);
cornerstone.setConfiguration({ cornerstone.setConfiguration({
detectGPUConfig: { detectGPUConfig: {
// benchmarksURL: "http://localhost:9000", // benchmarksURL: "http://localhost:9000",

View File

@ -13,7 +13,6 @@ import {
setVolumesForViewports, setVolumesForViewports,
volumeLoader, volumeLoader,
Enums as CoreEnums, Enums as CoreEnums,
cache,
} from "@cornerstonejs/core"; } from "@cornerstonejs/core";
import { import {
IStackViewport, IStackViewport,
@ -28,6 +27,7 @@ import {
viewportId1, viewportId1,
viewportId2, viewportId2,
viewportId3, viewportId3,
volumeId,
} from "./MprViewer/index.config"; } from "./MprViewer/index.config";
import setCtTransferFunctionForVolumeActor from "./MprViewer/CornerstoneDicomLoader/setCtTransferFunctionForVolumeActor"; import setCtTransferFunctionForVolumeActor from "./MprViewer/CornerstoneDicomLoader/setCtTransferFunctionForVolumeActor";
import { Slider } from "@/components/ui/slider"; import { Slider } from "@/components/ui/slider";
@ -68,7 +68,7 @@ export const Viewer = () => {
const StudyInstanceUID = queryParams.get("StudyInstanceUID"); const StudyInstanceUID = queryParams.get("StudyInstanceUID");
const [imageIds, setImageIds] = useState<string[]>(); const [imageIds, setImageIds] = useState<string[]>();
const renderingEngineRef = useRef<RenderingEngine>(); const renderingEngineRef = useRef<RenderingEngine>();
const volumeId = SeriesInstanceUID; const ts = "-" + Date.now(); // 每次都是新的volumeId
useEffect(() => { useEffect(() => {
cornerstoneTools.addTool(StackScrollMouseWheelTool); cornerstoneTools.addTool(StackScrollMouseWheelTool);
@ -90,13 +90,13 @@ export const Viewer = () => {
wadoRsRoot, wadoRsRoot,
}); });
// 这一步会对imageIds进行排序如果不排序imageIds会错误乱,stackViewport顺序会错误 // 这一步会对imageIds进行排序如果不排序imageIds会错误乱,stackViewport顺序会错误
const volume = await volumeLoader.createAndCacheVolume( const volume = await volumeLoader.createAndCacheVolume(volumeId + ts, {
SeriesInstanceUID,
{
imageIds, imageIds,
} });
);
volume.load(); volume.load();
console.log("2222");
console.log(SeriesInstanceUID);
console.log(StudyInstanceUID);
const volumeViewportInput: PublicViewportInput[] = [ const volumeViewportInput: PublicViewportInput[] = [
{ {
@ -152,7 +152,7 @@ export const Viewer = () => {
renderingEngineRef.current, renderingEngineRef.current,
[ [
{ {
volumeId: SeriesInstanceUID, volumeId: volumeId + ts,
callback: ({ volumeActor }) => callback: ({ volumeActor }) =>
setCtTransferFunctionForVolumeActor({ setCtTransferFunctionForVolumeActor({
volumeActor, volumeActor,
@ -223,16 +223,13 @@ export const Viewer = () => {
ToolGroupManager.destroyToolGroup(toolGroupMprId); ToolGroupManager.destroyToolGroup(toolGroupMprId);
ToolGroupManager.destroyToolGroup(toolGroupStackId); ToolGroupManager.destroyToolGroup(toolGroupStackId);
cache.purgeCache();
console.log(cache.getVolume(volumeId!));
cornerstoneTools.removeTool(StackScrollMouseWheelTool); cornerstoneTools.removeTool(StackScrollMouseWheelTool);
1; 1;
cornerstoneTools.removeTool(CrosshairsTool); cornerstoneTools.removeTool(CrosshairsTool);
cornerstoneTools.removeTool(WindowLevelTool); cornerstoneTools.removeTool(WindowLevelTool);
cornerstoneTools.removeTool(ZoomTool); cornerstoneTools.removeTool(ZoomTool);
}; };
}, [SeriesInstanceUID, StudyInstanceUID, volumeId]); }, [SeriesInstanceUID, StudyInstanceUID]);
const onChangeIndex = (value: number[]) => { const onChangeIndex = (value: number[]) => {
setIndex(value[0]); setIndex(value[0]);