# Installation

# Direct Download / CDN

https://unpkg.com/cornerstone-tools (opens new window)

Unpkg.com (opens new window) provides NPM-based CDN links. The above link will always point to the latest release on NPM. You can also use a specific version/tag via URLs like https://unpkg.com/cornerstone-tools@2.0.0.

Include cornerstoneTools after Cornerstone and it will install itself automatically:

<script src="/path/to/cornerstone.js"></script>
<script src="/path/to/cornerstoneMath.js"></script>
<script src="/path/to/cornerstoneTools.js"></script>

# NPM

npm install cornerstone-tools --save

When used with a module system, you can import cornerstoneTools like this:

// External Dependencies
import Hammer from "hammerjs";

// Cornerstone Libraries
import * as cornerstone from "cornerstone-core";
import * as cornerstoneMath from "cornerstone-math";
import * as cornerstoneTools from "cornerstone-tools";

// Specify external dependencies
cornerstoneTools.external.Hammer = Hammer;
cornerstoneTools.external.cornerstone = cornerstone;
cornerstoneTools.external.cornerstoneMath = cornerstoneMath;

You don't need to do this when using global script tags.

# Dev Build

You will have to clone directly from GitHub and build cornerstoneTools yourself if you want to use the latest dev build.

git clone https://github.com/cornerstonejs/cornerstoneTools.git node_modules/cornerstoneTools
cd node_modules/cornerstoneTools
npm install
npm run build