Closed matowuut closed 5 months ago
+1 We are having the same problem.
https://github.com/OHIF/Viewers/issues/3848#issuecomment-1850142939
I tried by setting Reference Lines as the defaultTool in modes\longitudinal\src\index.js. ReferenceLine is enabled by default with this. However, keep getting this error when I try to click on the ViewPort to toggle Reference Line.
Managed to resolve this issue by modifying this file in build folder\extensions\cornerstone\src\init.tsx by adding this code:
function elementEnabledHandler(evt) {
const { element } = evt.detail;
element.addEventListener(EVENTS.CAMERA_RESET, resetCrosshairs);
eventTarget.addEventListener(EVENTS.STACK_VIEWPORT_NEW_STACK, toolbarEventListener);
initViewTiming({ element, eventTarget });
var ReferenceLinesButton=document.querySelector('.flex.flex-row.justify-between.items-center.bg-indigo-dark.cursor-pointer[data-cy="ReferenceLines"]');
if(ReferenceLinesButton!=null)
{
ReferenceLinesButton.click();
}
}
and then rebuilding. It is a hack but it works as expected.
I think I have a better fix, will push soon
We just release the OHIF 3.8, you can find more details here https://ohif.org/release-notes/3p8/ If you still encounter this issue in 3.8, please re-open this.
Describe the Bug
I am trying to enable the Reference Line tool on viewer initialization/start without having to click on it to activate it.
I was able to enable the reference line tool in root folder\modes\longitudinal\src\initToolGroups.js by moving the reference line code from disabled section to enabled section ->
enabled: [{ toolName: toolNames.ReferenceLines }],
But this option just enables the reference line button to be visible not activated.
What i tried:
Moving the reference line tool to active section -> same result, button visible but function not activated Moving the reference line tool to passive section -> same result, button visible but function not activated
This is the file and the locations that I modified:
What i am wondering is due to lack of documentation on how to enable or disable tools from start, am i using this wrong or is this a bug and under active section it should be activated?
Steps to Reproduce
The current behavior
Reference Lines button is not activated from the start
The expected behavior
Reference Lines button to be activated from the start
OS
Windows 10
Node version
16.20.2
Browser
Firefox 120.0