|
|
@@ -381,17 +381,23 @@ export function addLMark(currentViewportId: string): void {
|
|
|
// const enabledElement = cornerstone.getEnabledElementByViewportId(currentViewportId);
|
|
|
// cursors.elementCursor.resetElementCursor(elementRef.current as HTMLDivElement);
|
|
|
}
|
|
|
-export function addRLabel(viewportId) {
|
|
|
- const toolGroup = getToolgroupByViewportId(viewportId);
|
|
|
+export function addRLabel(currentViewportId: string): void {
|
|
|
+ console.log('Adding R Mark viewport id : ', currentViewportId);
|
|
|
+ const toolGroup = getToolgroupByViewportId(currentViewportId);
|
|
|
toolGroup.setToolActive(LabelTool.toolName, {
|
|
|
- bindings: [],
|
|
|
+ bindings: [
|
|
|
+ // {
|
|
|
+ // mouseButton: MouseBindings.Primary, // Left Click
|
|
|
+ // },
|
|
|
+ ],
|
|
|
});
|
|
|
- const element = document.getElementById(viewportId);
|
|
|
- const elementHeight = element ? element.getBoundingClientRect().height : 0;
|
|
|
- const position: Types.Point3 = [100, elementHeight / 2, 0]; // Example position
|
|
|
+ // R标记相对于L标记向右偏移一些距离
|
|
|
+ const position: Types.Point3 = [300, 100, 0]; // 在L标记右侧200像素位置
|
|
|
const text = 'R'; // Predefined text
|
|
|
- LabelTool.hydrate(viewportId, position, text);
|
|
|
- toolGroup.setToolPassive(LabelTool.toolName, { removeAllBindings: true });
|
|
|
+ LabelTool.hydrate(currentViewportId, position, text);
|
|
|
+ toolGroup.setToolPassive(LabelTool.toolName, {
|
|
|
+ removeAllBindings: true,
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
export function adjustBrightnessAndContrast(currentViewportId: string) {
|