-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
272 additions
and
338 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,7 +131,7 @@ | |
}, | ||
"packages/adapters": { | ||
"name": "@cornerstonejs/adapters", | ||
"version": "3.0.0-beta.6", | ||
"version": "3.0.0", | ||
"dependencies": { | ||
"@babel/runtime-corejs2": "^7.17.8", | ||
"buffer": "^6.0.3", | ||
|
@@ -140,13 +140,13 @@ | |
"ndarray": "^1.0.19", | ||
}, | ||
"peerDependencies": { | ||
"@cornerstonejs/core": "^3.0.0-beta.6", | ||
"@cornerstonejs/tools": "^3.0.0-beta.6", | ||
"@cornerstonejs/core": "^3.0.0", | ||
"@cornerstonejs/tools": "^3.0.0", | ||
}, | ||
}, | ||
"packages/ai": { | ||
"name": "@cornerstonejs/ai", | ||
"version": "3.0.0-beta.6", | ||
"version": "3.0.0", | ||
"dependencies": { | ||
"@babel/runtime-corejs2": "^7.17.8", | ||
"buffer": "^6.0.3", | ||
|
@@ -164,7 +164,7 @@ | |
}, | ||
"packages/core": { | ||
"name": "@cornerstonejs/core", | ||
"version": "3.0.0-beta.6", | ||
"version": "3.0.0", | ||
"dependencies": { | ||
"@kitware/vtk.js": "32.9.0", | ||
"comlink": "^4.4.1", | ||
|
@@ -173,7 +173,7 @@ | |
}, | ||
"packages/dicomImageLoader": { | ||
"name": "@cornerstonejs/dicom-image-loader", | ||
"version": "3.0.0-beta.6", | ||
"version": "3.0.0", | ||
"dependencies": { | ||
"@cornerstonejs/codec-charls": "^1.2.3", | ||
"@cornerstonejs/codec-libjpeg-turbo-8bit": "^1.2.2", | ||
|
@@ -185,19 +185,19 @@ | |
"uuid": "^9.0.0", | ||
}, | ||
"peerDependencies": { | ||
"@cornerstonejs/core": "^3.0.0-beta.6", | ||
"@cornerstonejs/core": "^3.0.0", | ||
"dicom-parser": "^1.8.9", | ||
}, | ||
}, | ||
"packages/docs": { | ||
"name": "docs", | ||
"version": "3.0.0-beta.5", | ||
"dependencies": { | ||
"@cornerstonejs/adapters": "^3.0.0-beta.6", | ||
"@cornerstonejs/core": "^3.0.0-beta.6", | ||
"@cornerstonejs/dicom-image-loader": "^3.0.0-beta.6", | ||
"@cornerstonejs/nifti-volume-loader": "^3.0.0-beta.6", | ||
"@cornerstonejs/tools": "^3.0.0-beta.6", | ||
"@cornerstonejs/adapters": "^3.0.0", | ||
"@cornerstonejs/core": "^3.0.0", | ||
"@cornerstonejs/dicom-image-loader": "^3.0.0", | ||
"@cornerstonejs/nifti-volume-loader": "^3.0.0", | ||
"@cornerstonejs/tools": "^3.0.0", | ||
"@docusaurus/core": "3.6.3", | ||
"@docusaurus/faster": "3.6.3", | ||
"@docusaurus/module-type-aliases": "3.6.3", | ||
|
@@ -235,7 +235,7 @@ | |
}, | ||
"packages/labelmap-interpolation": { | ||
"name": "@cornerstonejs/labelmap-interpolation", | ||
"version": "3.0.0-beta.6", | ||
"version": "3.0.0", | ||
"dependencies": { | ||
"@itk-wasm/morphological-contour-interpolation": "1.1.0", | ||
"itk-wasm": "1.0.0-b.165", | ||
|
@@ -248,17 +248,17 @@ | |
}, | ||
"packages/nifti-volume-loader": { | ||
"name": "@cornerstonejs/nifti-volume-loader", | ||
"version": "3.0.0-beta.6", | ||
"version": "3.0.0", | ||
"dependencies": { | ||
"nifti-reader-js": "^0.6.8", | ||
}, | ||
"peerDependencies": { | ||
"@cornerstonejs/core": "^3.0.0-beta.6", | ||
"@cornerstonejs/core": "^3.0.0", | ||
}, | ||
}, | ||
"packages/polymorphic-segmentation": { | ||
"name": "@cornerstonejs/polymorphic-segmentation", | ||
"version": "3.0.0-beta.6", | ||
"version": "3.0.0", | ||
"dependencies": { | ||
"@icr/polyseg-wasm": "0.4.0", | ||
}, | ||
|
@@ -270,7 +270,7 @@ | |
}, | ||
"packages/tools": { | ||
"name": "@cornerstonejs/tools", | ||
"version": "3.0.0-beta.6", | ||
"version": "3.0.0", | ||
"dependencies": { | ||
"@types/offscreencanvas": "2019.7.3", | ||
"comlink": "^4.4.1", | ||
|
@@ -280,7 +280,7 @@ | |
"canvas": "^2.11.2", | ||
}, | ||
"peerDependencies": { | ||
"@cornerstonejs/core": "^3.0.0-beta.6", | ||
"@cornerstonejs/core": "^3.0.0", | ||
"@kitware/vtk.js": "32.9.0", | ||
"@types/d3-array": "^3.0.4", | ||
"@types/d3-interpolate": "^3.0.1", | ||
|
@@ -5489,8 +5489,6 @@ | |
|
||
"@docusaurus/mdx-loader/webpack": ["[email protected]", "", { "dependencies": { "@types/eslint-scope": "^3.7.7", "@types/estree": "^1.0.6", "@webassemblyjs/ast": "^1.14.1", "@webassemblyjs/wasm-edit": "^1.14.1", "@webassemblyjs/wasm-parser": "^1.14.1", "acorn": "^8.14.0", "browserslist": "^4.24.0", "chrome-trace-event": "^1.0.2", "enhanced-resolve": "^5.17.1", "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", "graceful-fs": "^4.2.11", "json-parse-even-better-errors": "^2.3.1", "loader-runner": "^4.2.0", "mime-types": "^2.1.27", "neo-async": "^2.6.2", "schema-utils": "^3.2.0", "tapable": "^2.1.1", "terser-webpack-plugin": "^5.3.10", "watchpack": "^2.4.1", "webpack-sources": "^3.2.3" }, "bin": { "webpack": "bin/webpack.js" } }, "sha512-EksG6gFY3L1eFMROS/7Wzgrii5mBAFe4rIr3r2BTfo7bcc+DWwFZ4OJ/miOuHJO/A85HwyI4eQ0F6IKXesO7Fg=="], | ||
|
||
"@docusaurus/module-type-aliases/react-helmet-async": ["[email protected]", "", { "dependencies": { "invariant": "^2.2.4", "react-fast-compare": "^3.2.2", "shallowequal": "^1.1.0" }, "peerDependencies": { "react": "^16.6.0 || ^17.0.0 || ^18.0.0" } }, "sha512-rYUYHeus+i27MvFE+Jaa4WsyBKGkL6qVgbJvSBoX8mbsWoABJXdEO0bZyi0F6i+4f0NuIb8AvqPMj3iXFHkMwg=="], | ||
|
||
"@docusaurus/plugin-content-blog/fs-extra": ["[email protected]", "", { "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" } }, "sha512-Z4XaCL6dUDHfP/jT25jJKMmtxvuwbkrD1vNSMFlo9lNLY2c5FHYSQgHPRZUjAB26TpDEoW9HCOgplrdbaPV/ew=="], | ||
|
||
"@docusaurus/plugin-content-blog/webpack": ["[email protected]", "", { "dependencies": { "@types/eslint-scope": "^3.7.7", "@types/estree": "^1.0.6", "@webassemblyjs/ast": "^1.14.1", "@webassemblyjs/wasm-edit": "^1.14.1", "@webassemblyjs/wasm-parser": "^1.14.1", "acorn": "^8.14.0", "browserslist": "^4.24.0", "chrome-trace-event": "^1.0.2", "enhanced-resolve": "^5.17.1", "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", "glob-to-regexp": "^0.4.1", "graceful-fs": "^4.2.11", "json-parse-even-better-errors": "^2.3.1", "loader-runner": "^4.2.0", "mime-types": "^2.1.27", "neo-async": "^2.6.2", "schema-utils": "^3.2.0", "tapable": "^2.1.1", "terser-webpack-plugin": "^5.3.10", "watchpack": "^2.4.1", "webpack-sources": "^3.2.3" }, "bin": { "webpack": "bin/webpack.js" } }, "sha512-EksG6gFY3L1eFMROS/7Wzgrii5mBAFe4rIr3r2BTfo7bcc+DWwFZ4OJ/miOuHJO/A85HwyI4eQ0F6IKXesO7Fg=="], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,173 +1,3 @@ | ||
# DICOM Image Loader | ||
|
||
This package provides a DICOM image loader for the Cornerstone library. | ||
This is the successor to the [cornerstoneDICOMImageLoader] which provides the following | ||
added features: | ||
|
||
- Typescript support (and type definitions) | ||
- Better developer experience (e.g. mono repo, linting, etc) | ||
|
||
|
||
|
||
A [cornerstone](https://github.com/cornerstonejs/cornerstone) Image Loader for | ||
DICOM P10 instances over HTTP (WADO-URI) or DICOMWeb (WADO-RS) and Local filedisk. This can be used | ||
to integrate cornerstone with WADO-URI servers, DICOMWeb servers or any other | ||
HTTP based server that returns DICOM P10 instances (e.g. | ||
[Orthanc](http://www.orthanc-server.com/) or custom servers) | ||
|
||
## Key Features | ||
|
||
- Implements a | ||
[cornerstone ImageLoader](https://www.cornerstonejs.org/docs/concepts/cornerstone-core/imageLoader) | ||
for DICOM P10 Instances via a HTTP get request. | ||
- Can be used with a WADO-URI server | ||
- Can be used with Orthanc's file endpoint | ||
- Can be used with any server that returns DICOM P10 instances via HTTP GET | ||
- Implements a | ||
[cornerstone ImageLoader](https://www.cornerstonejs.org/docs/concepts/cornerstone-core/imageLoader) | ||
for WADO-RS (DICOMWeb) | ||
- Supports many popular transfer syntaxes and photometric interpretations | ||
[see full list](docs/TransferSyntaxes.md) | ||
and [codec](docs/Codecs.md) for more information. | ||
- Dynamicly Utilizes WebAssembly (WASM) builds of each codec which sgnificantly improves image decoding performance and enables us to load codec at runtime when needed dynamically, which reduces the build time and complexity. | ||
- Framework to execute CPU intensive tasks in [web workers](docs/WebWorkers.md) | ||
- Used for image decoding | ||
- Can be used for your own CPU intensive tasks (e.g. image processing) | ||
|
||
|
||
## Install | ||
|
||
### NPM | ||
|
||
```bash | ||
yarn add @cornerstonejs/dicom-image-loader | ||
``` | ||
|
||
|
||
|
||
## Usage | ||
|
||
Specify the cornerstone instance you want to register the loader with. | ||
|
||
```javascript | ||
cornerstoneDICOMImageLoader.external.cornerstone = cornerstone; | ||
``` | ||
|
||
Have your code configure the web worker framework: | ||
|
||
```javascript | ||
var config = { | ||
maxWebWorkers: navigator.hardwareConcurrency || 1, | ||
startWebWorkersOnDemand: true, | ||
}; | ||
cornerstoneDICOMImageLoader.webWorkerManager.initialize(config); | ||
``` | ||
|
||
See the [web workers](docs/WebWorkers.md) documentation for more details on | ||
configuring. | ||
|
||
|
||
|
||
#### Dynamic Import | ||
|
||
To be able to use the dynamic import feature for CDIL, instead of | ||
|
||
```js | ||
import cornerstoneDICOMImageLoader from '@cornerstonejs/dicom-image-loader'; | ||
``` | ||
|
||
you need to do: | ||
|
||
```js | ||
import cornerstoneDICOMImageLoader from '@cornerstonejs/dicom-image-loader/dist/dynamic-import/cornerstoneDICOMImageLoader.min.js'; | ||
``` | ||
|
||
This way, codecs are loaded dynamically when needed. You have another option to | ||
create an alias in the webpack config file: | ||
|
||
```js | ||
resolve: { | ||
alias: { | ||
'@cornerstonejs/dicom-image-loader': | ||
'@cornerstonejs/dicom-image-loader/dist/dynamic-import/cornerstoneDICOMImageLoader.min.js', | ||
}, | ||
}, | ||
``` | ||
|
||
In addition WASM builds of the codec files should be made available in the build | ||
folder. You can use `CopyWebpackPlugin` to copy the WASM files to the build folder. | ||
|
||
|
||
```js | ||
plugins: [ | ||
new CopyWebpackPlugin([ | ||
{ | ||
from: | ||
'../../../node_modules/@cornerstonejs/dicom-image-loader/dist/dynamic-import', | ||
to: DIST_DIR, | ||
}, | ||
]), | ||
``` | ||
|
||
Note 1: You need to give the correct path in the `CopyWebpackPlugin`, the above | ||
path is relative to the `node_modules` folder in the OHIF Viewer. | ||
|
||
Note 2: For other http servers like IIS, you need to configure it to serve WASM | ||
files with the correct MIME type. | ||
|
||
## Loading | ||
|
||
 | ||
|
||
## Backlog | ||
|
||
- ESM build for the library | ||
- Make the examples work again | ||
- Free up DICOM P10 instance after decoding to reduce memory consumption | ||
- Look at using EMSCRIPTEN based build of IJG for JPEG | ||
- Add support for bulk data items to WADO-RS Loader | ||
- WebWorker Manager | ||
- Better handling of web worker loading | ||
- Add events to webWorkerManager so its activity can be monitored | ||
- Add support for issuing progress events from web worker tasks | ||
|
||
# FAQ | ||
|
||
_Why is this a separate library from cornerstone?_ | ||
|
||
Mainly to avoid adding a dependency to cornerstone for the DICOM parsing | ||
library. While cornerstone is intended to be used to display medical images that | ||
are stored in DICOM, cornerstone aims to simplify the use of medical imaging and | ||
therefore tries to hide some of the complexity that exists within DICOM. It is | ||
also desirable to support display of non DICOM images so a DICOM independent | ||
image model makes sense. | ||
|
||
_How do I build this library myself?_ | ||
|
||
See the documentation [here](docs/Building.md) | ||
|
||
_How do I add my own custom web worker tasks?_ | ||
|
||
See the documentation [here](docs/WebWorkers.md) | ||
|
||
_How do I create imageIds that work with this image loader?_ | ||
|
||
See the documentation [here](docs/ImageIds.md) | ||
|
||
# What Transfer Syntaxes are supported? | ||
|
||
See [transfer syntaxes](docs/TransferSyntaxes.md) | ||
|
||
|
||
[license-image]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat | ||
[license-url]: LICENSE | ||
|
||
[npm-url]: https://npmjs.org/package/@cornerstonejs/dicom-image-loader | ||
[npm-version-image]: http://img.shields.io/npm/v/@cornerstonejs/dicom-image-loader.svg?style=flat | ||
[npm-downloads-image]: http://img.shields.io/npm/dm/@cornerstonejs/dicom-image-loader.svg?style=flat | ||
|
||
[travis-url]: http://travis-ci.org/cornerstonejs/cornerstoneDICOMImageLoader | ||
[travis-image]: https://travis-ci.org/cornerstonejs/cornerstoneDICOMImageLoader.svg?branch=master | ||
|
||
[coverage-url]: https://coveralls.io/github/cornerstonejs/cornerstoneDICOMImageLoader?branch=master | ||
[coverage-image]: https://coveralls.io/repos/github/cornerstonejs/cornerstoneDICOMImageLoader/badge.svg?branch=master | ||
See full guide on [cornerstonejs.org](https://cornerstonejs.org/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
id: general | ||
title: 'General' | ||
id: polyseg | ||
title: 'PolySeg' | ||
--- | ||
|
||
import Tabs from '@theme/Tabs'; | ||
|
4 changes: 2 additions & 2 deletions
4
packages/docs/docs/migration-guides/3x/3-labelmap-interpolation.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.