Skip to content

Commit

Permalink
feat: cpu fallback for rendering stack viewports (#315)
Browse files Browse the repository at this point in the history
* Stub out all paths and move things around to get us set up for CPU rendering

* Basic skeleton framework set up for cpu fallback

* WIP seperate enableing/resizing for non VTK driven vps

* Feat/dev cpu fallback resizing (#296)

* WIP splitting up viewports

* First itteration seems solid

* Make suggested changes

* Feat/dev cpu fallback cs2d pipeline (#297)

* WIP splitting up viewports

* First itteration seems solid

* Grayscale pipeline working for default image

* feat: Add world to canvas and imageData computations for CPU fallback (#298)

* feat: add world2canvas and canvas2world

* renamed files from js to ts

* feat: make annotation tool work for length

* feat: make other annotation tools work

Co-authored-by: Alireza <[email protected]>

* feat: Add detect webgl context (#294)

* feat: Add detect webgl context

* feat: add init for cs-render

* remaining files

* fix: demos with init

* feat: add manually setting cpu rendering

* feat: add set and get methods to init

* Feat/dev cpu fallback rgb (#299)

* WIP color stack

* Fix web image loaders usage with the StackViewport

* Get RGB images rendering using CPU Fallback

* WIP pseudocolor

* Working false color

* remove all layers stuff

* Add remaining file which I didn't save

Co-authored-by: Alireza <[email protected]>

* Fix/annotations cpu (#300)

* fix: tests for initialize cornerstone and vtkimagedata change

* yarn lock

* fix: worldToCanvas error for pixel calculation (#301)

* Feat/cpu maniputlation canvas (#302)

* fix: performance issue with cpu getImageData

* feat: breaks setProperties into cpu and gpu implementation

* wip for refactoring window level

* feat: Add window level to cpu

* feat: Add rotation and invert

* feat: Add reset properties

* feat: Add zoom tool for cpu

* feat: Add pan tool for cpu

* fix: pan and zoom tool sensitivity

* fix: worldToCanvas for cpu

* feat: fix interoplationType

* fix: maintain viewport on same stack only

* removed unnecessary flag for camera

* trying to fix the ci while not breaking dcmjs

* Revert new properties added to ICamera and update adapter to work with existing interface

Co-authored-by: James A. Petts <[email protected]>

* Split example and WIP cleanup types (#303)

* Cleanup rendering engine (#304)

* bump minor versions (#305)

* Feat/cpu fallback tests (#306)

* renamed files

* feat: add cpu rendering tests and promisify stackViewport

* fix: windowlevel bug for volumeUID

* feat: Add tests for cornerstoneTools and cpu

* feat: Add flip to cpu viewport

* feat: Add camera resize

* feat: Add camera reset

* fix: tests

* apply review comments

* apply review comments

* feat: Add resetPanZoom for resetCamera for cpu

* stack viewport set properties api

* fix: rotation and interpolation

* fix: horizontal flip for cpu

* fix: horizontal flip for gpu

* fix: tests for stack viewport

* Feat/dev cpu fallback build (#309)

* fix various build errors

* fix default voi

* finished types

* fix: tests

* Fix/gpu flip (#310)

* work in progress

* fix: fixed transformation for flipTx

* feat: Add tests for gpu flip

* fix: build error

* fix: voluem viewport flip

* apply review comments

* PET rendering with CPU fallback using LUT function instead of LUT table (#308)

* Sets PET WL to 0-5 SUV, adds PET to list on CPU stack viewport fallback

* Super simple POC for rendering images

* Add todo comments for alireza

* Add comments

* remaining fixes from rebase

* fix: petThreshold tool for window leveling

* fix: probe tool for scaling pt cpu

* fix: demo to reset tool with different stack

* feat: add invert for pt cpu

* feat: add false colormap to pt

* apply review comments

* fix tests

Co-authored-by: James A. Petts <[email protected]>

* feat: add detect-gpu to init (#311)

* feat: add detect-gpu to init

* reducing the tier for testing

* fix tests

* fix: remove offCanvas div in cpu demo

* bump docusaurus version

* fix docusaurus broken links

Co-authored-by: James A. Petts <[email protected]>
  • Loading branch information
2 people authored and swederik committed Mar 21, 2022
1 parent 6374316 commit 9ed4425
Show file tree
Hide file tree
Showing 165 changed files with 22,497 additions and 10,639 deletions.
97 changes: 49 additions & 48 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
"docs:watch": "lerna run docs:watch",
"preinstall": "node preinstall.js",
"start": "yarn run dev",
"test": "NODE_ENV=test karma start",
"test:firefox": "karma start ./karma.conf.js --browsers Firefox",
"test:dev": "karma start",
"test:ci": "karma start --single-run",
"test": "karma start",
"lint-staged": "lint-staged",
"lint": "eslint --quiet -c .eslintrc.json packages/**/src",
"predeploy": "yarn install && yarn run build:release",
Expand All @@ -30,75 +31,75 @@
"lodash.isequal": "^4.5.0"
},
"devDependencies": {
"@babel/core": "^7.13.10",
"@babel/plugin-external-helpers": "^7.12.13",
"@babel/plugin-proposal-class-properties": "^7.13.0",
"@babel/plugin-transform-runtime": "^7.13.10",
"@babel/preset-env": "^7.13.12",
"@babel/preset-react": "^7.12.13",
"@babel/preset-typescript": "^7.13.0",
"@babel/runtime": "^7.13.10",
"@types/node": "^14.14.36",
"@types/react": "^17.0.3",
"@types/react-dom": "^17.0.3",
"@typescript-eslint/eslint-plugin": "^4.19.0",
"@typescript-eslint/parser": "^4.19.0",
"autoprefixer": "^10.2.5",
"babel-loader": "8.2.2",
"babel-plugin-istanbul": "^6.0.0",
"@babel/core": "^7.16.12",
"@babel/plugin-external-helpers": "^7.16.7",
"@babel/plugin-proposal-class-properties": "^7.16.7",
"@babel/plugin-transform-runtime": "^7.16.10",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"@babel/preset-typescript": "^7.16.7",
"@babel/runtime": "^7.16.7",
"@types/node": "^14.18.9",
"@types/react": "^17.0.38",
"@types/react-dom": "^17.0.11",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"autoprefixer": "^10.4.2",
"babel-loader": "8.2.3",
"babel-plugin-istanbul": "^6.1.1",
"calculate-suv": "git+ssh://[email protected]/PrecisionMetrics/calculate-suv.git#main",
"chai": "^4.3.4",
"chai": "^4.3.6",
"clean-webpack-plugin": "^3.0.0",
"copy-webpack-plugin": "^8.1.0",
"copy-webpack-plugin": "^8.1.1",
"cornerstone-wado-image-loader": "^3.3.2",
"cross-env": "^7.0.3",
"css-loader": "^5.2.0",
"cssnano": "^4.1.10",
"eslint": "7.22.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-import": "^2.22.1",
"css-loader": "^5.2.7",
"cssnano": "^4.1.11",
"eslint": "7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jsx-a11y": "6.x",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-tsdoc": "^0.2.11",
"eslint-webpack-plugin": "^2.5.3",
"eslint-plugin-prettier": "^3.4.1",
"eslint-plugin-tsdoc": "^0.2.14",
"eslint-webpack-plugin": "^2.6.0",
"file-loader": "^6.2.0",
"html-webpack-plugin": "^5.3.1",
"husky": "^4.3.6",
"html-webpack-plugin": "^5.5.0",
"husky": "^4.3.8",
"istanbul-instrumenter-loader": "^3.0.1",
"jasmine": "^3.7.0",
"karma": "^6.3.2",
"jasmine": "^3.99.0",
"karma": "^6.3.12",
"karma-chrome-launcher": "^3.1.0",
"karma-coverage": "^2.0.3",
"karma-coverage": "^2.1.0",
"karma-coverage-istanbul-reporter": "^3.0.3",
"karma-jasmine": "^4.0.1",
"karma-junit-reporter": "^2.0.1",
"karma-spec-reporter": "0.0.32",
"karma-spec-reporter": "0.0.33",
"karma-webpack": "^5.0.0",
"lerna": "^4.0.0",
"lint-staged": "^10.5.4",
"path-browserify": "^1.0.1",
"postcss": "^8.2.8",
"postcss-import": "^14.0.0",
"postcss-loader": "^5.2.0",
"postcss": "^8.4.5",
"postcss-import": "^14.0.2",
"postcss-loader": "^5.3.0",
"postcss-preset-env": "^6.7.0",
"prettier": "^2.2.1",
"prop-types": "^15.7.2",
"puppeteer": "^10.1.0",
"prettier": "^2.5.1",
"prop-types": "^15.8.1",
"puppeteer": "^10.4.0",
"shader-loader": "^1.3.1",
"sinon": "^10.0.0",
"style-loader": "^2.0.0",
"stylelint": "^13.12.0",
"stylelint": "^13.13.1",
"stylelint-config-recommended": "^4.0.0",
"ts-loader": "^9.1.2",
"typedoc": "^0.21.4",
"ts-loader": "^9.2.6",
"typedoc": "^0.22.11",
"typedoc-plugin-pages-fork": "^0.0.1",
"typescript": "4.1.5",
"typescript": "4.5.5",
"url-loader": "^4.1.1",
"webpack": "5.28.0",
"webpack-bundle-analyzer": "^4.4.0",
"webpack-cli": "^4.6.0",
"webpack-dev-server": "^3.11.2",
"webpack-merge": "5.7.3",
"webpack": "5.67.0",
"webpack-bundle-analyzer": "^4.5.0",
"webpack-cli": "^4.9.2",
"webpack-dev-server": "^3.11.3",
"webpack-merge": "5.8.0",
"worker-loader": "^3.0.8"
},
"husky": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export default class StreamingImageVolume extends ImageVolume {
const {
imageIds,
vtkOpenGLTexture,
vtkImageData,
imageData,
metadata,
uid: volumeUID,
} = this
Expand Down Expand Up @@ -243,7 +243,7 @@ export default class StreamingImageVolume extends ImageVolume {
framesProcessed++

vtkOpenGLTexture.setUpdatedFrame(imageIdIndex)
vtkImageData.modified()
imageData.modified()

const eventData = {
FrameOfReferenceUID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ function createImage(image, imageId) {
width: columns,
color: true,
rgba: false,
columnPixelSpacing: undefined,
rowPixelSpacing: undefined,
columnPixelSpacing: 1, // for web it's always 1
rowPixelSpacing: 1, // for web it's always 1
invert: false,
sizeInBytes: rows * columns * 4,
}
Expand Down Expand Up @@ -218,7 +218,12 @@ function _loadImageIntoBuffer(
loadImage(uri, imageId)
.promise.then(
(image: cornerstone.Types.IImage) => {
if (!options || !options.targetBuffer) {
if (
!options ||
!options.targetBuffer ||
!options.targetBuffer.length ||
!options.targetBuffer.offset
) {
resolve(image)
return
}
Expand Down
Loading

0 comments on commit 9ed4425

Please sign in to comment.