Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cornerstonejs/cornerstonetools
[Deprecated] Use Cornerstone3D Instead https://cornerstonejs.org/
https://github.com/cornerstonejs/cornerstonetools
cornerstone dicom hacktoberfest javascript medical-imaging nci-itcr
Last synced: 3 days ago
JSON representation
[Deprecated] Use Cornerstone3D Instead https://cornerstonejs.org/
- Host: GitHub
- URL: https://github.com/cornerstonejs/cornerstonetools
- Owner: cornerstonejs
- License: mit
- Created: 2014-04-03T15:30:55.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2024-07-15T10:11:10.000Z (6 months ago)
- Last Synced: 2024-12-31T19:07:51.665Z (3 days ago)
- Topics: cornerstone, dicom, hacktoberfest, javascript, medical-imaging, nci-itcr
- Language: JavaScript
- Homepage:
- Size: 63.5 MB
- Stars: 581
- Watchers: 55
- Forks: 456
- Open Issues: 275
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Citation: CITATION.cff
Awesome Lists containing this project
README
## ππππ Attention: Cornerstone.js has evolved! We're excited to introduce [Cornerstone3D](https://github.com/cornerstonejs/cornerstone3D) π. Expect advanced rendering, stellar performance, and a modern toolset. π Navigate to the new repository for the latest updates and improvements.
cornerstone-tools
Provides a simple, extensible framework for creating tools on top of Cornerstone.js. Includes common tool implementations, and leverages DICOM metadata (when available) for advanced functionality.
[**Read The Docs**](https://tools.cornerstonejs.org/) | [Edit the docs](https://github.com/cornerstonejs/cornerstoneTools/edit/master/docs/)
[![Build Status][build-badge]][build]
[![Coverage Status][coverage-badge]][coverage]
[![All Contributors](https://img.shields.io/badge/all_contributors-37-orange.svg?style=flat-square)](#contributors)[![NPM version][npm-version-image]][npm-url]
[![NPM downloads][npm-downloads-image]][npm-url]
[![MIT License][license-image]][license-url]## Index
### The Fun Stuff
- [TOOL EXAMPLES](https://tools.cornerstonejs.org/examples/)
- [Create or Update an Example](https://github.com/cornerstonejs/cornerstoneTools/tree/master/examples)### Everything Else
- [Installing](#installation)
- [Examples & Docs](#examples--docs)
- [Contributing][contributing]## The problem
Building one or two tools on top of [Cornerstone.js](https://github.com/cornerstonejs/cornerstone/) is not that difficult. However, as the number of tools grow, you begin to encounter difficult problems:
- Tools should behave and be configurable in a consistant way
- Managing tools across multiple cornerstone `enabled element`s
- Tools that need knowledge of a fellow tool's state
- The ability to "drop-in" others' tools, and they "just work"
- and many othersThis library solves these problems in a highly pluggable and extensible way.
## This solution
`cornerstone-tools` is a light-weight solution for building Tools on top of Cornerstone.js. It's only dependencies are libraries within the Cornerstone family. Instead of trying to "do everything" it aims to be extensible and pluggable to aid in the rapid development of new tools. Ideally, tools created using `cornerstone-tools` can be easily shared, allowing for the creation of a broader ecosystem.
## Example
Below is a simplified example of creating a tool by extending `cornerstone-tool`'s `BaseTool` class.
```javascript
import cornerstone from 'cornerstone-core';
import { BaseTool } from 'cornerstone-tools';
import basicLevelingStrategy from '...';export default class WwwcTool extends BaseTool {
constructor(configuration = {}) {
const defaultConfig = {
name: 'Wwwc',
strategies: { basicLevelingStrategy },
supportedInteractionTypes: ['Mouse', 'Touch'],
configuration: {
orientation: 0,
},
};
const initialConfiguration = Object.assign(defaultConfig, configuration);super(initialConfiguration);
}mouseDragCallback(evt) {
this.applyActiveStrategy(evt);cornerstone.setViewport(evt.detail.element, evt.detail.viewport);
}touchDragCallback(evt) {
evt.stopImmediatePropagation();
this.applyActiveStrategy(evt);cornerstone.setViewport(evt.detail.element, evt.detail.viewport);
}
}
```## Installation
This module is distributed via [npm][npm-url] which is bundled with [node][node] and
should be installed as one of your project's `dependencies`:```js
// To install the newest version
npm install --save cornerstone-tools// To install the legacy version (2.4.x branch)
npm install --save cornerstone-tools@2
```This library has `peerDependencies` listings for:
- `hammerjs` - Better touch support
- `cornerstone-core`
- `cornerstone-math` - Simplifies and provides shared complex tool math logic
- Any Cornerstone "Image Loader"
- `cornerstone-web-image-loader` - JPEG/PNG images
- `cornerstone-wado-image-loader` - DICOM images; also parses tags for tool useIf you need to support the `IE11` Browser, you will need to provide polyfills as needed. Our BrowserList target:
```json
"browserslist": [
"> 1%",
"IE 11",
"not dead",
"not IE < 11",
"not op_mini all"
]
```**Setting up and configuring `cornerstone-tools`'s depency can be the biggest hurdle to getting started. Be sure to check out our docs for assistance.**
> [**Docs**](https://tools.cornerstonejs.org/installation.html)
## Examples & Docs
> The latest major version has just been published. We are still flushing out our examples. If you have anything you would like to see documented, or you want a specific example from [version 2][version-2] ported, either create an issue or make a pull request ^\_^
- [Documentation](https://tools.cornerstonejs.org)
- [Examples](https://tools.cornerstonejs.org/examples)
- [API](https://tools.cornerstonejs.org/api)### Tools
#### Annotation Tools
- [Angle](https://tools.cornerstonejs.org/examples/tools/angle.html)
- [Elliptical ROI](https://tools.cornerstonejs.org/examples/tools/elliptical-roi.html)
- [Length](https://tools.cornerstonejs.org/examples/tools/length.html)
- [Rectangle ROI](https://tools.cornerstonejs.org/examples/tools/rectangle-roi.html)#### 3rd Party Tool Plugins
- Image Statistics: [Source](https://github.com/QSolutionsLLC/cornerstone-tool-image-statistics) | [Demo](https://qsolutionsllc.github.io/cornerstone-tool-image-statistics/)
- Rotated Elliptical ROI Tool: [Source](https://github.com/sisobus/cornerstoneTools-RotatedEllipticalRoiTool) | [Demo](https://examples.sisobus.com/rotated-elliptical-roi/)A huge thanks to tool authors, like @sisobus, for sharing their work with the community!
## Other Solutions
- OHIF Viewer: [Source][ohif-source] | [Demo][ohif-demo]
## Contributors
Thanks goes to these people ([emoji key][emojis]):
| [
Chris Hafey](https://www.linkedin.com/in/chafey)
[π](https://github.com/cornerstonejs/cornerstoneTools/commits?author=chafey "Documentation") [π»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=chafey "Code") [π](#blog-chafey "Blogposts") [π’](#talk-chafey "Talks") | [
Erik Ziegler](https://github.com/swederik)
[π»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=swederik "Code") [π](https://github.com/cornerstonejs/cornerstoneTools/commits?author=swederik "Documentation") [π](#review-swederik "Reviewed Pull Requests") [π§](#maintenance-swederik "Maintenance") [π](#infra-swederik "Infrastructure (Hosting, Build-Tools, etc)") [π¬](#question-swederik "Answering Questions") | [
Danny Brown](http://dannyrb.com/)
[π»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=dannyrb "Code") [π](https://github.com/cornerstonejs/cornerstoneTools/commits?author=dannyrb "Documentation") [π](#review-dannyrb "Reviewed Pull Requests") [π§](#maintenance-dannyrb "Maintenance") [π](#infra-dannyrb "Infrastructure (Hosting, Build-Tools, etc)") [π](#plugin-dannyrb "Plugin/utility libraries") [π¬](#question-dannyrb "Answering Questions") | [
James Petts](https://github.com/JamesAPetts)
[π»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=JamesAPetts "Code") [π](#review-JamesAPetts "Reviewed Pull Requests") [π](#plugin-JamesAPetts "Plugin/utility libraries") [π](https://github.com/cornerstonejs/cornerstoneTools/commits?author=JamesAPetts "Documentation") [π¬](#question-JamesAPetts "Answering Questions") | [
Steve Pieper](http://www.isomics.com)
[π¬](#question-pieper "Answering Questions") [π§](#tool-pieper "Tools") | [
Rodrigo Antinarelli](https://rodrigoea.com/)
[π»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=rodrigolabs "Code") | [
Zaid Safadi](http://blog.zaidsafadi.com/)
[π¬](#question-Zaid-Safadi "Answering Questions") [π»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=Zaid-Safadi "Code") |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| [
Gustavo AndrΓ© Lelis](https://github.com/galelis)
[π»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=galelis "Code") | [
Kofifus](https://github.com/kofifus)
[π»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=kofifus "Code") [π§](#tool-kofifus "Tools") [π](https://github.com/cornerstonejs/cornerstoneTools/issues?q=author%3Akofifus "Bug reports") | [
AloΓ―s Dreyfus](http://www.linkedin.com/in/alois-dreyfus/)
[π»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=adreyfus "Code") | [
Tim Leslie](http://www.timl.id.au)
[π»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=timleslie "Code") | [
diego0020](https://github.com/diego0020)
[π»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=diego0020 "Code") | [
Evren Ozkan](https://github.com/evren217)
[π»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=evren217 "Code") | [
Salvador Daniel Pelayo](https://github.com/daniel2101)
[π»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=daniel2101 "Code") |
| [
Juan Narvaez](https://github.com/jdnarvaez)
[π»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=jdnarvaez "Code") | [
Mike](https://github.com/mikehazell)
[π](https://github.com/cornerstonejs/cornerstoneTools/commits?author=mikehazell "Documentation") [π»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=mikehazell "Code") [β οΈ](https://github.com/cornerstonejs/cornerstoneTools/commits?author=mikehazell "Tests") | [
Sangkeun Kim](http://sisobus.com)
[π»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=sisobus "Code") [π¬](#question-sisobus "Answering Questions") | [
Victor Saase](https://github.com/vsaase)
[π€](#ideas-vsaase "Ideas, Planning, & Feedback") | [
Michael Wasser](http://www.mikewasser.com)
[π](https://github.com/cornerstonejs/cornerstoneTools/commits?author=untoldone "Documentation") | [
Amandeep Singh](https://github.com/singhArmani)
[π](#content-singhArmani "Content") | [
Madison Dickson](http://mix3dstudios.com)
[π](https://github.com/cornerstonejs/cornerstoneTools/commits?author=mix3d "Documentation") |
| [
Kevin Lee Drum](https://github.com/kevinleedrum)
[π»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=kevinleedrum "Code") | [
Makarand Bauskar](https://github.com/mmbauskar)
[π»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=mbauskar "Code") | [
Biharck Araujo](http://www.biharck.com.br)
[π‘](#example-biharck "Examples") [π](https://github.com/cornerstonejs/cornerstoneTools/commits?author=biharck "Documentation") | [
Devon Bernard](https://www.linkedin.com/in/devonbernard)
[π](https://github.com/cornerstonejs/cornerstoneTools/commits?author=DevonBernard "Documentation") | [
Karl-Heinrich](https://github.com/Karl-Heinrich)
[π](https://github.com/cornerstonejs/cornerstoneTools/issues?q=author%3AKarl-Heinrich "Bug reports") [π»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=Karl-Heinrich "Code") [β οΈ](https://github.com/cornerstonejs/cornerstoneTools/commits?author=Karl-Heinrich "Tests") | [
counterxing](https://blog.xingbofeng.com/)
[π](https://github.com/cornerstonejs/cornerstoneTools/issues?q=author%3Axingbofeng "Bug reports") [π»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=xingbofeng "Code") | [
Jorge Lopes](https://github.com/jlopes90)
[π¬](#question-jlopes90 "Answering Questions") |
| [
Gabriel Garrido](http://garrido.io)
[π»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=Ggpsv "Code") | [
ASVBPREAUBV](https://github.com/ASVBPREAUBV)
[π](https://github.com/cornerstonejs/cornerstoneTools/commits?author=ASVBPREAUBV "Documentation") | [
frolic06](https://github.com/frolic06)
[π»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=frolic06 "Code") | [
codepage949](https://github.com/codepage949)
[π»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=codepage949 "Code") | [
Asherah Connor](https://kivikakk.ee)
[π»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=kivikakk "Code") | [
Ikko Ashimine](https://bandism.net/)
[π](https://github.com/cornerstonejs/cornerstoneTools/issues?q=author%3Aeltociear "Bug reports") | [
Bill Wallace](https://github.com/wayfarer3130)
[π»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=wayfarer3130 "Code") [π](https://github.com/cornerstonejs/cornerstoneTools/commits?author=wayfarer3130 "Documentation") |
| [
Bruno Alves de Faria](http://radicalimaging.com/)
[π](https://github.com/cornerstonejs/cornerstoneTools/issues?q=author%3Abrunoalvesdefaria "Bug reports") [π»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=brunoalvesdefaria "Code") [π](#content-brunoalvesdefaria "Content") [π](https://github.com/cornerstonejs/cornerstoneTools/commits?author=brunoalvesdefaria "Documentation") [π](#plugin-brunoalvesdefaria "Plugin/utility libraries") [π](#review-brunoalvesdefaria "Reviewed Pull Requests") [β οΈ](https://github.com/cornerstonejs/cornerstoneTools/commits?author=brunoalvesdefaria "Tests") [π§](#tool-brunoalvesdefaria "Tools") [π](#userTesting-brunoalvesdefaria "User Testing") | [
Igor Octaviano](http://igoroctaviano.com)
[π»](https://github.com/cornerstonejs/cornerstoneTools/commits?author=igoroctaviano "Code") [π](https://github.com/cornerstonejs/cornerstoneTools/commits?author=igoroctaviano "Documentation") [π§](#maintenance-igoroctaviano "Maintenance") [π](#review-igoroctaviano "Reviewed Pull Requests") [π](#userTesting-igoroctaviano "User Testing") |This project follows the [all-contributors][all-contributors] specification.
Contributions of any kind welcome!## Issues
_Looking to contribute? Look for the [Good First Issue][good-first-issue]
label._### π Bugs
Please file an issue for bugs, missing documentation, or unexpected behavior.
[**See Bugs**][bugs]
### π‘ Feature Requests
Please file an issue to suggest new features. Vote on feature requests by adding
a π. This helps maintainers prioritize what to work on.- [**See Feature Requests**][requests-feature]
- [**See Internal Change Requests**][requests-implementation]### β Questions
For questions related to using the library, please visit our support community,
or file an issue on GitHub.- [Google Group][google-group]
## LICENSE
MIT
[build-badge]: https://circleci.com/gh/cornerstonejs/cornerstoneTools/tree/master.svg?style=svg
[build]: https://circleci.com/gh/cornerstonejs/cornerstoneTools/tree/master
[contributing]: https://github.com/cornerstonejs/cornerstoneTools/blob/master/CONTRIBUTING.md
[coverage-badge]: https://codecov.io/gh/cornerstonejs/cornerstoneTools/branch/master/graphs/badge.svg
[coverage]: https://codecov.io/gh/cornerstonejs/cornerstoneTools/branch/master
[npm-url]: https://npmjs.org/package/cornerstone-tools
[npm-downloads-image]: http://img.shields.io/npm/dm/cornerstone-tools.svg?style=flat
[npm-version-image]: http://img.shields.io/npm/v/cornerstone-tools.svg?style=flat
[license-image]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat
[license-url]: LICENSE
[version-2]: https://github.com/cornerstonejs/cornerstoneTools/tree/v2.4.x
[node]: https://nodejs.org
[ohif-demo]: https://viewer.ohif.org/demo-signin
[ohif-source]: https://github.com/OHIF/Viewers
[emojis]: https://github.com/kentcdodds/all-contributors#emoji-key
[all-contributors]: https://github.com/kentcdodds/all-contributors
[bugs]: https://github.com/cornerstonejs/cornerstoneTools/issues?q=is%3Aissue+is%3Aopen+label%3A"π+Bug%3A+Verified"+sort%3Acreated-desc
[requests-feature]: https://github.com/cornerstonejs/cornerstoneTools/issues?q=is%3Aissue+sort%3Areactions-%2B1-desc+label%3A"π»+Change%3A+Feature"+is%3Aopen
[requests-implementation]: https://github.com/cornerstonejs/cornerstoneTools/issues?q=is%3Aissue+sort%3Areactions-%2B1-desc+label%3A"π»+Change%3A+Implementation"+is%3Aopen
[good-first-issue]: https://github.com/cornerstonejs/cornerstoneTools/issues?utf8=β&q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc+label%3A"π₯+Good+First+Issue"
[google-group]: https://groups.google.com/forum/#!forum/cornerstone-platform