@cornerstonejs/dicom-image-loader 3.20.0 → 3.20.2

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.
@@ -112,11 +112,15 @@ function createImage(imageId, pixelData, transferSyntax, options = {}) {
112
112
  imageFrame.smallestPixelValue = minMax.min;
113
113
  imageFrame.largestPixelValue = minMax.max;
114
114
  }
115
+ let numberOfComponents = imageFrame.samplesPerPixel;
116
+ if (imageFrame.photometricInterpretation === 'PALETTE COLOR') {
117
+ numberOfComponents = useRGBA ? 4 : 3;
118
+ }
115
119
  const voxelManager = utilities.VoxelManager.createImageVoxelManager({
116
120
  scalarData: imageFrame.pixelData,
117
121
  width: imageFrame.columns,
118
122
  height: imageFrame.rows,
119
- numberOfComponents: imageFrame.samplesPerPixel,
123
+ numberOfComponents: numberOfComponents,
120
124
  });
121
125
  const image = {
122
126
  imageId,
@@ -157,7 +161,7 @@ function createImage(imageId, pixelData, transferSyntax, options = {}) {
157
161
  rgba: isColorImage && useRGBA,
158
162
  getPixelData: () => imageFrame.pixelData,
159
163
  getCanvas: undefined,
160
- numberOfComponents: imageFrame.samplesPerPixel,
164
+ numberOfComponents: numberOfComponents,
161
165
  };
162
166
  if (image.color) {
163
167
  image.getCanvas = function () {
@@ -7,7 +7,7 @@ export default function isColorConversionRequired(imageFrame) {
7
7
  return false;
8
8
  }
9
9
  if (photometricInterpretation === 'PALETTE COLOR') {
10
- return false;
10
+ return true;
11
11
  }
12
12
  if (photometricInterpretation.endsWith('420')) {
13
13
  return (pixelDataLength ===
@@ -1 +1 @@
1
- export declare const version = "3.20.0";
1
+ export declare const version = "3.20.2";
@@ -1 +1 @@
1
- export const version = '3.20.0';
1
+ export const version = '3.20.2';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/dicom-image-loader",
3
- "version": "3.20.0",
3
+ "version": "3.20.2",
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": "^3.20.0",
119
+ "@cornerstonejs/core": "^3.20.2",
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": "85e1da960eb87095a984c3a4a26a979a4ae5ffd4"
134
+ "gitHead": "e361cbeb9a1b386d4cefeecb49bcdf6c2b12285d"
135
135
  }