|
@@ -82,6 +82,18 @@ function registerTools(viewportId, renderingEngineId) {
|
|
|
toolGroup.addViewport(viewportId, renderingEngineId);
|
|
|
}
|
|
|
|
|
|
+function addRLabel(viewportId) {
|
|
|
+ toolGroup.setToolActive(LabelTool.toolName, {
|
|
|
+ bindings: [],
|
|
|
+ });
|
|
|
+ const element = document.getElementById(viewportId);
|
|
|
+ const elementHeight = element ? element.getBoundingClientRect().height : 0;
|
|
|
+ const position: Types.Point3 = [100, elementHeight / 2, 0]; // Example position
|
|
|
+ const text = 'R'; // Predefined text
|
|
|
+ LabelTool.hydrate(viewportId, position, text);
|
|
|
+ toolGroup.setToolPassive(LabelTool.toolName, { removeAllBindings: true });
|
|
|
+}
|
|
|
+
|
|
|
const StackViewer = ({ imageIndex }) => {
|
|
|
const elementRef = useRef<HTMLDivElement>(null);
|
|
|
const action = useSelector((state: RootState) => state.functionArea.action);
|
|
@@ -177,6 +189,7 @@ const StackViewer = ({ imageIndex }) => {
|
|
|
break;
|
|
|
case 'Add R Mark':
|
|
|
// Implement the logic to add an R mark
|
|
|
+ addRLabel(currentViewportId);
|
|
|
console.log('Adding R Mark');
|
|
|
break;
|
|
|
case 'Delete Selected Mark':
|