UNPKG

2.74 kBMarkdownView Raw
1cornerstone Web Image Loader
2=============================
3
4A [cornerstone](https://github.com/cornerstonejs/cornerstone) Image Loader for web images (PNG, JPEG).
5
6Live Examples
7---------------
8
9[Click here for a live example of this library in use!](http://rawgit.com/cornerstonejs/cornerstoneWebImageLoader/master/examples/index.html)
10
11View the [simple image viewer](http://viewer.ohif.org/) built on cornerstone.
12
13Install
14-------
15
16Get a packaged source file:
17
18* [cornerstoneWebImageLoader.js](https://raw.githubusercontent.com/cornerstonejs/cornerstoneWebImageLoader/master/dist/cornerstoneWebImageLoader.js)
19* [cornerstoneWebImageLoader.min.js](https://raw.githubusercontent.com/cornerstonejs/cornerstoneWebImageLoader/master/dist/cornerstoneWebImageLoader.min.js)
20
21Or install via [NPM](https://www.npmjs.com/):
22
23> npm install cornerstone-web-image-loader
24
25Usage
26-------
27
28Simply include the cornerstoneWebImageLoader.js in your HTML file after you load cornerstone.js and then set the cornerstone instance as an external module for cornerstoneWebImageLoader:
29
30````javascript
31cornerstoneWebImageLoader.external.cornerstone = cornerstone;
32````
33
34This will let cornerstoneWebImageLoader register itself with cornerstone to load imageId's that have the http or https url schemes. To display an image, pass the url to the image as the imageId parameter to a cornerstone API function loadImage().
35
36Key Features
37------------
38
39* Provides a bridge between the cornerstone library and standard web images
40* Allows XHR to be hooked so custom http headers can be added (e.g. for authentication). View the source of the
41 [example](http://rawgit.com/cornerstonejs/cornerstoneWebImageLoader/master/examples/index.html) to see how this is done.
42
43Contributors
44------------
45@onluiz for fixing a bug with images not being properly invalidated
46@leonardorame for adding support for CornerstoneImageLoadProgress
47
48Build System
49============
50
51This project uses webpack to build the software.
52
53Pre-requisites:
54---------------
55
56NodeJs - [click to visit web site for installation instructions](http://nodejs.org).
57
58Common Tasks
59------------
60
61Update dependencies (after each pull):
62> npm install
63
64Running the build:
65> npm start
66
67Automatically running the build and unit tests after each source change:
68> npm run watch
69
70Why is this a separate library from cornerstone?
71================================================
72
73Cornerstone was designed to support loading of any kind of image regardless of its container,
74compression algorithm, encoding or transport. This is one of many possible image loaders
75that can provide the image pixel data to cornerstone to display
76
77Copyright
78============
79Copyright 2017 Chris Hafey [chafey@gmail.com](mailto:chafey@gmail.com)
\No newline at end of file