dicom-microscopy-viewer 0.36.4 → 0.37.1
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/dicom-microscopy-viewer.js +1 -1
- package/dist/dicom-microscopy-viewer.js.map +1 -1
- package/docs/annotation.AnnotationGroup.html +1 -1
- package/docs/annotation.html +1 -1
- package/docs/annotation.js.html +1 -1
- package/docs/annotations__AnnotationManager.js.html +1 -1
- package/docs/annotations_markups__MarkupManager.js.html +1 -1
- package/docs/api.html +1 -1
- package/docs/color.PaletteColorLookupTable.html +4 -4
- package/docs/color.html +1 -1
- package/docs/color.js.html +17 -14
- package/docs/dicom-microscopy-viewer.js.html +1 -1
- package/docs/events.html +1 -1
- package/docs/events.js.html +1 -1
- package/docs/index.html +1 -1
- package/docs/mapping.ParameterMapping.html +1 -1
- package/docs/mapping.Transformation.html +1 -1
- package/docs/mapping.html +1 -1
- package/docs/mapping.js.html +1 -1
- package/docs/metadata.Comprehensive3DSR.html +1 -1
- package/docs/metadata.MicroscopyBulkSimpleAnnotations.html +1 -1
- package/docs/metadata.ParametricMap.html +1 -1
- package/docs/metadata.SOPClass.html +1 -1
- package/docs/metadata.Segmentation.html +1 -1
- package/docs/metadata.VLWholeSlideMicroscopyImage.html +1 -1
- package/docs/metadata.html +1 -1
- package/docs/metadata.js.html +1 -1
- package/docs/opticalPath.OpticalPath.html +1 -1
- package/docs/opticalPath.html +1 -1
- package/docs/opticalPath.js.html +2 -2
- package/docs/pyramid.js.html +1 -1
- package/docs/roi.ROI.html +1 -1
- package/docs/roi.html +1 -1
- package/docs/roi.js.html +1 -1
- package/docs/scoord3d.Ellipse.html +1 -1
- package/docs/scoord3d.Ellipsoid.html +1 -1
- package/docs/scoord3d.Multipoint.html +1 -1
- package/docs/scoord3d.Point.html +1 -1
- package/docs/scoord3d.Polygon.html +1 -1
- package/docs/scoord3d.Polyline.html +1 -1
- package/docs/scoord3d.Scoord3D.html +1 -1
- package/docs/scoord3d.html +1 -1
- package/docs/scoord3d.js.html +1 -1
- package/docs/segment.Segment.html +1 -1
- package/docs/segment.html +1 -1
- package/docs/segment.js.html +1 -1
- package/docs/utils.html +1 -1
- package/docs/utils.js.html +1 -1
- package/docs/viewer.LabelImageViewer.html +2 -2
- package/docs/viewer.OverviewImageViewer.html +2 -2
- package/docs/viewer.VolumeImageViewer.html +629 -236
- package/docs/viewer.html +1 -1
- package/docs/viewer.js.html +284 -292
- package/package.json +1 -1
- package/src/color.js +16 -13
- package/src/opticalPath.js +1 -1
- package/src/viewer.js +283 -291
package/package.json
CHANGED
package/src/color.js
CHANGED
|
@@ -292,7 +292,8 @@ class PaletteColorLookupTable {
|
|
|
292
292
|
const startpoint = lut[offset - 1]
|
|
293
293
|
const step = (endpoint - startpoint) / (length - 1)
|
|
294
294
|
for (let j = 0; j < length; j++) {
|
|
295
|
-
|
|
295
|
+
const value = startpoint + Math.round(j * step)
|
|
296
|
+
lut[offset + j] = value
|
|
296
297
|
}
|
|
297
298
|
offset += length
|
|
298
299
|
} else if (opcode === 2) {
|
|
@@ -368,17 +369,23 @@ class PaletteColorLookupTable {
|
|
|
368
369
|
)
|
|
369
370
|
}
|
|
370
371
|
|
|
371
|
-
|
|
372
|
+
const maxValues = [
|
|
373
|
+
Math.max(...redLUT),
|
|
374
|
+
Math.max(...greenLUT),
|
|
375
|
+
Math.max(...blueLUT)
|
|
376
|
+
]
|
|
377
|
+
const maxInput = Math.max(...maxValues)
|
|
378
|
+
const maxOutput = 255
|
|
379
|
+
if (this[_attrs].bitsPerEntry === 16 && maxInput > 255) {
|
|
372
380
|
/*
|
|
373
381
|
* Only palettes with 256 entries and 8 bit per entry are supported for
|
|
374
382
|
* display. Therefore, data need to rescaled and resampled.
|
|
375
383
|
*/
|
|
376
|
-
const
|
|
377
|
-
const
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
const j = i * steps
|
|
384
|
+
const n = 256
|
|
385
|
+
const step = this[_attrs].numberOfEntries / n
|
|
386
|
+
this[_attrs].data = new Array(n)
|
|
387
|
+
for (let i = 0; i < n; i++) {
|
|
388
|
+
const j = i * step
|
|
382
389
|
this[_attrs].data[i] = [
|
|
383
390
|
Math.round(rescale(redLUT[j], 0, maxInput, 0, maxOutput)),
|
|
384
391
|
Math.round(rescale(greenLUT[j], 0, maxInput, 0, maxOutput)),
|
|
@@ -388,11 +395,7 @@ class PaletteColorLookupTable {
|
|
|
388
395
|
} else {
|
|
389
396
|
this[_attrs].data = new Array(this[_attrs].numberOfEntries)
|
|
390
397
|
for (let i = 0; i < this[_attrs].numberOfEntries; i++) {
|
|
391
|
-
this[_attrs].data[i] = [
|
|
392
|
-
redLUT[i],
|
|
393
|
-
greenLUT[i],
|
|
394
|
-
blueLUT[i]
|
|
395
|
-
]
|
|
398
|
+
this[_attrs].data[i] = [redLUT[i], greenLUT[i], blueLUT[i]]
|
|
396
399
|
}
|
|
397
400
|
}
|
|
398
401
|
}
|