|
@@ -194,6 +194,19 @@ const StackViewer = ({ imageIndex }) => {
|
|
|
break;
|
|
|
case 'Delete Selected Mark':
|
|
|
// Implement the logic to delete the selected mark
|
|
|
+ const viewport = cornerstone.getEnabledElementByViewportId(currentViewportId).viewport;
|
|
|
+ const allAnnotations = cornerstoneTools.annotation.state.getAllAnnotations();
|
|
|
+ // const allAnnotations = cornerstoneTools.annotation.state.getAnnotations(LabelTool.toolName, element.element);
|
|
|
+ console.log(`allAnnotations 数量:${allAnnotations.length}`);
|
|
|
+ for (const annotation of allAnnotations) {
|
|
|
+ if (annotation.data.text === 'L' || annotation.data.text === 'R') {
|
|
|
+ console.log(`Deleting annotation with UID: ${annotation.annotationUID}`);
|
|
|
+ cornerstoneTools.annotation.state.removeAnnotation(annotation.annotationUID!);
|
|
|
+ }
|
|
|
+ // cornerstoneTools.annotation.state.removeAnnotation(annotation.annotationUID!);
|
|
|
+ }
|
|
|
+ // 触发视口重新渲染
|
|
|
+ viewport.render();
|
|
|
console.log('Deleting Selected Mark');
|
|
|
break;
|
|
|
case 'Horizontal Flip':
|