question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Base tools are not accessible to cornerstoneTools consumers

See original GitHub issue

Prerequisites

  • Are you running the latest version?
  • Are you reporting to the correct repository?
  • Did you perform a cursory search?

Description

The base tool classes (BaseAnnotationTool, BaseBrushTool, BaseTool) are not exported in index.js. This makes it really awkward to create custom tools as a consumer of cornerstoneTools.

Steps to Reproduce

n/a

Expected behavior: [What you expected to happen]

Should be able to import base tools as a 3rd partly or consumer of the library.

import { BaseAnnotationTool } from 'cornerstoneTools';
class MyCustomTool extends BaseAnnotationTool {
   // ...
}

Actual behavior: [What actually happened]

It’s nasty, you need to dig though the prototype chain to find a BaseTool class. I’m sure this is just an oversight.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
dannyrbcommented, Mar 6, 2019

@mikehazell, we’re very open to alternatives and other opinions. In particular, if you’re aware of OSS projects that have plugins, extensions, modules, etc. I would enjoy taking a peak at their solutions so we can learn from them.

0reactions
dannyrbcommented, Mar 17, 2019

@mikehazell, I’m going to close this for now based on the discussion we’ve had. Please feel free to create a separate issue for updating the documents as an alternative solution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to add a custom tool to viewport · Issue #63 - GitHub
Hi, I'm experimenting to create a custom tool and add it to the viewport. But it shows "Unable to add tool with name...
Read more >
Cornerstone Tools not loading built in tools - Stack Overflow
Im answering my own question here, I switched to imports and redid some of the code. the following seems to work fine so...
Read more >
How to use the cornerstone-tools.wwwc function in ... - Snyk
To help you get started, we've selected a few cornerstone-tools examples, based on popular ways it is used in public projects. Secure your...
Read more >
Custom Tools
BaseTool. The BaseTool is the fundamental base class, with just the functionality required to function within the Cornerstone Tools framework.
Read more >
Questions about Cornerstone, Tools, Layouts and More
I have previously worked on a project developing a non-Javascript based DICOM Viewer and my team and I have been waiting for a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found