You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am attempting to hide all the annotations of my PlanarFreehandROITool, using visibility.setAnnotationVisibility. Using this method successfully sets the visibility of my annotations to false, however the viewport is not updated and still shows them as visible. I make sure to refresh the volume viewport afterwards. On slack it was mentioned that it may not exist for this tool, or be implemented incorrectly. Let me know if there are any solutions!
Here is my snipped of code to set annotation visibility:
import * as csTools3d from '@cornerstonejs/tools';
import { getEnabledElements, getRenderingEngines } from '@cornerstonejs/core';
const { PlanarFreehandROITool, annotation } = csTools3d;
const { visibility } = annotation;
const viewportId = "viewport-0";
export function refreshViewport() {
const renderingEngine = getRenderingEngines()[0]
renderingEngine.renderViewport(viewportId);
}
export function toggleContours() {
const element = getEnabledElements()[0].viewport.element;
const annotationUIDs = annotation.state.getAnnotations(element, PlanarFreehandROITool.toolName);
if (annotationUIDs && annotationUIDs.length) {
annotationUIDs.forEach(annotation => {
visibility.setAnnotationVisibility(annotation.annotationUID, !annotation.isVisible);
});
refreshViewport();
}
}
The text was updated successfully, but these errors were encountered:
Upon investigation, it would seem this is because the filterAnnotationsWithinSlice method of the PlanarFreehandROITool is missing the check for annotation visibility, since it doesn't use the one from utilities.planar.filterAnnotationsWithinSlice
at line 512 of PlanarFreehandROITool there should be something like:
Hello!
I am attempting to hide all the annotations of my
PlanarFreehandROITool
, usingvisibility.setAnnotationVisibility
. Using this method successfully sets the visibility of my annotations to false, however the viewport is not updated and still shows them as visible. I make sure to refresh the volume viewport afterwards. On slack it was mentioned that it may not exist for this tool, or be implemented incorrectly. Let me know if there are any solutions!Here is my snipped of code to set annotation visibility:
The text was updated successfully, but these errors were encountered: