@cornerstonejs/core 0.36.3 → 0.36.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.
- package/dist/cjs/utilities/getSliceRange.js +2 -1
- package/dist/cjs/utilities/getSliceRange.js.map +1 -1
- package/dist/esm/utilities/getSliceRange.js +2 -1
- package/dist/esm/utilities/getSliceRange.js.map +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +4 -3
- package/src/RenderingEngine/BaseVolumeViewport.ts +847 -0
- package/src/RenderingEngine/RenderingEngine.ts +1364 -0
- package/src/RenderingEngine/StackViewport.ts +2690 -0
- package/src/RenderingEngine/Viewport.ts +1244 -0
- package/src/RenderingEngine/VolumeViewport.ts +420 -0
- package/src/RenderingEngine/VolumeViewport3D.ts +42 -0
- package/src/RenderingEngine/getRenderingEngine.ts +34 -0
- package/src/RenderingEngine/helpers/addVolumesToViewports.ts +52 -0
- package/src/RenderingEngine/helpers/cpuFallback/colors/colormap.ts +343 -0
- package/src/RenderingEngine/helpers/cpuFallback/colors/index.ts +4 -0
- package/src/RenderingEngine/helpers/cpuFallback/colors/lookupTable.ts +469 -0
- package/src/RenderingEngine/helpers/cpuFallback/drawImageSync.ts +58 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/calculateTransform.ts +136 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/canvasToPixel.ts +25 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/computeAutoVoi.ts +47 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/correctShift.ts +38 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/createViewport.ts +64 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/doesImageNeedToBeRendered.ts +36 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/fitToWindow.ts +22 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/generateColorLUT.ts +60 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/generateLut.ts +83 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/getDefaultViewport.ts +88 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/getImageFitScale.ts +52 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/getImageSize.ts +55 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/getLut.ts +53 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/getModalityLut.ts +55 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/getTransform.ts +17 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/getVOILut.ts +74 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/initializeRenderCanvas.ts +37 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/lutMatches.ts +21 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/now.ts +13 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/pixelToCanvas.ts +22 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/renderColorImage.ts +193 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/renderGrayscaleImage.ts +166 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/renderPseudoColorImage.ts +203 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/resetCamera.ts +32 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/resize.ts +109 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/saveLastRendered.ts +36 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/setDefaultViewport.ts +17 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/setToPixelCoordinateSystem.ts +32 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/storedColorPixelDataToCanvasImageData.ts +58 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/storedPixelDataToCanvasImageData.ts +76 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/storedPixelDataToCanvasImageDataColorLUT.ts +60 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/storedPixelDataToCanvasImageDataPET.ts +50 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/storedPixelDataToCanvasImageDataPseudocolorLUT.ts +66 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/storedPixelDataToCanvasImageDataPseudocolorLUTPET.ts +68 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/storedPixelDataToCanvasImageDataRGBA.ts +81 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/storedRGBAPixelDataToCanvasImageData.ts +56 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/transform.ts +126 -0
- package/src/RenderingEngine/helpers/cpuFallback/rendering/validator.ts +31 -0
- package/src/RenderingEngine/helpers/createVolumeActor.ts +103 -0
- package/src/RenderingEngine/helpers/createVolumeMapper.ts +37 -0
- package/src/RenderingEngine/helpers/getOrCreateCanvas.ts +58 -0
- package/src/RenderingEngine/helpers/index.ts +15 -0
- package/src/RenderingEngine/helpers/isRgbaSourceRgbDest.ts +1 -0
- package/src/RenderingEngine/helpers/setDefaultVolumeVOI.ts +227 -0
- package/src/RenderingEngine/helpers/setVolumesForViewports.ts +52 -0
- package/src/RenderingEngine/helpers/viewportTypeToViewportClass.ts +14 -0
- package/src/RenderingEngine/helpers/viewportTypeUsesCustomRenderingPipeline.ts +7 -0
- package/src/RenderingEngine/helpers/volumeNewImageEventDispatcher.ts +75 -0
- package/src/RenderingEngine/index.ts +23 -0
- package/src/RenderingEngine/renderingEngineCache.ts +43 -0
- package/src/RenderingEngine/vtkClasses/index.js +11 -0
- package/src/RenderingEngine/vtkClasses/vtkOffscreenMultiRenderWindow.js +149 -0
- package/src/RenderingEngine/vtkClasses/vtkSharedVolumeMapper.js +52 -0
- package/src/RenderingEngine/vtkClasses/vtkSlabCamera.d.ts +781 -0
- package/src/RenderingEngine/vtkClasses/vtkSlabCamera.js +155 -0
- package/src/RenderingEngine/vtkClasses/vtkStreamingOpenGLRenderWindow.js +47 -0
- package/src/RenderingEngine/vtkClasses/vtkStreamingOpenGLTexture.js +272 -0
- package/src/RenderingEngine/vtkClasses/vtkStreamingOpenGLViewNodeFactory.js +159 -0
- package/src/RenderingEngine/vtkClasses/vtkStreamingOpenGLVolumeMapper.js +319 -0
- package/src/Settings.ts +294 -0
- package/src/cache/cache.ts +854 -0
- package/src/cache/classes/Contour.ts +70 -0
- package/src/cache/classes/ContourSet.ts +151 -0
- package/src/cache/classes/ImageVolume.ts +155 -0
- package/src/cache/index.ts +5 -0
- package/src/constants/cpuColormaps.ts +1537 -0
- package/src/constants/epsilon.ts +3 -0
- package/src/constants/index.ts +13 -0
- package/src/constants/mprCameraValues.ts +20 -0
- package/src/constants/rendering.ts +8 -0
- package/src/constants/viewportPresets.ts +357 -0
- package/src/enums/BlendModes.ts +23 -0
- package/src/enums/ContourType.ts +6 -0
- package/src/enums/Events.ts +196 -0
- package/src/enums/GeometryType.ts +5 -0
- package/src/enums/InterpolationType.ts +13 -0
- package/src/enums/OrientationAxis.ts +8 -0
- package/src/enums/RequestType.ts +13 -0
- package/src/enums/SharedArrayBufferModes.ts +11 -0
- package/src/enums/VOILUTFunctionType.ts +10 -0
- package/src/enums/ViewportType.ts +21 -0
- package/src/enums/index.ts +23 -0
- package/src/eventTarget.ts +67 -0
- package/src/getEnabledElement.ts +105 -0
- package/src/global.ts +8 -0
- package/src/index.ts +123 -0
- package/src/init.ts +247 -0
- package/src/loaders/geometryLoader.ts +108 -0
- package/src/loaders/imageLoader.ts +298 -0
- package/src/loaders/volumeLoader.ts +477 -0
- package/src/metaData.ts +84 -0
- package/src/requestPool/imageLoadPoolManager.ts +43 -0
- package/src/requestPool/imageRetrievalPoolManager.ts +25 -0
- package/src/requestPool/requestPoolManager.ts +329 -0
- package/src/types/ActorSliceRange.ts +17 -0
- package/src/types/CPUFallbackColormap.ts +23 -0
- package/src/types/CPUFallbackColormapData.ts +12 -0
- package/src/types/CPUFallbackColormapsData.ts +7 -0
- package/src/types/CPUFallbackEnabledElement.ts +71 -0
- package/src/types/CPUFallbackLUT.ts +5 -0
- package/src/types/CPUFallbackLookupTable.ts +17 -0
- package/src/types/CPUFallbackRenderingTools.ts +25 -0
- package/src/types/CPUFallbackTransform.ts +16 -0
- package/src/types/CPUFallbackViewport.ts +29 -0
- package/src/types/CPUFallbackViewportDisplayedArea.ts +15 -0
- package/src/types/CPUIImageData.ts +47 -0
- package/src/types/ContourData.ts +19 -0
- package/src/types/Cornerstone3DConfig.ts +31 -0
- package/src/types/CustomEventType.ts +14 -0
- package/src/types/EventTypes.ts +403 -0
- package/src/types/FlipDirection.ts +9 -0
- package/src/types/IActor.ts +23 -0
- package/src/types/ICache.ts +28 -0
- package/src/types/ICachedGeometry.ts +13 -0
- package/src/types/ICachedImage.ts +13 -0
- package/src/types/ICachedVolume.ts +12 -0
- package/src/types/ICamera.ts +36 -0
- package/src/types/IContour.ts +18 -0
- package/src/types/IContourSet.ts +56 -0
- package/src/types/IDynamicImageVolume.ts +18 -0
- package/src/types/IEnabledElement.ts +21 -0
- package/src/types/IGeometry.ts +12 -0
- package/src/types/IImage.ts +113 -0
- package/src/types/IImageData.ts +45 -0
- package/src/types/IImageVolume.ts +78 -0
- package/src/types/ILoadObject.ts +36 -0
- package/src/types/IRegisterImageLoader.ts +10 -0
- package/src/types/IRenderingEngine.ts +28 -0
- package/src/types/IStackViewport.ts +138 -0
- package/src/types/IStreamingImageVolume.ts +13 -0
- package/src/types/IStreamingVolumeProperties.ts +14 -0
- package/src/types/IViewport.ts +149 -0
- package/src/types/IViewportId.ts +9 -0
- package/src/types/IVolume.ts +45 -0
- package/src/types/IVolumeInput.ts +36 -0
- package/src/types/IVolumeViewport.ts +141 -0
- package/src/types/ImageLoaderFn.ts +16 -0
- package/src/types/ImageSliceData.ts +6 -0
- package/src/types/Mat3.ts +16 -0
- package/src/types/Metadata.ts +39 -0
- package/src/types/OrientationVectors.ts +36 -0
- package/src/types/Plane.ts +6 -0
- package/src/types/Point2.ts +6 -0
- package/src/types/Point3.ts +6 -0
- package/src/types/Point4.ts +6 -0
- package/src/types/ScalingParameters.ts +27 -0
- package/src/types/StackViewportProperties.ts +25 -0
- package/src/types/TransformMatrix2D.ts +4 -0
- package/src/types/ViewportInputOptions.ts +21 -0
- package/src/types/ViewportPreset.ts +14 -0
- package/src/types/VolumeLoaderFn.ts +18 -0
- package/src/types/VolumeViewportProperties.ts +14 -0
- package/src/types/index.ts +157 -0
- package/src/types/voi.ts +15 -0
- package/src/utilities/actorCheck.ts +24 -0
- package/src/utilities/applyPreset.ts +132 -0
- package/src/utilities/calculateViewportsSpatialRegistration.ts +74 -0
- package/src/utilities/calibratedPixelSpacingMetadataProvider.ts +38 -0
- package/src/utilities/createFloat32SharedArray.ts +45 -0
- package/src/utilities/createInt16SharedArray.ts +43 -0
- package/src/utilities/createLinearRGBTransferFunction.ts +22 -0
- package/src/utilities/createSigmoidRGBTransferFunction.ts +63 -0
- package/src/utilities/createUInt16SharedArray.ts +43 -0
- package/src/utilities/createUint8SharedArray.ts +45 -0
- package/src/utilities/deepFreeze.ts +19 -0
- package/src/utilities/deepMerge.ts +81 -0
- package/src/utilities/getClosestImageId.ts +80 -0
- package/src/utilities/getClosestStackImageIndexForPoint.ts +116 -0
- package/src/utilities/getImageSliceDataForVolumeViewport.ts +61 -0
- package/src/utilities/getMinMax.ts +31 -0
- package/src/utilities/getRuntimeId.ts +54 -0
- package/src/utilities/getScalarDataType.ts +31 -0
- package/src/utilities/getScalingParameters.ts +35 -0
- package/src/utilities/getSliceRange.ts +86 -0
- package/src/utilities/getSpacingInNormalDirection.ts +44 -0
- package/src/utilities/getTargetVolumeAndSpacingInNormalDir.ts +126 -0
- package/src/utilities/getViewportImageCornersInWorld.ts +102 -0
- package/src/utilities/getViewportsWithImageURI.ts +46 -0
- package/src/utilities/getViewportsWithVolumeId.ts +38 -0
- package/src/utilities/getVoiFromSigmoidRGBTransferFunction.ts +23 -0
- package/src/utilities/getVolumeActorCorners.ts +24 -0
- package/src/utilities/getVolumeSliceRangeInfo.ts +52 -0
- package/src/utilities/getVolumeViewportScrollInfo.ts +32 -0
- package/src/utilities/getVolumeViewportsContainingSameVolumes.ts +58 -0
- package/src/utilities/hasNaNValues.ts +12 -0
- package/src/utilities/imageIdToURI.ts +10 -0
- package/src/utilities/imageToWorldCoords.ts +54 -0
- package/src/utilities/index.ts +100 -0
- package/src/utilities/indexWithinDimensions.ts +27 -0
- package/src/utilities/invertRgbTransferFunction.ts +36 -0
- package/src/utilities/isEqual.ts +27 -0
- package/src/utilities/isOpposite.ts +23 -0
- package/src/utilities/isTypedArray.ts +20 -0
- package/src/utilities/loadImageToCanvas.ts +80 -0
- package/src/utilities/planar.ts +91 -0
- package/src/utilities/renderToCanvas.ts +32 -0
- package/src/utilities/scaleRgbTransferFunction.ts +37 -0
- package/src/utilities/snapFocalPointToSlice.ts +78 -0
- package/src/utilities/spatialRegistrationMetadataProvider.ts +50 -0
- package/src/utilities/transformWorldToIndex.ts +16 -0
- package/src/utilities/triggerEvent.ts +38 -0
- package/src/utilities/uuidv4.ts +13 -0
- package/src/utilities/windowLevel.ts +39 -0
- package/src/utilities/worldToImageCoords.ts +64 -0
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
import RequestType from '../enums/RequestType';
|
|
2
|
+
import { IImage } from '../types';
|
|
3
|
+
import { uuidv4 } from '../utilities';
|
|
4
|
+
|
|
5
|
+
type AdditionalDetails = {
|
|
6
|
+
imageId?: string;
|
|
7
|
+
volumeId?: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
type RequestDetailsInterface = {
|
|
11
|
+
requestFn: () => Promise<IImage | void>;
|
|
12
|
+
type: RequestType;
|
|
13
|
+
additionalDetails: AdditionalDetails;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
type RequestPool = {
|
|
17
|
+
[name in RequestType]: { [key: number]: RequestDetailsInterface[] };
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* RequestPool manager class is a base class that manages the request pools.
|
|
22
|
+
* It is used imageRetrievalPoolManager, and imageLoadPoolManager to retrieve and load images.
|
|
23
|
+
* Previously requestPoolManager was used to manage the retrieval and loading and decoding
|
|
24
|
+
* of the images in a way that new requests were sent after the image was both loaded and decoded
|
|
25
|
+
* which was not performant since it was waiting for the image to be loaded and decoded before
|
|
26
|
+
* sending the next request which is a network request and can be done in parallel.
|
|
27
|
+
* Now, we use separate imageRetrievalPoolManager and imageLoadPoolManager
|
|
28
|
+
* to improve performance and both are extending the RequestPoolManager class which
|
|
29
|
+
* is a basic queueing pool.
|
|
30
|
+
*
|
|
31
|
+
* A new requestPool can be created by instantiating a new RequestPoolManager class.
|
|
32
|
+
*
|
|
33
|
+
* ```javascript
|
|
34
|
+
* const requestPoolManager = new RequestPoolManager()
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* ## ImageLoadPoolManager
|
|
38
|
+
*
|
|
39
|
+
* You can use the imageLoadPoolManager to load images, by providing a `requestFn`
|
|
40
|
+
* that returns a promise for the image. You can provide a `type` to specify the type of
|
|
41
|
+
* request (interaction, thumbnail, prefetch), and you can provide additional details
|
|
42
|
+
* that will be passed to the requestFn. Below is an example of a requestFn that loads
|
|
43
|
+
* an image from an imageId:
|
|
44
|
+
*
|
|
45
|
+
* ```javascript
|
|
46
|
+
*
|
|
47
|
+
* const priority = -5
|
|
48
|
+
* const requestType = RequestType.Interaction
|
|
49
|
+
* const additionalDetails = { imageId }
|
|
50
|
+
* const options = {
|
|
51
|
+
* targetBuffer: {
|
|
52
|
+
* type: 'Float32Array',
|
|
53
|
+
* offset: null,
|
|
54
|
+
* length: null,
|
|
55
|
+
* },
|
|
56
|
+
* preScale: {
|
|
57
|
+
* enabled: true,
|
|
58
|
+
* },
|
|
59
|
+
* }
|
|
60
|
+
*
|
|
61
|
+
* imageLoadPoolManager.addRequest(
|
|
62
|
+
* loadAndCacheImage(imageId, options).then(() => { // set on viewport}),
|
|
63
|
+
* requestType,
|
|
64
|
+
* additionalDetails,
|
|
65
|
+
* priority
|
|
66
|
+
* )
|
|
67
|
+
* ```
|
|
68
|
+
* ### ImageRetrievalPoolManager
|
|
69
|
+
* You don't need to directly use the imageRetrievalPoolManager to load images
|
|
70
|
+
* since the imageLoadPoolManager will automatically use it for retrieval. However,
|
|
71
|
+
* maximum number of concurrent requests can be set by calling `setMaxConcurrentRequests`.
|
|
72
|
+
*/
|
|
73
|
+
class RequestPoolManager {
|
|
74
|
+
private id: string;
|
|
75
|
+
private awake: boolean;
|
|
76
|
+
private requestPool: RequestPool;
|
|
77
|
+
private numRequests = {
|
|
78
|
+
interaction: 0,
|
|
79
|
+
thumbnail: 0,
|
|
80
|
+
prefetch: 0,
|
|
81
|
+
};
|
|
82
|
+
/* maximum number of requests of each type. */
|
|
83
|
+
public maxNumRequests: {
|
|
84
|
+
interaction: number;
|
|
85
|
+
thumbnail: number;
|
|
86
|
+
prefetch: number;
|
|
87
|
+
};
|
|
88
|
+
/* A public property that is used to set the delay between requests. */
|
|
89
|
+
public grabDelay: number;
|
|
90
|
+
private timeoutHandle: number;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* By default a request pool containing three priority groups, one for each
|
|
94
|
+
* of the request types, is created. Maximum number of requests of each type
|
|
95
|
+
* is set to 6.
|
|
96
|
+
*/
|
|
97
|
+
constructor(id?: string) {
|
|
98
|
+
this.id = id ? id : uuidv4();
|
|
99
|
+
|
|
100
|
+
this.requestPool = {
|
|
101
|
+
interaction: { 0: [] },
|
|
102
|
+
thumbnail: { 0: [] },
|
|
103
|
+
prefetch: { 0: [] },
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
this.grabDelay = 5;
|
|
107
|
+
this.awake = false;
|
|
108
|
+
|
|
109
|
+
this.numRequests = {
|
|
110
|
+
interaction: 0,
|
|
111
|
+
thumbnail: 0,
|
|
112
|
+
prefetch: 0,
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
this.maxNumRequests = {
|
|
116
|
+
interaction: 6,
|
|
117
|
+
thumbnail: 6,
|
|
118
|
+
prefetch: 5,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* This function sets the maximum number of requests for a given request type.
|
|
124
|
+
* @param type - The type of request you want to set the max number
|
|
125
|
+
* of requests for it can be either of interaction, prefetch, or thumbnail.
|
|
126
|
+
* @param maxNumRequests - The maximum number of requests that can be
|
|
127
|
+
* made at a time.
|
|
128
|
+
*/
|
|
129
|
+
public setMaxSimultaneousRequests(
|
|
130
|
+
type: RequestType,
|
|
131
|
+
maxNumRequests: number
|
|
132
|
+
): void {
|
|
133
|
+
this.maxNumRequests[type] = maxNumRequests;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* It returns the maximum number of requests of a given type that can be made
|
|
138
|
+
* @param type - The type of request.
|
|
139
|
+
* @returns The maximum number of requests of a given type.
|
|
140
|
+
*/
|
|
141
|
+
public getMaxSimultaneousRequests(type: RequestType): number {
|
|
142
|
+
return this.maxNumRequests[type];
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Stops further fetching of the requests, all the ongoing requests will still
|
|
147
|
+
* be retrieved
|
|
148
|
+
*/
|
|
149
|
+
public destroy(): void {
|
|
150
|
+
if (this.timeoutHandle) {
|
|
151
|
+
window.clearTimeout(this.timeoutHandle);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Adds the requests to the pool of requests.
|
|
157
|
+
*
|
|
158
|
+
* @param requestFn - A function that returns a promise which resolves in the image
|
|
159
|
+
* @param type - Priority category, it can be either of interaction, prefetch,
|
|
160
|
+
* or thumbnail.
|
|
161
|
+
* @param additionalDetails - Additional details that requests can contain.
|
|
162
|
+
* For instance the volumeId for the volume requests
|
|
163
|
+
* @param priority - Priority number for each category of requests. Its default
|
|
164
|
+
* value is priority 0. The lower the priority number, the higher the priority number
|
|
165
|
+
*
|
|
166
|
+
*/
|
|
167
|
+
public addRequest(
|
|
168
|
+
requestFn: () => Promise<IImage | void>,
|
|
169
|
+
type: RequestType,
|
|
170
|
+
additionalDetails: Record<string, unknown>,
|
|
171
|
+
priority = 0
|
|
172
|
+
): void {
|
|
173
|
+
// Describe the request
|
|
174
|
+
const requestDetails: RequestDetailsInterface = {
|
|
175
|
+
requestFn,
|
|
176
|
+
type,
|
|
177
|
+
additionalDetails,
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
// Check if the priority group exists on the request type
|
|
181
|
+
if (this.requestPool[type][priority] === undefined) {
|
|
182
|
+
this.requestPool[type][priority] = [];
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// Adding the request to the correct priority group of the request type
|
|
186
|
+
this.requestPool[type][priority].push(requestDetails);
|
|
187
|
+
|
|
188
|
+
// Wake up
|
|
189
|
+
if (!this.awake) {
|
|
190
|
+
this.awake = true;
|
|
191
|
+
this.startGrabbing();
|
|
192
|
+
} else if (type === RequestType.Interaction) {
|
|
193
|
+
// Todo: this is a hack for interaction right now, we should separate
|
|
194
|
+
// the grabbing from the adding requests
|
|
195
|
+
this.startGrabbing();
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Filter the requestPoolManager's pool of request based on the result of
|
|
201
|
+
* provided filter function. The provided filter function needs to return false or true
|
|
202
|
+
*
|
|
203
|
+
* @param filterFunction - The filter function for filtering of the requests to keep
|
|
204
|
+
*/
|
|
205
|
+
public filterRequests(
|
|
206
|
+
filterFunction: (requestDetails: RequestDetailsInterface) => boolean
|
|
207
|
+
): void {
|
|
208
|
+
Object.keys(this.requestPool).forEach((type: string) => {
|
|
209
|
+
const requestType = this.requestPool[type];
|
|
210
|
+
Object.keys(requestType).forEach((priority) => {
|
|
211
|
+
requestType[priority] = requestType[priority].filter(
|
|
212
|
+
(requestDetails: RequestDetailsInterface) => {
|
|
213
|
+
return filterFunction(requestDetails);
|
|
214
|
+
}
|
|
215
|
+
);
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Clears the requests specific to the provided type. For instance, the
|
|
222
|
+
* pool of requests of type 'interaction' can be cleared via this function.
|
|
223
|
+
*
|
|
224
|
+
*
|
|
225
|
+
* @param type - category of the request (either interaction, prefetch or thumbnail)
|
|
226
|
+
*/
|
|
227
|
+
public clearRequestStack(type: string): void {
|
|
228
|
+
if (!this.requestPool[type]) {
|
|
229
|
+
throw new Error(`No category for the type ${type} found`);
|
|
230
|
+
}
|
|
231
|
+
this.requestPool[type] = { 0: [] };
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
private sendRequests(type) {
|
|
235
|
+
const requestsToSend = this.maxNumRequests[type] - this.numRequests[type];
|
|
236
|
+
|
|
237
|
+
for (let i = 0; i < requestsToSend; i++) {
|
|
238
|
+
const requestDetails = this.getNextRequest(type);
|
|
239
|
+
if (requestDetails === null) {
|
|
240
|
+
return false;
|
|
241
|
+
} else if (requestDetails) {
|
|
242
|
+
this.numRequests[type]++;
|
|
243
|
+
this.awake = true;
|
|
244
|
+
|
|
245
|
+
requestDetails.requestFn().finally(() => {
|
|
246
|
+
this.numRequests[type]--;
|
|
247
|
+
this.startAgain();
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
return true;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
private getNextRequest(type): RequestDetailsInterface | null {
|
|
256
|
+
const interactionPriorities = this.getSortedPriorityGroups(type);
|
|
257
|
+
for (const priority of interactionPriorities) {
|
|
258
|
+
if (this.requestPool[type][priority].length) {
|
|
259
|
+
return this.requestPool[type][priority].shift();
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
return null;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
protected startGrabbing(): void {
|
|
267
|
+
const hasRemainingInteractionRequests = this.sendRequests(
|
|
268
|
+
RequestType.Interaction
|
|
269
|
+
);
|
|
270
|
+
const hasRemainingThumbnailRequests = this.sendRequests(
|
|
271
|
+
RequestType.Thumbnail
|
|
272
|
+
);
|
|
273
|
+
const hasRemainingPrefetchRequests = this.sendRequests(
|
|
274
|
+
RequestType.Prefetch
|
|
275
|
+
);
|
|
276
|
+
|
|
277
|
+
if (
|
|
278
|
+
!hasRemainingInteractionRequests &&
|
|
279
|
+
!hasRemainingThumbnailRequests &&
|
|
280
|
+
!hasRemainingPrefetchRequests
|
|
281
|
+
) {
|
|
282
|
+
this.awake = false;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
protected startAgain(): void {
|
|
287
|
+
if (!this.awake) {
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
if (this.grabDelay !== undefined) {
|
|
292
|
+
// Prevents calling setTimeout hundreds of times when hundreds of requests
|
|
293
|
+
// are added which make it slower and works in an unexpected way when
|
|
294
|
+
// destroy/clearTimeout is called because only the last handle is stored.
|
|
295
|
+
if (!this.timeoutHandle) {
|
|
296
|
+
this.timeoutHandle = window.setTimeout(() => {
|
|
297
|
+
this.timeoutHandle = null;
|
|
298
|
+
this.startGrabbing();
|
|
299
|
+
}, this.grabDelay);
|
|
300
|
+
}
|
|
301
|
+
} else {
|
|
302
|
+
this.startGrabbing();
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
protected getSortedPriorityGroups(type: string): Array<number> {
|
|
307
|
+
const priorities = Object.keys(this.requestPool[type])
|
|
308
|
+
.map(Number)
|
|
309
|
+
.filter((priority) => this.requestPool[type][priority].length)
|
|
310
|
+
.sort();
|
|
311
|
+
return priorities;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Returns the request pool containing different categories, their priority and
|
|
316
|
+
* the added request details.
|
|
317
|
+
*
|
|
318
|
+
* @returns the request pool which contains different categories, their priority and
|
|
319
|
+
* the added request details
|
|
320
|
+
*/
|
|
321
|
+
getRequestPool(): RequestPool {
|
|
322
|
+
return this.requestPool;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
const requestPoolManager = new RequestPoolManager();
|
|
327
|
+
|
|
328
|
+
export { RequestPoolManager };
|
|
329
|
+
export default requestPoolManager;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { VolumeActor } from './IActor';
|
|
2
|
+
import Point3 from './Point3';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Object containing the min, max and current position in the normal direction
|
|
6
|
+
* for the actor
|
|
7
|
+
*/
|
|
8
|
+
type ActorSliceRange = {
|
|
9
|
+
actor: VolumeActor;
|
|
10
|
+
viewPlaneNormal: Point3;
|
|
11
|
+
focalPoint: Point3;
|
|
12
|
+
min: number;
|
|
13
|
+
max: number;
|
|
14
|
+
current: number;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default ActorSliceRange;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import Point4 from './Point4';
|
|
2
|
+
import CPUFallbackLookupTable from './CPUFallbackLookupTable';
|
|
3
|
+
|
|
4
|
+
interface CPUFallbackColormap {
|
|
5
|
+
/** Get id of colormap */
|
|
6
|
+
getId: () => string;
|
|
7
|
+
getColorSchemeName: () => string;
|
|
8
|
+
setColorSchemeName: (name: string) => void;
|
|
9
|
+
getNumberOfColors: () => number;
|
|
10
|
+
setNumberOfColors: (numColors: number) => void;
|
|
11
|
+
getColor: (index: number) => Point4;
|
|
12
|
+
getColorRepeating: (index: number) => Point4;
|
|
13
|
+
setColor: (index: number, rgba: Point4) => void;
|
|
14
|
+
addColor: (rgba: Point4) => void;
|
|
15
|
+
insertColor: (index: number, rgba: Point4) => void;
|
|
16
|
+
removeColor: (index: number) => void;
|
|
17
|
+
clearColors: () => void;
|
|
18
|
+
buildLookupTable: (lut: CPUFallbackLookupTable) => void;
|
|
19
|
+
createLookupTable: () => CPUFallbackLookupTable;
|
|
20
|
+
isValidIndex: (index: number) => boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default CPUFallbackColormap;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import Point2 from './Point2';
|
|
2
|
+
import Point3 from './Point3';
|
|
3
|
+
import Mat3 from './Mat3';
|
|
4
|
+
import IImage from './IImage';
|
|
5
|
+
import CPUFallbackViewport from './CPUFallbackViewport';
|
|
6
|
+
import CPUFallbackTransform from './CPUFallbackTransform';
|
|
7
|
+
import CPUFallbackColormap from './CPUFallbackColormap';
|
|
8
|
+
import CPUFallbackRenderingTools from './CPUFallbackRenderingTools';
|
|
9
|
+
|
|
10
|
+
interface CPUFallbackEnabledElement {
|
|
11
|
+
scale?: number;
|
|
12
|
+
pan?: Point2;
|
|
13
|
+
zoom?: number;
|
|
14
|
+
rotation?: number;
|
|
15
|
+
image?: IImage;
|
|
16
|
+
canvas?: HTMLCanvasElement;
|
|
17
|
+
viewport?: CPUFallbackViewport;
|
|
18
|
+
colormap?: CPUFallbackColormap;
|
|
19
|
+
options?: {
|
|
20
|
+
[key: string]: unknown;
|
|
21
|
+
colormap?: CPUFallbackColormap;
|
|
22
|
+
};
|
|
23
|
+
renderingTools?: CPUFallbackRenderingTools;
|
|
24
|
+
transform?: CPUFallbackTransform;
|
|
25
|
+
invalid?: boolean;
|
|
26
|
+
needsRedraw?: boolean;
|
|
27
|
+
metadata?: {
|
|
28
|
+
direction?: Mat3;
|
|
29
|
+
/** Last index is always 1 for CPU */
|
|
30
|
+
dimensions?: Point3;
|
|
31
|
+
/** Last spacing is always EPSILON for CPU */
|
|
32
|
+
spacing?: Point3;
|
|
33
|
+
origin?: Point3;
|
|
34
|
+
imagePlaneModule?: {
|
|
35
|
+
frameOfReferenceUID: string;
|
|
36
|
+
rows: number;
|
|
37
|
+
columns: number;
|
|
38
|
+
imageOrientationPatient: number[];
|
|
39
|
+
rowCosines: Point3;
|
|
40
|
+
columnCosines: Point3;
|
|
41
|
+
imagePositionPatient: number[];
|
|
42
|
+
sliceThickness?: number;
|
|
43
|
+
sliceLocation?: number;
|
|
44
|
+
pixelSpacing: Point2;
|
|
45
|
+
rowPixelSpacing: number;
|
|
46
|
+
columnPixelSpacing: number;
|
|
47
|
+
};
|
|
48
|
+
imagePixelModule?: {
|
|
49
|
+
samplesPerPixel: number;
|
|
50
|
+
photometricInterpretation: string;
|
|
51
|
+
rows: number;
|
|
52
|
+
columns: number;
|
|
53
|
+
bitsAllocated: number;
|
|
54
|
+
bitsStored: number;
|
|
55
|
+
highBit: number;
|
|
56
|
+
pixelRepresentation: number;
|
|
57
|
+
planarConfiguration?: number;
|
|
58
|
+
pixelAspectRatio?: number;
|
|
59
|
+
smallestPixelValue?: number;
|
|
60
|
+
largestPixelValue?: number;
|
|
61
|
+
redPaletteColorLookupTableDescriptor?: number[];
|
|
62
|
+
greenPaletteColorLookupTableDescriptor?: number[];
|
|
63
|
+
bluePaletteColorLookupTableDescriptor?: number[];
|
|
64
|
+
redPaletteColorLookupTableData: number[];
|
|
65
|
+
greenPaletteColorLookupTableData: number[];
|
|
66
|
+
bluePaletteColorLookupTableData: number[];
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export default CPUFallbackEnabledElement;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import Point4 from './Point4';
|
|
2
|
+
|
|
3
|
+
interface CPUFallbackLookupTable {
|
|
4
|
+
setNumberOfTableValues: (number: number) => void;
|
|
5
|
+
setRamp: (ramp: string) => void;
|
|
6
|
+
setTableRange: (start: number, end: number) => void;
|
|
7
|
+
setHueRange: (start: number, end: number) => void;
|
|
8
|
+
setSaturationRange: (start: number, end: number) => void;
|
|
9
|
+
setValueRange: (start: number, end: number) => void;
|
|
10
|
+
setRange: (start: number, end: number) => void;
|
|
11
|
+
setAlphaRange: (start: number, end: number) => void;
|
|
12
|
+
getColor: (scalar: number) => Point4;
|
|
13
|
+
build: (force: boolean) => void;
|
|
14
|
+
setTableValue(index: number, rgba: Point4);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default CPUFallbackLookupTable;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import CPUFallbackLookupTable from './CPUFallbackLookupTable';
|
|
2
|
+
import CPUFallbackLUT from './CPUFallbackLUT';
|
|
3
|
+
|
|
4
|
+
type CPUFallbackRenderingTools = {
|
|
5
|
+
renderCanvas?: HTMLCanvasElement;
|
|
6
|
+
lastRenderedIsColor?: boolean;
|
|
7
|
+
lastRenderedImageId?: string;
|
|
8
|
+
lastRenderedViewport?: {
|
|
9
|
+
windowWidth: number | number[];
|
|
10
|
+
windowCenter: number | number[];
|
|
11
|
+
invert: boolean;
|
|
12
|
+
rotation: number;
|
|
13
|
+
hflip: boolean;
|
|
14
|
+
vflip: boolean;
|
|
15
|
+
modalityLUT: CPUFallbackLUT;
|
|
16
|
+
voiLUT: CPUFallbackLUT;
|
|
17
|
+
colormap: unknown;
|
|
18
|
+
};
|
|
19
|
+
renderCanvasContext?: CanvasRenderingContext2D;
|
|
20
|
+
colormapId?: string;
|
|
21
|
+
colorLUT?: CPUFallbackLookupTable;
|
|
22
|
+
renderCanvasData?: ImageData;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default CPUFallbackRenderingTools;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import Point2 from './Point2';
|
|
2
|
+
import TransformMatrix2D from './TransformMatrix2D';
|
|
3
|
+
|
|
4
|
+
interface CPUFallbackTransform {
|
|
5
|
+
reset: () => void;
|
|
6
|
+
clone: () => CPUFallbackTransform;
|
|
7
|
+
multiply: (matrix: TransformMatrix2D) => void;
|
|
8
|
+
getMatrix: () => TransformMatrix2D;
|
|
9
|
+
invert: () => void;
|
|
10
|
+
rotate: (rad: number) => void;
|
|
11
|
+
translate: (x: number, y: number) => void;
|
|
12
|
+
scale: (sx: number, sy: number) => void;
|
|
13
|
+
transformPoint: (point: Point2) => Point2;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default CPUFallbackTransform;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import CPUFallbackViewportDisplayedArea from './CPUFallbackViewportDisplayedArea';
|
|
2
|
+
import CPUFallbackColormap from './CPUFallbackColormap';
|
|
3
|
+
import CPUFallbackLUT from './CPUFallbackLUT';
|
|
4
|
+
|
|
5
|
+
type CPUFallbackViewport = {
|
|
6
|
+
scale?: number;
|
|
7
|
+
parallelScale?: number;
|
|
8
|
+
focalPoint?: number[];
|
|
9
|
+
translation?: {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
};
|
|
13
|
+
voi?: {
|
|
14
|
+
windowWidth: number;
|
|
15
|
+
windowCenter: number;
|
|
16
|
+
};
|
|
17
|
+
invert?: boolean;
|
|
18
|
+
pixelReplication?: boolean;
|
|
19
|
+
rotation?: number;
|
|
20
|
+
hflip?: boolean;
|
|
21
|
+
vflip?: boolean;
|
|
22
|
+
modalityLUT?: CPUFallbackLUT;
|
|
23
|
+
voiLUT?: CPUFallbackLUT;
|
|
24
|
+
colormap?: CPUFallbackColormap;
|
|
25
|
+
displayedArea?: CPUFallbackViewportDisplayedArea;
|
|
26
|
+
modality?: string;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default CPUFallbackViewport;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type CPUFallbackViewportDisplayedArea = {
|
|
2
|
+
tlhc: {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
};
|
|
6
|
+
brhc: {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
};
|
|
10
|
+
rowPixelSpacing: number;
|
|
11
|
+
columnPixelSpacing: number;
|
|
12
|
+
presentationSizeMode: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default CPUFallbackViewportDisplayedArea;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Point3, Scaling, Mat3 } from '../types';
|
|
2
|
+
|
|
3
|
+
type CPUImageData = {
|
|
4
|
+
worldToIndex?: (point: Point3) => Point3;
|
|
5
|
+
indexToWorld?: (point: Point3) => Point3;
|
|
6
|
+
getWorldToIndex?: () => Point3;
|
|
7
|
+
getIndexToWorld?: () => Point3;
|
|
8
|
+
/** Last spacing is always EPSILON */
|
|
9
|
+
getSpacing?: () => Point3;
|
|
10
|
+
getDirection?: () => Mat3;
|
|
11
|
+
getScalarData?: () => number[];
|
|
12
|
+
/** Last index is always 1 */
|
|
13
|
+
getDimensions?: () => Point3;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
type CPUIImageData = {
|
|
17
|
+
dimensions: Point3;
|
|
18
|
+
direction: Mat3;
|
|
19
|
+
spacing: Point3;
|
|
20
|
+
origin: Point3;
|
|
21
|
+
imageData: CPUImageData;
|
|
22
|
+
metadata: { Modality: string };
|
|
23
|
+
scalarData: number[];
|
|
24
|
+
scaling: Scaling;
|
|
25
|
+
/** whether the image has pixel spacing and it is not undefined */
|
|
26
|
+
hasPixelSpacing?: boolean;
|
|
27
|
+
/** preScale object */
|
|
28
|
+
preScale?: {
|
|
29
|
+
/** boolean flag to indicate whether the image has been scaled */
|
|
30
|
+
scaled?: boolean;
|
|
31
|
+
/** scaling parameters */
|
|
32
|
+
scalingParameters?: {
|
|
33
|
+
/** modality of the image */
|
|
34
|
+
modality?: string;
|
|
35
|
+
/** rescale slop */
|
|
36
|
+
rescaleSlope?: number;
|
|
37
|
+
/** rescale intercept */
|
|
38
|
+
rescaleIntercept?: number;
|
|
39
|
+
/** PT suvbw */
|
|
40
|
+
suvbw?: number;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export default CPUIImageData;
|
|
46
|
+
|
|
47
|
+
export { CPUImageData };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ContourType } from '../enums';
|
|
2
|
+
import Point3 from './Point3';
|
|
3
|
+
|
|
4
|
+
type PublicContourSetData = ContourSetData;
|
|
5
|
+
|
|
6
|
+
type ContourSetData = {
|
|
7
|
+
id: string;
|
|
8
|
+
data: ContourData[];
|
|
9
|
+
frameOfReferenceUID: string;
|
|
10
|
+
color?: Point3;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
type ContourData = {
|
|
14
|
+
points: Point3[];
|
|
15
|
+
type: ContourType;
|
|
16
|
+
color?: Point3;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export type { PublicContourSetData, ContourSetData, ContourData };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
type Cornerstone3DConfig = {
|
|
2
|
+
detectGPU: any;
|
|
3
|
+
rendering: {
|
|
4
|
+
// vtk.js supports 8bit integer textures and 32bit float textures.
|
|
5
|
+
// However, if the client has norm16 textures (it can be seen by visiting
|
|
6
|
+
// the webGl report at https://webglreport.com/?v=2), vtk will be default
|
|
7
|
+
// to use it to improve memory usage. However, if the client don't have
|
|
8
|
+
// it still another level of optimization can happen by setting the
|
|
9
|
+
// preferSizeOverAccuracy since it will reduce the size of the texture to half
|
|
10
|
+
// float at the cost of accuracy in rendering. This is a tradeoff that the
|
|
11
|
+
// client can decide.
|
|
12
|
+
//
|
|
13
|
+
// Read more in the following Pull Request:
|
|
14
|
+
// 1. HalfFloat: https://github.com/Kitware/vtk-js/pull/2046
|
|
15
|
+
// 2. Norm16: https://github.com/Kitware/vtk-js/pull/2058
|
|
16
|
+
preferSizeOverAccuracy: boolean;
|
|
17
|
+
// Whether the EXT_texture_norm16 extension is supported by the browser.
|
|
18
|
+
// WebGL 2 report (link: https://webglreport.com/?v=2) can be used to check
|
|
19
|
+
// if the browser supports this extension.
|
|
20
|
+
// In case the browser supports this extension, instead of using 32bit float
|
|
21
|
+
// textures, 16bit float textures will be used to reduce the memory usage where
|
|
22
|
+
// possible.
|
|
23
|
+
// Norm16 may not work currently due to the two active bugs in chrome + safari
|
|
24
|
+
// https://bugs.chromium.org/p/chromium/issues/detail?id=1408247
|
|
25
|
+
// https://bugs.webkit.org/show_bug.cgi?id=252039
|
|
26
|
+
useNorm16Texture: boolean;
|
|
27
|
+
useCPURendering: boolean;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default Cornerstone3DConfig;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface CustomEvent<T = any> extends Event {
|
|
2
|
+
/**
|
|
3
|
+
* Returns any custom data event was created with. Typically used for synthetic events.
|
|
4
|
+
*/
|
|
5
|
+
readonly detail: T;
|
|
6
|
+
initCustomEvent(
|
|
7
|
+
typeArg: string,
|
|
8
|
+
canBubbleArg: boolean,
|
|
9
|
+
cancelableArg: boolean,
|
|
10
|
+
detailArg: T
|
|
11
|
+
): void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default CustomEvent;
|