You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kousu@server:~/src/cornerstone-demo/cornerstone3D-beta/packages/tools$ vi examples/tutorial/index.ts
giving me this file
cat examples/tutorial/index.ts
kousu@server:~/src/cornerstone-demo/cornerstone3D-beta/packages/tools$ cat examples/tutorial/index.ts
import {
RenderingEngine,
Types,
Enums,
setVolumesForViewports,
volumeLoader,
} from '@cornerstonejs/core';
import {
addTool,
BrushTool,
SegmentationDisplayTool,
BidirectionalTool,
ToolGroupManager,
WindowLevelTool,
ZoomTool,
segmentation,
Enums as csToolsEnums,
} from '@cornerstonejs/tools';
import {
initDemo,
createImageIdsAndCacheMetaData,
setTitleAndDescription,
} from '../../../../utils/demo/helpers';
// This is for debugging purposes
console.warn(
'Click on index.ts to open source code for this example --------->'
);
// ============================= //
// ======== Set up page ======== //
setTitleAndDescription(
'Tutorial Playground',
'The playground for you to copy paste the codes in the tutorials and run it'
);
/**
* Runs the demo
*/
async function run() {
// Init Cornerstone and related libraries
await initDemo();
// Get Cornerstone imageIds and fetch metadata into RAM
const imageIds = await createImageIdsAndCacheMetaData({
StudyInstanceUID:
'1.3.6.1.4.1.14519.5.2.1.7009.2403.334240657131972136850343327463',
SeriesInstanceUID:
'1.3.6.1.4.1.14519.5.2.1.7009.2403.226151125820845824875394858561',
wadoRsRoot: 'https://d3t6nz73ql33tx.cloudfront.net/dicomweb',
type: 'VOLUME',
});
/**
*
*
*
*
*
*
*
*
*
* Copy-paste the code from tutorials below to try them locally.
* You can run the tutorial after by running `yarn run example tutorial` when
* you are at the root of the tools package directory.
*
*
*
*
*
*
*
*/
const content = document.getElementById('content');
const element = document.createElement('div');
element.style.width = '500px';
element.style.height = '500px';
content.appendChild(element);
const renderingEngineId = 'myRenderingEngine';
const viewportId = 'CT_AXIAL_STACK';
const renderingEngine = new RenderingEngine(renderingEngineId);
const viewportInput = {
viewportId,
element,
type: ViewportType.STACK,
};
renderingEngine.enableElement(viewportInput);
const viewport = renderingEngine.getViewport(viewportInput.viewportId);
viewport.setStack(imageIds, 60);
viewport.render()
}
run();
Install Cornerstone
yarn install
kousu@server:~/src/cornerstone-demo/cornerstone3D-beta/packages/tools$ yarn install
yarn install v1.22.19
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
[4/5] Linking dependencies...
warning " > [email protected]" has incorrect peer dependency "webpack@^2.0.0 || ^3.0.0 || ^4.0.0".
warning " > @cornerstonejs/[email protected]" has unmet peer dependency "@kitware/[email protected]".
warning " > @cornerstonejs/[email protected]" has unmet peer dependency "gl-matrix@^3.4.3".
warning " > @cornerstonejs/[email protected]" has unmet peer dependency "@kitware/[email protected]".
warning " > @cornerstonejs/[email protected]" has unmet peer dependency "@types/d3-array@^3.0.3".
warning " > @cornerstonejs/[email protected]" has unmet peer dependency "@types/d3-interpolate@^3.0.1".
warning " > @cornerstonejs/[email protected]" has unmet peer dependency "d3-array@^3.0.3".
warning " > @cornerstonejs/[email protected]" has unmet peer dependency "d3-interpolate@^3.0.1".
warning " > @cornerstonejs/[email protected]" has unmet peer dependency "gl-matrix@^3.4.3".
warning "workspace-aggregator-0a883acd-8bea-46e0-bc0c-37c7df5ed518 > @cornerstonejs/core > @kitware/[email protected]" has unmet peer dependency "wslink@^1.1.0".
warning "workspace-aggregator-0a883acd-8bea-46e0-bc0c-37c7df5ed518 > docs > [email protected]" has unmet peer dependency "cornerstone-core@^2.6.0".
warning "workspace-aggregator-0a883acd-8bea-46e0-bc0c-37c7df5ed518 > docs > [email protected]" has incorrect peer dependency "@docusaurus/core@^2.0.0".
warning "workspace-aggregator-0a883acd-8bea-46e0-bc0c-37c7df5ed518 > docs > @docusaurus/core > [email protected]" has unmet peer dependency "react-loadable@*".
warning "workspace-aggregator-0a883acd-8bea-46e0-bc0c-37c7df5ed518 > docs > @docusaurus/preset-classic > @docusaurus/theme-search-algolia > @docsearch/react > @algolia/[email protected]" has unmet peer dependency "@algolia/client-search@^4.9.1".
warning Workspaces can only be enabled in private projects.
warning Workspaces can only be enabled in private projects.
warning Workspaces can only be enabled in private projects.
[5/5] Building fresh packages...
[7/11] ⠄ canvas
[-/11] ⠄ waiting...
[6/11] ⠄ puppeteer
[-/11] ⠄ waiting...
warning Error running install script for optional dependency: "/home/kousu/src/cornerstone-demo/cornerstone3D-beta/node_modules/canvas: Command failed.
Exit code: 1
Command: node-pre-gyp install --fallback-to-build
Arguments:
Directory: /home/kousu/src/cornerstone-demo/cornerstone3D-beta/node_modules/canvas
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using [email protected]
node-pre-gyp info using [email protected] | linux | x64
node-pre-gyp info check checked for \"/home/kousu/src/cornerstone-demo/cornerstone3D-beta/node_modules/canvas/build/Release/canvas.node\" (not found)
node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.9.0/canvas-v2.9.0-node-v108-linux-glibc-x64.tar.gz
node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.9.0/canvas-v2.9.0-node-v108-linux-glibc-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v108 ABI, glibc) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.9.0/canvas-v2.9.0-node-v108-linux-glibc-x64.tar.gz
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info ok
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info find Python using Python version 3.10.6 found at \"/usr/bin/python\"
gyp http GET https://nodejs.org/download/release/v18.9.1/node-v18.9.1-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v18.9.1/node-v18.9.1-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v18.9.1/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v18.9.1/SHASUMS256.txt
(node:418858) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
(Use `node --trace-deprecation ...` to show where the warning was created)
gyp info spawn /usr/bin/python
gyp info spawn args [
gyp info spawn args '/home/kousu/src/cornerstone-demo/cornerstone3D-beta/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/home/kousu/src/cornerstone-demo/cornerstone3D-beta/node_modules/canvas/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/kousu/src/cornerstone-demo/cornerstone3D-beta/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/kousu/.cache/node-gyp/18.9.1/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/home/kousu/.cache/node-gyp/18.9.1',
gyp info spawn args '-Dnode_gyp_dir=/home/kousu/src/cornerstone-demo/cornerstone3D-beta/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/home/kousu/.cache/node-gyp/18.9.1/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/home/kousu/src/cornerstone-demo/cornerstone3D-beta/node_modules/canvas',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
Package pixman-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `pixman-1.pc'
to the PKG_CONFIG_PATH environment variable
No package 'pixman-1' found
gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/home/kousu/src/cornerstone-demo/cornerstone3D-beta/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (node:events:513:28)
gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Linux 5.15.0-48-generic
gyp ERR! command \"/usr/bin/node\" \"/home/kousu/src/cornerstone-demo/cornerstone3D-beta/node_modules/node-gyp/bin/node-gyp.js\" \"configure\" \"--fallback-to-build\" \"--module=/home/kousu/src/cornerstone-demo/cornerstone3D-beta/node_modules/canvas/build/Release/canvas.node\" \"--module_name=canvas\" \"--module_path=/home/kousu/src/cornerstone-demo/cornerstone3D-beta/node_modules/canvas/build/Release\" \"--napi_version=8\" \"--node_abi_napi=napi\" \"--napi_build_version=0\" \"--node_napi_label=node-v108\"
gyp ERR! cwd /home/kousu/src/cornerstone-demo/cornerstone3D-beta/node_modules/canvas
gyp ERR! node -v v18.9.1
gyp ERR! node-gyp -v v5.1.1
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /home/kousu/src/cornerstone-demo/cornerstone3D-beta/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/kousu/src/cornerstone-demo/cornerstone3D-beta/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/kousu/src/cornerstone-demo/cornerstone3D-beta/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)
node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/home/kousu/src/cornerstone-demo/cornerstone3D-beta/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
node-pre-gyp ERR! stack at ChildProcess.emit (node:events:513:28)
node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1091:16)
node-pre-gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:302:5)
node-pre-gyp ERR! System Linux 5.15.0-48-generic
node-pre-gyp ERR! command \"/usr/bin/node\" \"/home/kousu/src/cornerstone-demo/cornerstone3D-beta/node_modules/canvas/node_modules/.bin/node-pre-gyp\" \"install\" \"--fallback-to-build\"
node-pre-gyp ERR! cwd /home/kousu/src/cornerstone-demo/cornerstone3D-beta/node_modules/canvas
node-pre-gyp ERR! node -v v18.9.1
node-pre-gyp ERR! node-pre-gyp -v v1.0.9
node-pre-gyp ERR! not ok
Failed to execute '/usr/bin/node /home/kousu/src/cornerstone-demo/cornerstone3D-beta/node_modules/node-gyp/bin/node-gyp.js configure --f
Done in 86.67s.
It gave a bunch of compilation warnings, but it said "optional" at the top and "Done" at the bottom, so I ignored them, hoping 🤞
and now it gets further, but still doesn't render. I get a black image and a different error in my console:
decodeImageFrame.js:226 Uncaught (in promise) Error: options.preScale.scalingParameters must be defined if preScale.enabled is true, and scalingParameters cannot be derived from the metadata providers.
at decodeImageFrame.js:226:13
at decodeImageFrame.js:137:18
I followed https://www.cornerstonejs.org/docs/tutorials/intro and https://www.cornerstonejs.org/docs/tutorials/basic-stack. At least I think I did. I did:
Then I clicked the copy icon on https://www.cornerstonejs.org/docs/tutorials/basic-stack
and put it in
giving me this file
cat examples/tutorial/index.ts
yarn install
It gave a bunch of compilation warnings, but it said "optional" at the top and "Done" at the bottom, so I ignored them, hoping 🤞
npm run example tutorial
At http://localhost:3000, I have a blank screen and an error in my console:
Indeed, it doesn't seem like https://www.cornerstonejs.org/docs/tutorials/basic-stack ever imports
ViewportType
.Versions
The text was updated successfully, but these errors were encountered: