Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
cornerstone-wado-image-loader
Advanced tools
Cornerstone Image Loader for DICOM WADO-URI and WADO-RS
This repo is no longer supported, please consider using @cornerstonejs/dicom-image-loader instead. There you can find
A cornerstone Image Loader for DICOM P10 instances over HTTP (WADO-URI) or DICOMWeb (WADO-RS). 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 or custom servers)
Click here for a live example of this library in use!
You can also see it in action with the cornerstoneDemo application.
Get the distributed unminimized file:
or the distributed minimized file:
The cornerstoneWADOImageLoader depends on the following external libraries which should be loaded before cornerstoneWADOImageLoader.js:
New in 1.0.0: Specify the cornerstone instance you want to register the loader with.
cornerstoneWADOImageLoader.external.cornerstone = cornerstone;
Have your code configure the web worker framework:
var config = {
maxWebWorkers: navigator.hardwareConcurrency || 1,
startWebWorkersOnDemand: true,
};
cornerstoneWADOImageLoader.webWorkerManager.initialize(config);
See the web workers documentation for more details on configuring.
Cornerstone-WADO-Image-Loader (CWIL) v4.0.x has been released, which adds support for using WebAssembly (WASM) builds of each codec. This significantly improves image decoding performance and enables us to load codec at runtime when needed dynamically, which reduces the build time and complexity.
In addition, we have improved the image loading performance in CWIL v4.x. In previous versions of CWIL, image loading includes fetching AND decoding an image before returning a promise completion, preventing more requests from being made until the queue is empty. This limitation has been fixed in CWIL v4, which separates image retrieval and decoding into two steps. Now after an image is retrieved, a new request is sent to the server immediately.
Improvement | |
---|---|
CWIL Bundle Size | 30x smaller (3.0 MB vs 87 kb with dynamic import) |
JPEG Baseline Codec | 4.5x faster (2.87 ms for 512x512 16 bit CT Slice) |
JPEG 2000 Codec | 1.8x faster (41.02 ms for 512x512 16 bit CT Slice) |
In v4.x, we have added dynamic importing support for the codecs as needed. To be able to use such feature, instead of
import cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader';
you need to do:
import cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader/dist/dynamic-import/cornerstoneWADOImageLoader.min.js';
This way, codecs are loaded dynamically when needed. You have another option to create an alias in the webpack config file as we do here for OHIF Viewer.
resolve: {
alias: {
'cornerstone-wado-image-loader':
'cornerstone-wado-image-loader/dist/dynamic-import/cornerstoneWADOImageLoader.min.js',
},
},
In addition WASM builds of the codec files should be made available in the build
folder. We use CopyWebpackPlugin
to copy the WASM files to the build folder.
See
here
for how we do it in OHIF Viewer.
plugins: [
new CopyWebpackPlugin([
{
from:
'../../../node_modules/cornerstone-wado-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.
Having problems viewing your images with cornerstonWADOImageLoader? Check out the troubleshooting guide.
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
How do I add my own custom web worker tasks?
See the documentation here
How do I create imageIds that work with this image loader?
See the documentation here
Copyright 2016 Chris Hafey chafey@gmail.com
FAQs
Cornerstone Image Loader for DICOM WADO-URI and WADO-RS
The npm package cornerstone-wado-image-loader receives a total of 4,180 weekly downloads. As such, cornerstone-wado-image-loader popularity was classified as popular.
We found that cornerstone-wado-image-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 10 open source maintainers collaborating on the project.
Did you know?
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.