npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@luminancerealm/cornerstone-tools

v2023.9.16

Published

Medical imaging tools for the Cornerstone library

Downloads

4

Readme

🔔🔔🔔🔔 Attention: Cornerstone.js has evolved! We're excited to introduce Cornerstone3D 🚀. Expect advanced rendering, stellar performance, and a modern toolset. 🌐 Navigate to the new repository for the latest updates and improvements.

Read The Docs | Edit the docs

Build Status Coverage Status All Contributors

NPM version NPM downloads MIT License

Index

The Fun Stuff

Everything Else

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

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:

// 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 use

If you need to support the IE11 Browser, you will need to provide polyfills as needed. Our BrowserList target:

  "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

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

Tools

Annotation Tools

3rd Party Tool Plugins

A huge thanks to tool authors, like @sisobus, for sharing their work with the community!

Other Solutions

Contributors

Thanks goes to these people (emoji key):

| Chris Hafey📖 💻 📝 📢 | Erik Ziegler💻 📖 👀 🚧 🚇 💬 | Danny Brown💻 📖 👀 🚧 🚇 🔌 💬 | James Petts💻 👀 🔌 📖 💬 | Steve Pieper💬 🔧 | Rodrigo Antinarelli💻 | Zaid Safadi💬 💻 | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | | Gustavo André Lelis💻 | Kofifus💻 🔧 🐛 | Aloïs Dreyfus💻 | Tim Leslie💻 | diego0020💻 | Evren Ozkan💻 | Salvador Daniel Pelayo💻 | | Juan Narvaez💻 | Mike📖 💻 ⚠️ | Sangkeun Kim💻 💬 | Victor Saase🤔 | Michael Wasser📖 | Amandeep Singh🖋 | Madison Dickson📖 | | Kevin Lee Drum💻 | Makarand Bauskar💻 | Biharck Araujo💡 📖 | Devon Bernard📖 | Karl-Heinrich🐛 💻 ⚠️ | counterxing🐛 💻 | Jorge Lopes💬 | | Gabriel Garrido💻 | ASVBPREAUBV📖 | frolic06💻 | codepage949💻 | Asherah Connor💻 | Ikko Ashimine🐛 | Bill Wallace💻 📖 | | Bruno Alves de Faria🐛 💻 🖋 📖 🔌 👀 ⚠️ 🔧 📓 | Igor Octaviano💻 📖 🚧 👀 📓 |

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