Base tools are not accessible to cornerstoneTools consumers
See original GitHub issuePrerequisites
- 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:
- Created 5 years ago
- Reactions:1
- Comments:6 (6 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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.
@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.