跳到主要内容

选择

标注可以被选中和取消选中。默认做法是按住 Shift 键并点击标注。

API​

选中与取消选中标注有多个 API,另有相应的 get / set 方法:

import { annotation } from '@cornerstonejs/tools';

// 选中某个标注
annotation.selection.setAnnotationSelected(
annotationUID,
(selected = true),
(preserveSelected = false)
);

// 取得所有已选中的标注
annotation.selection.getAnnotationsSelected();

// 取得某个特定工具下所有已选中的标注
annotation.selection.getAnnotationsSelectedByToolName(toolName);

延伸阅读​

TIP

关于选择 API 的更多内容见这里