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:
const tools = {
active: [
{
toolName: toolNames.WindowLevel,
bindings: [{ mouseButton: Enums.MouseBindings.Primary }],
},
{
toolName: toolNames.Pan,
bindings: [{ mouseButton: Enums.MouseBindings.Auxiliary }],
},
{
toolName: toolNames.Zoom,
bindings: [{ mouseButton: Enums.MouseBindings.Secondary }],
},
{ toolName: toolNames.StackScrollMouseWheel, bindings: [] },
//{ toolName: toolNames.ReferenceLines, bindings: [] }, -> tried inserting here but failed, same result as enabled section
],
passive: [
{ toolName: toolNames.Length },
{
toolName: toolNames.ArrowAnnotate,
configuration: {
getTextCallback: (callback, eventDetails) =>
commandsManager.runCommand('arrowTextCallback', {
callback,
eventDetails,
}),
changeTextCallback: (data, eventDetails, callback) =>
commandsManager.runCommand('arrowTextCallback', {
callback,
data,
eventDetails,
}),
},
},
{ toolName: toolNames.Bidirectional },
{ toolName: toolNames.DragProbe },
{ toolName: toolNames.EllipticalROI },
{ toolName: toolNames.CircleROI },
{ toolName: toolNames.RectangleROI },
{ toolName: toolNames.StackScroll },
{ toolName: toolNames.Angle },
{ toolName: toolNames.CobbAngle },
{ toolName: toolNames.PlanarFreehandROI },
{ toolName: toolNames.Magnify },
{ toolName: toolNames.SegmentationDisplay },
{ toolName: toolNames.CalibrationLine },
// { toolName: toolNames.ReferenceLines }, -> tried inserting here but failed, same result as enabled section
],
enabled: [{ toolName: toolNames.ImageOverlayViewer }],
//enabled: [{ toolName: toolNames.ReferenceLines }],
};
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
- Download Ohif Viewer 3.8 beta 25
- Modify \modes\longitudinal\src\initToolGroups.js so that reference lines are under active or passive
- Build for production with yarn install, yarn run build
- Nothing happens the result is always the same “Reference Lines” button is visible but never active from the start