@cornerstonejs/dicom-image-loader 4.0.0-beta.2 → 4.0.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -37,7 +37,7 @@ export default function rangeRequest(url, imageId, defaultHeaders = {}, options
|
|
|
37
37
|
const extract = extractMultipart(contentType, encodedData, {
|
|
38
38
|
isPartial: true,
|
|
39
39
|
});
|
|
40
|
-
const imageQualityStatus = getImageQualityStatus(retrieveOptions, doneAllBytes || extract.extractDone);
|
|
40
|
+
const imageQualityStatus = getImageQualityStatus(retrieveOptions, doneAllBytes || extract.extractDone === true);
|
|
41
41
|
resolve({
|
|
42
42
|
...extract,
|
|
43
43
|
imageQualityStatus,
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
const local = {
|
|
2
|
-
|
|
2
|
+
DecoderClass: undefined,
|
|
3
3
|
decodeConfig: {},
|
|
4
4
|
};
|
|
5
5
|
export function initialize(decodeConfig) {
|
|
6
6
|
local.decodeConfig = decodeConfig;
|
|
7
|
-
if (local.
|
|
7
|
+
if (local.DecoderClass) {
|
|
8
8
|
return Promise.resolve();
|
|
9
9
|
}
|
|
10
10
|
return new Promise((resolve, reject) => {
|
|
11
11
|
import('jpeg-lossless-decoder-js').then(({ Decoder }) => {
|
|
12
|
-
|
|
13
|
-
local.jpeg = decoder;
|
|
12
|
+
local.DecoderClass = Decoder;
|
|
14
13
|
resolve();
|
|
15
14
|
}, reject);
|
|
16
15
|
});
|
|
17
16
|
}
|
|
18
17
|
async function decodeJPEGLossless(imageFrame, pixelData) {
|
|
19
18
|
await initialize();
|
|
20
|
-
if (typeof local.
|
|
19
|
+
if (typeof local.DecoderClass === 'undefined') {
|
|
21
20
|
throw new Error('No JPEG Lossless decoder loaded');
|
|
22
21
|
}
|
|
22
|
+
const decoder = new local.DecoderClass();
|
|
23
23
|
const byteOutput = imageFrame.bitsAllocated <= 8 ? 1 : 2;
|
|
24
24
|
const buffer = pixelData.buffer;
|
|
25
|
-
const decompressedData =
|
|
25
|
+
const decompressedData = decoder.decode(buffer, pixelData.byteOffset, pixelData.length, byteOutput);
|
|
26
26
|
if (imageFrame.pixelRepresentation === 0) {
|
|
27
27
|
if (imageFrame.bitsAllocated === 16) {
|
|
28
28
|
imageFrame.pixelData = new Uint16Array(decompressedData.buffer);
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "
|
|
1
|
+
export declare const version = "4.0.0-beta.4";
|
package/dist/esm/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '
|
|
1
|
+
export const version = '4.0.0-beta.4';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/dicom-image-loader",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.4",
|
|
4
4
|
"description": "Cornerstone Image Loader for DICOM WADO-URI and WADO-RS and Local file",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"DICOM",
|
|
@@ -74,7 +74,6 @@
|
|
|
74
74
|
"copy-dts": "echo 'not implemented yet'",
|
|
75
75
|
"clean": "shx rm -rf dist",
|
|
76
76
|
"clean:deep": "yarn run clean && shx rm -rf node_modules",
|
|
77
|
-
"format-check": "npx eslint ./src --quiet",
|
|
78
77
|
"api-check": "api-extractor --debug run ",
|
|
79
78
|
"cm": "npx git-cz",
|
|
80
79
|
"clean:dist": "shx rm -rf dist",
|
|
@@ -83,10 +82,7 @@
|
|
|
83
82
|
"doc": "npm run doc:generate && opn documentation/index.html",
|
|
84
83
|
"doc:generate": "npm run clean:docs && jsdoc -c .jsdocrc",
|
|
85
84
|
"dev": "tsc --project ./tsconfig.json --watch",
|
|
86
|
-
"
|
|
87
|
-
"eslint-quiet": "eslint -c .eslintrc.js --quiet src",
|
|
88
|
-
"eslint-fix": "eslint -c .eslintrc.js --fix src",
|
|
89
|
-
"eslint-fix-test": "eslint -c .eslintrc.js --fix test",
|
|
85
|
+
"lint": "oxlint .",
|
|
90
86
|
"start": "npm run webpack:dev",
|
|
91
87
|
"start:dev": "webpack-dev-server --config .webpack/webpack-dev",
|
|
92
88
|
"test": "npm run test:chrome",
|
|
@@ -116,19 +112,13 @@
|
|
|
116
112
|
"uuid": "^9.0.0"
|
|
117
113
|
},
|
|
118
114
|
"peerDependencies": {
|
|
119
|
-
"@cornerstonejs/core": "^
|
|
115
|
+
"@cornerstonejs/core": "^4.0.0-beta.4",
|
|
120
116
|
"dicom-parser": "^1.8.9"
|
|
121
117
|
},
|
|
122
|
-
"lint-staged": {
|
|
123
|
-
"src/**/*.{js,jsx,json,css}": [
|
|
124
|
-
"eslint --fix",
|
|
125
|
-
"prettier --write",
|
|
126
|
-
"git add"
|
|
127
|
-
]
|
|
128
|
-
},
|
|
129
118
|
"config": {
|
|
130
119
|
"commitizen": {
|
|
131
120
|
"path": "./node_modules/cz-conventional-changelog"
|
|
132
121
|
}
|
|
133
|
-
}
|
|
122
|
+
},
|
|
123
|
+
"gitHead": "bd2215216a08cc0c953c6523b16892b3aee6f9be"
|
|
134
124
|
}
|