Skip to content

Commit

Permalink
bring back cs wado for now
Browse files Browse the repository at this point in the history
  • Loading branch information
sedghi committed Mar 3, 2023
1 parent 1e6b315 commit 0192389
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .webpack/excludeNodeModulesExcept.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function excludeNodeModulesExcept(modules) {
});

return function (modulePath) {
if (/cornerstoneDICOMImageLoader/.test(modulePath)) {
if (/cornerstoneWADOImageLoader/.test(modulePath)) {
return true;
}

Expand Down
4 changes: 2 additions & 2 deletions .webpack/webpack.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ module.exports = (env, argv, { DIST_DIR }) => {
modules: [path.resolve(PROJECT_ROOT, './node_modules'), SRC_PATH],
extensions: ['.ts', '.tsx', '.js', '.jsx'],
alias: {
'@cornerstonejs/dicom-image-loader':
'@cornerstonejs/dicom-image-loader/dist/dynamic-import/cornerstoneDICOMImageLoader.min.js',
'cornerstone-wado-image-loader':
'cornerstone-wado-image-loader/dist/dynamic-import/cornerstoneWADOImageLoader.min.js',
},
fallback: {
fs: false,
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
"@cornerstonejs/core": "^0.32.0",
"@cornerstonejs/streaming-image-volume-loader": "^0.13.0",
"@cornerstonejs/tools": "^0.47.0",
"@cornerstonejs/dicom-image-loader": "^0.1.5",
"@docusaurus/core": "2.3.1",
"@docusaurus/module-type-aliases": "2.3.1",
"@docusaurus/preset-classic": "2.3.1",
"@kitware/vtk.js": "26.5.6",
"@mdx-js/react": "^1.6.21",
"@svgr/webpack": "^6.2.1",
"clsx": "^1.1.1",
"cornerstone-wado-image-loader": "^4.8.0",
"dcmjs": "^0.24.4",
"detect-gpu": "^4.0.45",
"dicom-parser": "^1.8.11",
Expand Down
4 changes: 2 additions & 2 deletions packages/streaming-image-volume-loader/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
},
"dependencies": {
"@cornerstonejs/core": "^0.32.0",
"@cornerstonejs/dicom-image-loader": "^0.1.5"
"cornerstone-wado-image-loader": "^4.10.0"
},
"peerDependencies": {
"@cornerstonejs/calculate-suv": "1.0.2"
},
"devDependencies": {
"@cornerstonejs/calculate-suv": "1.0.2",
"@cornerstonejs/dicom-image-loader": "^0.1.5"
"cornerstone-wado-image-loader": "^4.10.0"
},
"contributors": [
{
Expand Down
4 changes: 2 additions & 2 deletions packages/tools/examples/dynamicPetCt/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import cornerstoneDICOMImageLoader from '@cornerstonejs/dicom-image-loader';
import cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader';
import {
RenderingEngine,
Types,
Expand Down Expand Up @@ -522,7 +522,7 @@ function setUpSynchronizers() {
}

async function setUpDisplay() {
const { metaDataManager } = cornerstoneDICOMImageLoader.wadors;
const { metaDataManager } = cornerstoneWADOImageLoader.wadors;
const wadoRsRoot = 'https://d28o5kq0jsoob5.cloudfront.net/dicomweb';
const StudyInstanceUID =
'1.3.6.1.4.1.12842.1.1.14.3.20220915.105557.468.2963630849';
Expand Down
6 changes: 3 additions & 3 deletions packages/tools/examples/local/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RenderingEngine, Types, Enums, metaData } from '@cornerstonejs/core';
import cornerstoneDICOMImageLoader from '@cornerstonejs/dicom-image-loader';
import cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader';
import * as cornerstoneTools from '@cornerstonejs/tools';
import htmlSetup from './htmlSetup';
import uids from './uids';
Expand Down Expand Up @@ -55,7 +55,7 @@ document
// Add the file to the cornerstoneFileImageLoader and get unique
// number for that file
const file = e.target.files[0];
const imageId = cornerstoneDICOMImageLoader.wadouri.fileManager.add(file);
const imageId = cornerstoneWADOImageLoader.wadouri.fileManager.add(file);
loadAndViewImage(imageId);
});

Expand Down Expand Up @@ -143,7 +143,7 @@ function handleFileSelect(evt) {

// this UI is only built for a single file so just dump the first one
const file = files[0];
const imageId = cornerstoneDICOMImageLoader.wadouri.fileManager.add(file);
const imageId = cornerstoneWADOImageLoader.wadouri.fileManager.add(file);
loadAndViewImage(imageId);
}

Expand Down
6 changes: 3 additions & 3 deletions packages/tools/examples/localCPU/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RenderingEngine, Types, Enums, metaData } from '@cornerstonejs/core';
import cornerstoneDICOMImageLoader from '@cornerstonejs/dicom-image-loader';
import cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader';
import * as cornerstoneTools from '@cornerstonejs/tools';
import htmlSetup from '../local/htmlSetup';
import uids from '../local/uids';
Expand Down Expand Up @@ -53,7 +53,7 @@ document
// Add the file to the cornerstoneFileImageLoader and get unique
// number for that file
const file = e.target.files[0];
const imageId = cornerstoneDICOMImageLoader.wadouri.fileManager.add(file);
const imageId = cornerstoneWADOImageLoader.wadouri.fileManager.add(file);
loadAndViewImage(imageId);
});

Expand Down Expand Up @@ -145,7 +145,7 @@ function handleFileSelect(evt) {

// this UI is only built for a single file so just dump the first one
const file = files[0];
const imageId = cornerstoneDICOMImageLoader.wadouri.fileManager.add(file);
const imageId = cornerstoneWADOImageLoader.wadouri.fileManager.add(file);
loadAndViewImage(imageId);
}

Expand Down
4 changes: 2 additions & 2 deletions utils/ExampleRunner/template-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ module.exports = {
patterns: [
{
from:
'../../../node_modules/@cornerstonejs/dicom-image-loader/dist/dynamic-import',
'../../../node_modules/cornerstone-wado-image-loader/dist/dynamic-import',
to: '${destPath.replace(/\\/g, '/')}',
},
],
Expand Down Expand Up @@ -71,7 +71,7 @@ module.exports = {
)}',
// We use this alias and the CopyPlugin to support using the dynamic-import version
// of WADO Image Loader
'@cornerstonejs/dicom-image-loader': '@cornerstonejs/dicom-image-loader/dist/dynamic-import/cornerstoneDICOMImageLoader.min.js',
'cornerstone-wado-image-loader': 'cornerstone-wado-image-loader/dist/dynamic-import/cornerstoneWADOImageLoader.min.js',
},
modules,
extensions: ['.ts', '.tsx', '.js', '.jsx'],
Expand Down
4 changes: 2 additions & 2 deletions utils/ExampleRunner/template-multiexample-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ module.exports = {
)}" },
{
from:
'../../../node_modules/@cornerstonejs/dicom-image-loader/dist/dynamic-import',
'../../../node_modules/cornerstone-wado-image-loader/dist/dynamic-import',
to: '${destPath.replace(/\\/g, '/')}',
},
],
Expand All @@ -100,7 +100,7 @@ module.exports = {
)}',
// We use this alias and the CopyPlugin to support using the dynamic-import version
// of WADO Image Loader
'@cornerstonejs/dicom-image-loader': '@cornerstonejs/dicom-image-loader/dist/dynamic-import/cornerstoneDICOMImageLoader.min.js',
'cornerstone-wado-image-loader': 'cornerstone-wado-image-loader/dist/dynamic-import/cornerstoneWADOImageLoader.min.js',
},
modules,
extensions: ['.ts', '.tsx', '.js', '.jsx'],
Expand Down
5 changes: 2 additions & 3 deletions utils/demo/helpers/convertMultiframeImageIds.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { metaData } from '@cornerstonejs/core';
import cornerstoneDICOMImageLoader from '@cornerstonejs/dicom-image-loader';

import cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader';
/**
* preloads imageIds metadata in memory
**/
async function prefetchMetadataInformation(imageIdsToPrefetch) {
for (let i = 0; i < imageIdsToPrefetch.length; i++) {
await cornerstoneDICOMImageLoader.wadouri.loadImage(imageIdsToPrefetch[i])
await cornerstoneWADOImageLoader.wadouri.loadImage(imageIdsToPrefetch[i])
.promise;
}
}
Expand Down
6 changes: 3 additions & 3 deletions utils/demo/helpers/createImageIdsAndCacheMetaData.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import dcmjs from 'dcmjs';
import { calculateSUVScalingFactors } from '@cornerstonejs/calculate-suv';
import { getPTImageIdInstanceMetadata } from './getPTImageIdInstanceMetadata';
import { utilities } from '@cornerstonejs/core';
import cornerstoneDICOMImageLoader from '@cornerstonejs/dicom-image-loader';
import cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader';

import ptScalingMetaDataProvider from './ptScalingMetaDataProvider';
import getPixelSpacingInformation from './getPixelSpacingInformation';
Expand Down Expand Up @@ -59,7 +59,7 @@ export default async function createImageIdsAndCacheMetaData({
SOPInstanceUID +
'/frames/1';

cornerstoneDICOMImageLoader.wadors.metaDataManager.add(
cornerstoneWADOImageLoader.wadors.metaDataManager.add(
imageId,
instanceMetaData
);
Expand All @@ -72,7 +72,7 @@ export default async function createImageIdsAndCacheMetaData({

imageIds.forEach((imageId) => {
let instanceMetaData =
cornerstoneDICOMImageLoader.wadors.metaDataManager.get(imageId);
cornerstoneWADOImageLoader.wadors.metaDataManager.get(imageId);

// It was using JSON.parse(JSON.stringify(...)) before but it is 8x slower
instanceMetaData = removeInvalidTags(instanceMetaData);
Expand Down
10 changes: 5 additions & 5 deletions utils/demo/helpers/initCornerstoneDICOMImageLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import dicomParser from 'dicom-parser';
import * as cornerstone from '@cornerstonejs/core';
import * as cornerstoneTools from '@cornerstonejs/tools';

import cornerstoneDICOMImageLoader from '@cornerstonejs/dicom-image-loader';
import cornerstoneWADOImageLoader from 'cornerstone-wado-image-loader';

window.cornerstone = cornerstone;
window.cornerstoneTools = cornerstoneTools;

export default function initCornerstoneDICOMImageLoader() {
cornerstoneDICOMImageLoader.external.cornerstone = cornerstone;
cornerstoneDICOMImageLoader.external.dicomParser = dicomParser;
cornerstoneDICOMImageLoader.configure({
cornerstoneWADOImageLoader.external.cornerstone = cornerstone;
cornerstoneWADOImageLoader.external.dicomParser = dicomParser;
cornerstoneWADOImageLoader.configure({
useWebWorkers: true,
decodeConfig: {
convertFloatPixelDataToInt: false,
Expand All @@ -34,5 +34,5 @@ export default function initCornerstoneDICOMImageLoader() {
},
};

cornerstoneDICOMImageLoader.webWorkerManager.initialize(config);
cornerstoneWADOImageLoader.webWorkerManager.initialize(config);
}

0 comments on commit 0192389

Please sign in to comment.