|
@@ -33,11 +33,11 @@ import { EVENTS } from '@cornerstonejs/core';
|
|
|
import { useSelector, useDispatch } from 'react-redux';
|
|
import { useSelector, useDispatch } from 'react-redux';
|
|
|
import { selectOverlayEnabled } from '@/states/view/dicomOverlaySlice';
|
|
import { selectOverlayEnabled } from '@/states/view/dicomOverlaySlice';
|
|
|
import { initPlayback, setFrameDetectionResult } from '@/states/view/playbackSlice';
|
|
import { initPlayback, setFrameDetectionResult } from '@/states/view/playbackSlice';
|
|
|
-import {
|
|
|
|
|
- startLoading,
|
|
|
|
|
- updateLoadingProgress,
|
|
|
|
|
|
|
+import {
|
|
|
|
|
+ startLoading,
|
|
|
|
|
+ updateLoadingProgress,
|
|
|
completeLoading,
|
|
completeLoading,
|
|
|
- selectViewportLoadingInfo
|
|
|
|
|
|
|
+ selectViewportLoadingInfo
|
|
|
} from '@/states/view/imageLoadingSlice';
|
|
} from '@/states/view/imageLoadingSlice';
|
|
|
import PolygonLengthMeasurementTool from '@/components/measures/PolygonLengthMeasurementTool';
|
|
import PolygonLengthMeasurementTool from '@/components/measures/PolygonLengthMeasurementTool';
|
|
|
import PolylineLengthMeasurementTool from '@/components/measures/PolylineLengthMeasurementTool';
|
|
import PolylineLengthMeasurementTool from '@/components/measures/PolylineLengthMeasurementTool';
|
|
@@ -373,12 +373,12 @@ function setupDefaultToolStates(toolGroup: cornerstoneTools.Types.IToolGroup) {
|
|
|
}
|
|
}
|
|
|
export function addLMark(currentViewportId: string): void {
|
|
export function addLMark(currentViewportId: string): void {
|
|
|
// 使用专门的文本标记工具管理器
|
|
// 使用专门的文本标记工具管理器
|
|
|
- TextAnnotationToolManager.activateTextAnnotationTool(currentViewportId, 'L',[100,100]);
|
|
|
|
|
|
|
+ TextAnnotationToolManager.activateTextAnnotationTool(currentViewportId, 'L', [100, 100]);
|
|
|
}
|
|
}
|
|
|
export function addRLabel(currentViewportId: string): void {
|
|
export function addRLabel(currentViewportId: string): void {
|
|
|
console.log('Adding R Mark viewport id : ', currentViewportId);
|
|
console.log('Adding R Mark viewport id : ', currentViewportId);
|
|
|
//todo 初始坐标可能需要结合业务和界面大小动态调整
|
|
//todo 初始坐标可能需要结合业务和界面大小动态调整
|
|
|
- TextAnnotationToolManager.activateTextAnnotationTool(currentViewportId, 'R',[900,100]);
|
|
|
|
|
|
|
+ TextAnnotationToolManager.activateTextAnnotationTool(currentViewportId, 'R', [900, 100]);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@@ -438,10 +438,12 @@ export function deleteSelectedMark(currentViewportId: string): void {
|
|
|
|
|
|
|
|
// 删除所有 LabelTool 创建的标记(包括 L/R 标记、预定义标记、自定义标记、时间戳标记)
|
|
// 删除所有 LabelTool 创建的标记(包括 L/R 标记、预定义标记、自定义标记、时间戳标记)
|
|
|
for (const annotation of allAnnotations) {
|
|
for (const annotation of allAnnotations) {
|
|
|
- if (annotation.metadata?.toolName === LabelTool.toolName) {
|
|
|
|
|
- cornerstoneTools.annotation.state.removeAnnotation(
|
|
|
|
|
- annotation.annotationUID!
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ if (annotation.metadata?.toolName === TextAnnotationTool.toolName) {
|
|
|
|
|
+ if (annotation.isSelected) {
|
|
|
|
|
+ cornerstoneTools.annotation.state.removeAnnotation(
|
|
|
|
|
+ annotation.annotationUID!
|
|
|
|
|
+ );
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -492,7 +494,7 @@ export function addCustomMark(currentViewportId: string, text: string): void {
|
|
|
const { width, height } = element.getBoundingClientRect();
|
|
const { width, height } = element.getBoundingClientRect();
|
|
|
const canvasPoint: Types.Point2 = [width / 2, height / 2];
|
|
const canvasPoint: Types.Point2 = [width / 2, height / 2];
|
|
|
|
|
|
|
|
- TextAnnotationToolManager.activateTextAnnotationTool(currentViewportId, text,canvasPoint);
|
|
|
|
|
|
|
+ TextAnnotationToolManager.activateTextAnnotationTool(currentViewportId, text, canvasPoint);
|
|
|
|
|
|
|
|
console.log(`Custom mark "${text}" added successfully`);
|
|
console.log(`Custom mark "${text}" added successfully`);
|
|
|
}
|
|
}
|
|
@@ -1919,7 +1921,7 @@ const StackViewer = ({
|
|
|
loadedCount++;
|
|
loadedCount++;
|
|
|
const newProgress = Math.round((loadedCount / finalImageUrls.length) * 100);
|
|
const newProgress = Math.round((loadedCount / finalImageUrls.length) * 100);
|
|
|
console.log(`[StackViewer] 图像加载进度: ${loadedCount}/${finalImageUrls.length} (${newProgress}%)`);
|
|
console.log(`[StackViewer] 图像加载进度: ${loadedCount}/${finalImageUrls.length} (${newProgress}%)`);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
dispatch(updateLoadingProgress({
|
|
dispatch(updateLoadingProgress({
|
|
|
viewportId,
|
|
viewportId,
|
|
|
loadedCount,
|
|
loadedCount,
|