@cornerstonejs/dicom-image-loader 2.19.13 → 2.19.15
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.
- package/dist/esm/imageLoader/createImage.js +3 -29
- package/dist/esm/imageLoader/index.d.ts +10 -0
- package/dist/esm/imageLoader/index.js +10 -0
- package/dist/esm/imageLoader/isModalityLutForDisplay.d.ts +2 -0
- package/dist/esm/imageLoader/isModalityLutForDisplay.js +5 -0
- package/dist/esm/imageLoader/removeAFromRGBA.d.ts +3 -0
- package/dist/esm/imageLoader/removeAFromRGBA.js +13 -0
- package/dist/esm/imageLoader/setPixelDataType.d.ts +2 -0
- package/dist/esm/imageLoader/setPixelDataType.js +14 -0
- package/package.json +3 -3
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import getMinMax from '../shared/getMinMax';
|
|
2
|
-
import getPixelDataTypeFromMinMax from '../shared/getPixelDataTypeFromMinMax';
|
|
3
2
|
import { canRenderFloatTextures, Enums, metaData, utilities, } from '@cornerstonejs/core';
|
|
4
3
|
import convertColorSpace from './convertColorSpace';
|
|
5
4
|
import isColorConversionRequired from './isColorConversionRequired';
|
|
@@ -8,35 +7,10 @@ import getImageFrame from './getImageFrame';
|
|
|
8
7
|
import getScalingParameters from './getScalingParameters';
|
|
9
8
|
import { getOptions } from './internal/options';
|
|
10
9
|
import isColorImageFn from '../shared/isColorImage';
|
|
10
|
+
import removeAFromRGBA from './removeAFromRGBA';
|
|
11
|
+
import isModalityLUTForDisplay from './isModalityLutForDisplay';
|
|
12
|
+
import setPixelDataType from './setPixelDataType';
|
|
11
13
|
let lastImageIdDrawn = '';
|
|
12
|
-
function isModalityLUTForDisplay(sopClassUid) {
|
|
13
|
-
return (sopClassUid !== '1.2.840.10008.5.1.4.1.1.12.1' &&
|
|
14
|
-
sopClassUid !== '1.2.840.10008.5.1.4.1.1.12.2.1');
|
|
15
|
-
}
|
|
16
|
-
function setPixelDataType(imageFrame) {
|
|
17
|
-
const minValue = imageFrame.smallestPixelValue;
|
|
18
|
-
const maxValue = imageFrame.largestPixelValue;
|
|
19
|
-
const TypedArray = getPixelDataTypeFromMinMax(minValue, maxValue);
|
|
20
|
-
if (TypedArray) {
|
|
21
|
-
const typedArray = new TypedArray(imageFrame.pixelData);
|
|
22
|
-
imageFrame.pixelData = typedArray;
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
throw new Error('Could not apply a typed array to the pixel data');
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
function removeAFromRGBA(pixelData, targetBuffer) {
|
|
29
|
-
const numPixels = pixelData.length / 4;
|
|
30
|
-
let rgbIndex = 0;
|
|
31
|
-
let bufferIndex = 0;
|
|
32
|
-
for (let i = 0; i < numPixels; i++) {
|
|
33
|
-
targetBuffer[bufferIndex++] = pixelData[rgbIndex++];
|
|
34
|
-
targetBuffer[bufferIndex++] = pixelData[rgbIndex++];
|
|
35
|
-
targetBuffer[bufferIndex++] = pixelData[rgbIndex++];
|
|
36
|
-
rgbIndex++;
|
|
37
|
-
}
|
|
38
|
-
return targetBuffer;
|
|
39
|
-
}
|
|
40
14
|
function createImage(imageId, pixelData, transferSyntax, options = {}) {
|
|
41
15
|
const useRGBA = options.useRGBA;
|
|
42
16
|
options.preScale = {
|
|
@@ -10,6 +10,11 @@ import { default as getMinMax } from '../shared/getMinMax';
|
|
|
10
10
|
import { default as isColorImage } from '../shared/isColorImage';
|
|
11
11
|
import { default as isJPEGBaseline8BitColor } from './isJPEGBaseline8BitColor';
|
|
12
12
|
import { default as getPixelData } from './wadors/getPixelData';
|
|
13
|
+
import { default as getScalingParameters } from './getScalingParameters';
|
|
14
|
+
import { default as isColorConversionRequired } from './isColorConversionRequired';
|
|
15
|
+
import { default as removeAFromRGBA } from './removeAFromRGBA';
|
|
16
|
+
import { default as isModalityLUTForDisplay } from './isModalityLutForDisplay';
|
|
17
|
+
import { default as setPixelDataType } from './setPixelDataType';
|
|
13
18
|
import { internal } from './internal/index';
|
|
14
19
|
declare const cornerstoneDICOMImageLoader: {
|
|
15
20
|
convertRGBColorByPixel: typeof convertRGBColorByPixel;
|
|
@@ -80,6 +85,11 @@ declare const cornerstoneDICOMImageLoader: {
|
|
|
80
85
|
getMinMax: typeof getMinMax;
|
|
81
86
|
isColorImage: typeof isColorImage;
|
|
82
87
|
isJPEGBaseline8BitColor: typeof isJPEGBaseline8BitColor;
|
|
88
|
+
getScalingParameters: typeof getScalingParameters;
|
|
89
|
+
isColorConversionRequired: typeof isColorConversionRequired;
|
|
90
|
+
removeAFromRGBA: typeof removeAFromRGBA;
|
|
91
|
+
isModalityLUTForDisplay: typeof isModalityLUTForDisplay;
|
|
92
|
+
setPixelDataType: typeof setPixelDataType;
|
|
83
93
|
internal: {
|
|
84
94
|
xhrRequest: typeof import("./internal/xhrRequest").default;
|
|
85
95
|
streamRequest: typeof import("./internal/streamRequest").default;
|
|
@@ -10,6 +10,11 @@ import { default as getMinMax } from '../shared/getMinMax';
|
|
|
10
10
|
import { default as isColorImage } from '../shared/isColorImage';
|
|
11
11
|
import { default as isJPEGBaseline8BitColor } from './isJPEGBaseline8BitColor';
|
|
12
12
|
import { default as getPixelData } from './wadors/getPixelData';
|
|
13
|
+
import { default as getScalingParameters } from './getScalingParameters';
|
|
14
|
+
import { default as isColorConversionRequired } from './isColorConversionRequired';
|
|
15
|
+
import { default as removeAFromRGBA } from './removeAFromRGBA';
|
|
16
|
+
import { default as isModalityLUTForDisplay } from './isModalityLutForDisplay';
|
|
17
|
+
import { default as setPixelDataType } from './setPixelDataType';
|
|
13
18
|
import { internal } from './internal/index';
|
|
14
19
|
const cornerstoneDICOMImageLoader = {
|
|
15
20
|
convertRGBColorByPixel,
|
|
@@ -28,6 +33,11 @@ const cornerstoneDICOMImageLoader = {
|
|
|
28
33
|
getMinMax,
|
|
29
34
|
isColorImage,
|
|
30
35
|
isJPEGBaseline8BitColor,
|
|
36
|
+
getScalingParameters,
|
|
37
|
+
isColorConversionRequired,
|
|
38
|
+
removeAFromRGBA,
|
|
39
|
+
isModalityLUTForDisplay,
|
|
40
|
+
setPixelDataType,
|
|
31
41
|
internal,
|
|
32
42
|
};
|
|
33
43
|
export { convertRGBColorByPixel, convertRGBColorByPlane, convertYBRFullByPixel, convertYBRFullByPlane, convertPALETTECOLOR, wadouri, wadors, init, convertColorSpace, createImage, decodeJPEGBaseline8BitColor, getImageFrame, getPixelData, getMinMax, isColorImage, isJPEGBaseline8BitColor, internal, };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
function removeAFromRGBA(pixelData, targetBuffer) {
|
|
2
|
+
const numPixels = pixelData.length / 4;
|
|
3
|
+
let rgbIndex = 0;
|
|
4
|
+
let bufferIndex = 0;
|
|
5
|
+
for (let i = 0; i < numPixels; i++) {
|
|
6
|
+
targetBuffer[bufferIndex++] = pixelData[rgbIndex++];
|
|
7
|
+
targetBuffer[bufferIndex++] = pixelData[rgbIndex++];
|
|
8
|
+
targetBuffer[bufferIndex++] = pixelData[rgbIndex++];
|
|
9
|
+
rgbIndex++;
|
|
10
|
+
}
|
|
11
|
+
return targetBuffer;
|
|
12
|
+
}
|
|
13
|
+
export default removeAFromRGBA;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import getPixelDataTypeFromMinMax from '../shared/getPixelDataTypeFromMinMax';
|
|
2
|
+
function setPixelDataType(imageFrame) {
|
|
3
|
+
const minValue = imageFrame.smallestPixelValue;
|
|
4
|
+
const maxValue = imageFrame.largestPixelValue;
|
|
5
|
+
const TypedArray = getPixelDataTypeFromMinMax(minValue, maxValue);
|
|
6
|
+
if (TypedArray) {
|
|
7
|
+
const typedArray = new TypedArray(imageFrame.pixelData);
|
|
8
|
+
imageFrame.pixelData = typedArray;
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
throw new Error('Could not apply a typed array to the pixel data');
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export default setPixelDataType;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/dicom-image-loader",
|
|
3
|
-
"version": "2.19.
|
|
3
|
+
"version": "2.19.15",
|
|
4
4
|
"description": "Cornerstone Image Loader for DICOM WADO-URI and WADO-RS and Local file",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"DICOM",
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
"uuid": "^9.0.0"
|
|
117
117
|
},
|
|
118
118
|
"peerDependencies": {
|
|
119
|
-
"@cornerstonejs/core": "^2.19.
|
|
119
|
+
"@cornerstonejs/core": "^2.19.15",
|
|
120
120
|
"dicom-parser": "^1.8.9"
|
|
121
121
|
},
|
|
122
122
|
"lint-staged": {
|
|
@@ -131,5 +131,5 @@
|
|
|
131
131
|
"path": "./node_modules/cz-conventional-changelog"
|
|
132
132
|
}
|
|
133
133
|
},
|
|
134
|
-
"gitHead": "
|
|
134
|
+
"gitHead": "03a8ef77085f019e6c1404e8a887d2c719669038"
|
|
135
135
|
}
|