Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More β†’
Socket
Sign inDemoInstall
Socket

@cornerstonejs/tools

Package Overview
Dependencies
Maintainers
12
Versions
715
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cornerstonejs/tools

Medical imaging tools for the Cornerstone library

  • 3.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9.3K
decreased by-0.48%
Maintainers
12
Weekly downloads
Β 
Created
Source

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 | Edit the docs


Build Status Coverage Status All Contributors

NPM version NPM downloads MIT License

The problem

Building one or two tools on top of Cornerstone.js 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 elements
  • Tools that need knowledge of a fellow tool's state
  • The ability to "drop-in" others' tools, and they "just work"
  • and many others

This library attempts to solve these problems, and 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.

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 which is bundled with node and should be installed as one of your project's dependencies:

npm install --save cornerstone-tools

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 use

If you need to support the IE11 Browser, you will need to provide polyfills as needed.

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

Examples

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 ported, either create an issue or make a pull request ^_^

Tools

...

3rd Party Tool Plugins

Other Solutions

Contributors

Thanks goes to these people (emoji key):

Chris Hafey
Chris Hafey

πŸ“– πŸ’» πŸ“ πŸ“’
Erik Ziegler
Erik Ziegler

πŸ’» πŸ“– πŸ‘€ 🚧 πŸš‡ πŸ’¬
Danny Brown
Danny Brown

πŸ’» πŸ“– πŸ‘€ 🚧 πŸš‡ πŸ”Œ πŸ’¬
James Petts
James Petts

πŸ’» πŸ‘€ πŸ”Œ πŸ“– πŸ’¬
Steve Pieper
Steve Pieper

πŸ’¬ πŸ”§
Rodrigo Antinarelli
Rodrigo Antinarelli

πŸ’»
Zaid Safadi
Zaid Safadi

πŸ’¬
Gustavo AndrΓ© Lelis
Gustavo AndrΓ© Lelis

πŸ’»
Kofifus
Kofifus

πŸ’» πŸ”§ πŸ›
AloΓ―s Dreyfus
AloΓ―s Dreyfus

πŸ’»
Tim Leslie
Tim Leslie

πŸ’»
diego0020
diego0020

πŸ’»
Evren Ozkan
Evren Ozkan

πŸ’»
Salvador Daniel Pelayo
Salvador Daniel Pelayo

πŸ’»

This project follows the all-contributors specification. Contributions of any kind welcome!

Issues

Looking to contribute? Look for the Good First Issue label.

πŸ› Bugs

Please file an issue for bugs, missing documentation, or unexpected behavior.

See 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.

❓ Questions

For questions related to using the library, please visit our support community, or file an issue on GitHub.

LICENSE

MIT

Keywords

FAQs

Package last updated on 08 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚑️ by Socket Inc