Skip to content

Commit e38c066

Browse files
swederikdannyrbsedghi
authored
feat(codecs, loadImage): Switch to WASM Codecs, use image load into distinct 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 <danny.ri.brown@gmail.com> Co-authored-by: Alireza <ar.sedghi@gmail.com>
1 parent 8135e0b commit e38c066

File tree

111 files changed

+10471
-13400
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+10471
-13400
lines changed

.browserslistrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Browsers that we support
2+
3+
> 1%
4+
IE 11
5+
not dead
6+
not op_mini all

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
steps:
3737
- attach_workspace:
3838
at: ~/repo
39-
- run: npm run build && npm run test
39+
- run: npm run build && npm run test:ci
4040
# https://circleci.com/docs/2.0/collect-test-data/#karma
4141
# - store_test_results:
4242
# path: reports/junit

.eslintrc.js

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@ module.exports = {
1414
globals: {
1515
jpeg: true,
1616
JpegImage: true,
17-
JpxImage: true,
18-
CharLS: true,
19-
OpenJPEG: true,
2017
SharedArrayBuffer: true,
2118
},
2219
rules: {
20+
'no-debugger': 'off',
2321
'accessor-pairs': 'warn',
2422
'array-bracket-spacing': 'warn',
2523
'array-callback-return': 'warn',
@@ -86,6 +84,7 @@ module.exports = {
8684
'no-catch-shadow': 'warn',
8785
'no-confusing-arrow': 'warn',
8886
'no-console': 'off',
87+
'no-debugger': 'off',
8988
'no-div-regex': 'warn',
9089
'no-duplicate-imports': 'warn',
9190
'no-else-return': 'warn',
@@ -116,19 +115,19 @@ module.exports = {
116115
'no-negated-condition': 'warn',
117116
'no-negated-in-lhs': 'warn',
118117
'no-nested-ternary': 'warn',
119-
//'no-new': 'warn',
118+
// 'no-new': 'warn',
120119
'no-new-func': 'warn',
121120
'no-new-object': 'warn',
122121
'no-new-require': 'warn',
123122
'no-new-wrappers': 'warn',
124123
'no-octal-escape': 'warn',
125-
//'no-param-reassign': 'warn',
124+
// 'no-param-reassign': 'warn',
126125
'no-path-concat': 'warn',
127-
//'no-plusplus': 'warn',
126+
// 'no-plusplus': 'warn',
128127
'no-process-env': 'warn',
129128
'no-process-exit': 'warn',
130129
'no-proto': 'warn',
131-
//'no-prototype-builtins': 'warn',
130+
// 'no-prototype-builtins': 'warn',
132131
'no-restricted-globals': 'warn',
133132
'no-restricted-imports': 'warn',
134133
'no-restricted-modules': 'warn',
@@ -139,7 +138,7 @@ module.exports = {
139138
'no-script-url': 'warn',
140139
'no-self-compare': 'warn',
141140
'no-sequences': 'warn',
142-
//'no-shadow': 'warn',
141+
// 'no-shadow': 'warn',
143142
'no-shadow-restricted-names': 'warn',
144143
'no-spaced-func': 'warn',
145144
'no-sync': 'warn',
@@ -152,11 +151,11 @@ module.exports = {
152151
'no-undef-init': 'warn',
153152
'no-undefined': 'off',
154153
'no-unused-vars': 'warn',
155-
//'no-underscore-dangle': 'warn',
154+
// 'no-underscore-dangle': 'warn',
156155
'no-unmodified-loop-condition': 'warn',
157156
'no-unneeded-ternary': 'warn',
158157
'no-unused-expressions': 'warn',
159-
//'no-use-before-define': 'warn',
158+
// 'no-use-before-define': 'warn',
160159
'no-useless-call': 'warn',
161160
'no-useless-computed-key': 'warn',
162161
'no-useless-concat': 'warn',
@@ -166,7 +165,7 @@ module.exports = {
166165
'no-useless-return': 'off',
167166
'no-var': 'warn',
168167
'no-void': 'warn',
169-
//'no-warning-comments': 'warn',
168+
// 'no-warning-comments': 'warn',
170169
'no-whitespace-before-property': 'warn',
171170
'no-with': 'warn',
172171
'object-curly-spacing': ['warn', 'always'],
@@ -180,15 +179,15 @@ module.exports = {
180179
'prefer-arrow-callback': 'off',
181180
'prefer-const': 'warn',
182181
'prefer-numeric-literals': 'warn',
183-
//'prefer-reflect': 'warn',
184-
//'prefer-rest-params': 'warn',
182+
// 'prefer-reflect': 'warn',
183+
// 'prefer-rest-params': 'warn',
185184
'prefer-spread': 'warn',
186185
'prefer-template': 'warn',
187186
'quote-props': ['warn', 'as-needed'],
188187
quotes: ['warn', 'single'],
189188
radix: 'warn',
190-
'require-await': 'warn',
191-
//'require-jsdoc': 'warn',
189+
'require-await': 'off',
190+
// 'require-jsdoc': 'warn',
192191
'rest-spread-spacing': 'warn',
193192
semi: 'warn',
194193
'semi-spacing': 'warn',
@@ -199,12 +198,12 @@ module.exports = {
199198
'space-in-parens': ['warn', 'never'],
200199
'space-infix-ops': 'warn',
201200
'space-unary-ops': 'warn',
202-
'spaced-comment': 'warn',
201+
'spaced-comment': 'off',
203202
strict: 'warn',
204203
'symbol-description': 'warn',
205204
'template-curly-spacing': 'warn',
206205
'unicode-bom': ['warn', 'never'],
207-
//'valid-jsdoc': 'warn',
206+
// 'valid-jsdoc': 'warn',
208207
'vars-on-top': 'warn',
209208
'wrap-iife': ['warn', 'inside'],
210209
'wrap-regex': 'warn',

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Directorties
1+
## Directories
22
node_modules/
33
coverage/
44
documentation/
@@ -8,4 +8,4 @@ dist/
88
npm-debug.log
99
.idea
1010
.DS_Store
11-
yarn.lock
11+
yarn.lock

babel.config.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
{
2-
"presets": [["@babel/preset-env"]],
3-
"plugins": ["@babel/plugin-proposal-object-rest-spread"]
2+
"presets": ["@babel/preset-env"],
3+
"plugins": [
4+
["@babel/plugin-proposal-object-rest-spread"],
5+
["@babel/plugin-transform-runtime",
6+
{
7+
"regenerator": true,
8+
"corejs": 3
9+
}]
10+
]
411
}

codecs/charLS-FixedMemory-browser.js

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)