Skip to content

Commit

Permalink
feat(codecs, loadImage): Switch to WASM Codecs, use image load into d…
Browse files Browse the repository at this point in the history
…istinct queues for retrievals and decoding (#394)

* jest tests

* starting to commit @dannyrb's changes

* add example data

* wip

* wip

* chore: minor cleanup for Promises

* get tests working (except one jpegbaseline test)

* chore: Remove usePDFJS option. Start migrating to Webpack 5

* almost working

* tests work, example works for everything except libjpeg-turbo

* cleanup old uses of regeneratorRuntime

* wip

* fixes after rebase

* commented out wip attempting to build an ESM version. Giving up for now

* wip trying to get it working in OHIF

* fix wrong import in libjpeg-turbo

* wasm working in OHIF hooray

* Make a separate entrypoint for useWebWorkers: false and remove it from config

* fix: deflate support via pako, eslint fixes

* fix: Upgrade to dicom-parser 1.8.8 to fix deflate usage

* fix tests, not sure why deleting charls instance breaks them...

* fix: Clean up WASM Memory usage. Update to decode-only versions of codecs

* tests: switch to ChromeHeadless

* tests: re-include deflate test

* chore: fix renamed tests to revert jest changes

* chore: cleanup unused code, rename function in decodeImageFrame

* chore: fix initializeCodecsOnStartup

* chore: cleanup unnecessary changes

* fix package-lock

* fix circle builds

* ci: add netlify.toml

* fix cp command

* fix urls in examples

* fix: beforeSend headers merge with default headers

* fix: Switch back to jpeg.js for 12 bit jpeg baseline images for now, at least until WASM build is ready

* upgrade package dependencies, add bundle version for package distribution

* eslint in tests

* fixes for bundle and dynamic import builds, everything seems to be working

* mark as v4.0.0-rc1

* fix prepublish

* fix: add empty publicPath string to prevent test failures in downstream libraries

* bump to v4.0.0-rc2

* fix examples and dev server usage

* try to fix script tag usage

* fix: correct path in dicomfile example

* move some codecs to dynamic imports

* bump to v4.0.0-rc3

* wip on splitting loading into two queues

* fix splitting

* chore: use IMAGE_LOAD_PROGRESS event, remove warning

* perf(loadimage): use imageRetrievalPool from cornerstone-core when retrieving images

BREAKING CHANGE: An external dependency must be updated to a higher version.

Co-authored-by: dannyrb <[email protected]>
Co-authored-by: Alireza <[email protected]>
  • Loading branch information
3 people authored Sep 15, 2021
1 parent 8135e0b commit e38c066
Show file tree
Hide file tree
Showing 111 changed files with 10,471 additions and 13,400 deletions.
6 changes: 6 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Browsers that we support

> 1%
IE 11
not dead
not op_mini all
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
steps:
- attach_workspace:
at: ~/repo
- run: npm run build && npm run test
- run: npm run build && npm run test:ci
# https://circleci.com/docs/2.0/collect-test-data/#karma
# - store_test_results:
# path: reports/junit
Expand Down
33 changes: 16 additions & 17 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ module.exports = {
globals: {
jpeg: true,
JpegImage: true,
JpxImage: true,
CharLS: true,
OpenJPEG: true,
SharedArrayBuffer: true,
},
rules: {
'no-debugger': 'off',
'accessor-pairs': 'warn',
'array-bracket-spacing': 'warn',
'array-callback-return': 'warn',
Expand Down Expand Up @@ -86,6 +84,7 @@ module.exports = {
'no-catch-shadow': 'warn',
'no-confusing-arrow': 'warn',
'no-console': 'off',
'no-debugger': 'off',
'no-div-regex': 'warn',
'no-duplicate-imports': 'warn',
'no-else-return': 'warn',
Expand Down Expand Up @@ -116,19 +115,19 @@ module.exports = {
'no-negated-condition': 'warn',
'no-negated-in-lhs': 'warn',
'no-nested-ternary': 'warn',
//'no-new': 'warn',
// 'no-new': 'warn',
'no-new-func': 'warn',
'no-new-object': 'warn',
'no-new-require': 'warn',
'no-new-wrappers': 'warn',
'no-octal-escape': 'warn',
//'no-param-reassign': 'warn',
// 'no-param-reassign': 'warn',
'no-path-concat': 'warn',
//'no-plusplus': 'warn',
// 'no-plusplus': 'warn',
'no-process-env': 'warn',
'no-process-exit': 'warn',
'no-proto': 'warn',
//'no-prototype-builtins': 'warn',
// 'no-prototype-builtins': 'warn',
'no-restricted-globals': 'warn',
'no-restricted-imports': 'warn',
'no-restricted-modules': 'warn',
Expand All @@ -139,7 +138,7 @@ module.exports = {
'no-script-url': 'warn',
'no-self-compare': 'warn',
'no-sequences': 'warn',
//'no-shadow': 'warn',
// 'no-shadow': 'warn',
'no-shadow-restricted-names': 'warn',
'no-spaced-func': 'warn',
'no-sync': 'warn',
Expand All @@ -152,11 +151,11 @@ module.exports = {
'no-undef-init': 'warn',
'no-undefined': 'off',
'no-unused-vars': 'warn',
//'no-underscore-dangle': 'warn',
// 'no-underscore-dangle': 'warn',
'no-unmodified-loop-condition': 'warn',
'no-unneeded-ternary': 'warn',
'no-unused-expressions': 'warn',
//'no-use-before-define': 'warn',
// 'no-use-before-define': 'warn',
'no-useless-call': 'warn',
'no-useless-computed-key': 'warn',
'no-useless-concat': 'warn',
Expand All @@ -166,7 +165,7 @@ module.exports = {
'no-useless-return': 'off',
'no-var': 'warn',
'no-void': 'warn',
//'no-warning-comments': 'warn',
// 'no-warning-comments': 'warn',
'no-whitespace-before-property': 'warn',
'no-with': 'warn',
'object-curly-spacing': ['warn', 'always'],
Expand All @@ -180,15 +179,15 @@ module.exports = {
'prefer-arrow-callback': 'off',
'prefer-const': 'warn',
'prefer-numeric-literals': 'warn',
//'prefer-reflect': 'warn',
//'prefer-rest-params': 'warn',
// 'prefer-reflect': 'warn',
// 'prefer-rest-params': 'warn',
'prefer-spread': 'warn',
'prefer-template': 'warn',
'quote-props': ['warn', 'as-needed'],
quotes: ['warn', 'single'],
radix: 'warn',
'require-await': 'warn',
//'require-jsdoc': 'warn',
'require-await': 'off',
// 'require-jsdoc': 'warn',
'rest-spread-spacing': 'warn',
semi: 'warn',
'semi-spacing': 'warn',
Expand All @@ -199,12 +198,12 @@ module.exports = {
'space-in-parens': ['warn', 'never'],
'space-infix-ops': 'warn',
'space-unary-ops': 'warn',
'spaced-comment': 'warn',
'spaced-comment': 'off',
strict: 'warn',
'symbol-description': 'warn',
'template-curly-spacing': 'warn',
'unicode-bom': ['warn', 'never'],
//'valid-jsdoc': 'warn',
// 'valid-jsdoc': 'warn',
'vars-on-top': 'warn',
'wrap-iife': ['warn', 'inside'],
'wrap-regex': 'warn',
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Directorties
## Directories
node_modules/
coverage/
documentation/
Expand All @@ -8,4 +8,4 @@ dist/
npm-debug.log
.idea
.DS_Store
yarn.lock
yarn.lock
11 changes: 9 additions & 2 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{
"presets": [["@babel/preset-env"]],
"plugins": ["@babel/plugin-proposal-object-rest-spread"]
"presets": ["@babel/preset-env"],
"plugins": [
["@babel/plugin-proposal-object-rest-spread"],
["@babel/plugin-transform-runtime",
{
"regenerator": true,
"corejs": 3
}]
]
}
32 changes: 0 additions & 32 deletions codecs/charLS-FixedMemory-browser.js

This file was deleted.

Loading

0 comments on commit e38c066

Please sign in to comment.