@cornerstonejs/core 2.0.0-beta.21 → 2.0.0-beta.23
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/RenderingEngine/BaseVolumeViewport.d.ts +1 -1
- package/dist/esm/RenderingEngine/BaseVolumeViewport.js +16 -6
- package/dist/esm/RenderingEngine/RenderingEngine.d.ts +1 -2
- package/dist/esm/RenderingEngine/RenderingEngine.js +2 -1
- package/dist/esm/RenderingEngine/StackViewport.d.ts +1 -3
- package/dist/esm/RenderingEngine/StackViewport.js +15 -8
- package/dist/esm/RenderingEngine/VideoViewport.js +2 -2
- package/dist/esm/RenderingEngine/Viewport.js +4 -1
- package/dist/esm/RenderingEngine/VolumeViewport.d.ts +1 -1
- package/dist/esm/RenderingEngine/VolumeViewport.js +8 -3
- package/dist/esm/RenderingEngine/WSIViewport.js +1 -1
- package/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/renderPseudoColorImage.js +1 -1
- package/dist/esm/RenderingEngine/helpers/createVolumeActor.js +1 -1
- package/dist/esm/RenderingEngine/helpers/setDefaultVolumeVOI.js +3 -2
- package/dist/esm/RenderingEngine/helpers/volumeNewImageEventDispatcher.js +4 -4
- package/dist/esm/RenderingEngine/vtkClasses/vtkStreamingOpenGLTexture.js +1 -1
- package/dist/esm/cache/cache.js +2 -1
- package/dist/esm/cache/classes/BaseStreamingImageVolume.d.ts +85 -0
- package/dist/esm/cache/classes/BaseStreamingImageVolume.js +339 -0
- package/dist/esm/cache/classes/ImageVolume.js +2 -1
- package/dist/esm/cache/classes/StreamingDynamicImageVolume.d.ts +52 -0
- package/dist/esm/cache/classes/StreamingDynamicImageVolume.js +81 -0
- package/dist/esm/cache/classes/StreamingImageVolume.d.ts +8 -0
- package/dist/esm/cache/classes/StreamingImageVolume.js +21 -0
- package/dist/esm/cache/index.d.ts +4 -3
- package/dist/esm/cache/index.js +4 -3
- package/dist/esm/enums/Events.d.ts +2 -1
- package/dist/esm/enums/Events.js +1 -0
- package/dist/esm/index.d.ts +8 -3
- package/dist/esm/index.js +8 -3
- package/dist/esm/init.js +1 -1
- package/dist/esm/loaders/ProgressiveRetrieveImages.js +4 -2
- package/dist/esm/loaders/cornerstoneStreamingDynamicImageVolumeLoader.d.ts +10 -0
- package/dist/esm/loaders/cornerstoneStreamingDynamicImageVolumeLoader.js +58 -0
- package/dist/esm/loaders/cornerstoneStreamingImageVolumeLoader.d.ts +12 -0
- package/dist/esm/loaders/cornerstoneStreamingImageVolumeLoader.js +73 -0
- package/dist/esm/loaders/geometryLoader.js +1 -1
- package/dist/esm/loaders/imageLoader.js +6 -2
- package/dist/esm/loaders/volumeLoader.d.ts +1 -0
- package/dist/esm/loaders/volumeLoader.js +34 -5
- package/dist/esm/requestPool/requestPoolManager.js +1 -1
- package/dist/esm/types/CPUFallbackEnabledElement.d.ts +1 -39
- package/dist/esm/types/IImage.d.ts +37 -2
- package/dist/esm/types/ImageLoadRequests.d.ts +24 -0
- package/dist/esm/types/ImageLoadRequests.js +1 -0
- package/dist/esm/types/index.d.ts +3 -2
- package/dist/esm/utilities/VoxelManager.js +1 -1
- package/dist/esm/utilities/autoLoad.d.ts +2 -0
- package/dist/esm/utilities/autoLoad.js +28 -0
- package/dist/esm/utilities/calculateViewportsSpatialRegistration.js +3 -3
- package/dist/esm/utilities/convertVolumeToStackViewport.js +2 -1
- package/dist/esm/utilities/getClosestStackImageIndexForPoint.js +2 -2
- package/dist/esm/utilities/getDynamicVolumeInfo.d.ts +6 -0
- package/dist/esm/utilities/getDynamicVolumeInfo.js +7 -0
- package/dist/esm/utilities/getImageLegacy.js +1 -1
- package/dist/esm/utilities/getScalingParameters.js +4 -4
- package/dist/esm/utilities/getViewportImageIds.js +1 -1
- package/dist/esm/utilities/imageToWorldCoords.js +2 -2
- package/dist/esm/utilities/index.d.ts +5 -1
- package/dist/esm/utilities/index.js +6 -2
- package/dist/esm/utilities/isValidVolume.js +1 -1
- package/dist/esm/utilities/loadImageToCanvas.js +1 -1
- package/dist/esm/utilities/makeVolumeMetadata.js +5 -5
- package/dist/esm/utilities/scaleArray.d.ts +2 -0
- package/dist/esm/utilities/scaleArray.js +15 -0
- package/dist/esm/utilities/sortImageIdsAndGetSpacing.js +2 -1
- package/dist/esm/utilities/splitImageIdsBy4DTags.d.ts +5 -0
- package/dist/esm/utilities/splitImageIdsBy4DTags.js +161 -0
- package/dist/esm/utilities/worldToImageCoords.js +2 -2
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +3 -2
- package/dist/esm/utilities/isTypedArray.d.ts +0 -1
- package/dist/esm/utilities/isTypedArray.js +0 -11
|
@@ -3,8 +3,8 @@ import type { BlendModes, InterpolationType, OrientationAxis } from '../enums';
|
|
|
3
3
|
import type { FlipDirection, IImageData, IVolumeInput, OrientationVectors, Point2, Point3, VolumeViewportProperties, ViewReferenceSpecifier, ReferenceCompatibleOptions, ViewReference, IVolumeViewport } from '../types';
|
|
4
4
|
import type { VoiModifiedEventDetail } from '../types/EventTypes';
|
|
5
5
|
import type { ViewportInput } from '../types/IViewport';
|
|
6
|
-
import Viewport from './Viewport';
|
|
7
6
|
import type { TransferFunctionNodes } from '../types/ITransferFunctionNode';
|
|
7
|
+
import Viewport from './Viewport';
|
|
8
8
|
declare abstract class BaseVolumeViewport extends Viewport implements IVolumeViewport {
|
|
9
9
|
useCPURendering: boolean;
|
|
10
10
|
private _FrameOfReferenceUID;
|
|
@@ -2,20 +2,30 @@ import vtkColorTransferFunction from '@kitware/vtk.js/Rendering/Core/ColorTransf
|
|
|
2
2
|
import vtkColorMaps from '@kitware/vtk.js/Rendering/Core/ColorTransferFunction/ColorMaps';
|
|
3
3
|
import vtkPiecewiseFunction from '@kitware/vtk.js/Common/DataModel/PiecewiseFunction';
|
|
4
4
|
import { vec2, vec3 } from 'gl-matrix';
|
|
5
|
-
import cache from '../cache';
|
|
5
|
+
import cache from '../cache/cache';
|
|
6
6
|
import { MPR_CAMERA_VALUES, RENDERING_DEFAULTS, VIEWPORT_PRESETS, } from '../constants';
|
|
7
7
|
import { Events, ViewportStatus, VOILUTFunctionType } from '../enums';
|
|
8
8
|
import ViewportType from '../enums/ViewportType';
|
|
9
9
|
import eventTarget from '../eventTarget';
|
|
10
10
|
import { getShouldUseCPURendering } from '../init';
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import vtkSlabCamera from './vtkClasses/vtkSlabCamera';
|
|
11
|
+
import triggerEvent from '../utilities/triggerEvent';
|
|
12
|
+
import * as colormapUtils from '../utilities/colormap';
|
|
13
|
+
import invertRgbTransferFunction from '../utilities/invertRgbTransferFunction';
|
|
14
|
+
import createSigmoidRGBTransferFunction from '../utilities/createSigmoidRGBTransferFunction';
|
|
16
15
|
import transformWorldToIndex from '../utilities/transformWorldToIndex';
|
|
17
16
|
import { findMatchingColormap } from '../utilities/colormap';
|
|
18
17
|
import { getTransferFunctionNodes } from '../utilities/transferFunctionUtils';
|
|
18
|
+
import createVolumeActor from './helpers/createVolumeActor';
|
|
19
|
+
import volumeNewImageEventDispatcher, { resetVolumeNewImageState, } from './helpers/volumeNewImageEventDispatcher';
|
|
20
|
+
import Viewport from './Viewport';
|
|
21
|
+
import vtkSlabCamera from './vtkClasses/vtkSlabCamera';
|
|
22
|
+
import getVolumeViewportScrollInfo from '../utilities/getVolumeViewportScrollInfo';
|
|
23
|
+
import { actorIsA } from '../utilities/actorCheck';
|
|
24
|
+
import snapFocalPointToSlice from '../utilities/snapFocalPointToSlice';
|
|
25
|
+
import getVoiFromSigmoidRGBTransferFunction from '../utilities/getVoiFromSigmoidRGBTransferFunction';
|
|
26
|
+
import isEqual, { isEqualNegative } from '../utilities/isEqual';
|
|
27
|
+
import applyPreset from '../utilities/applyPreset';
|
|
28
|
+
import imageIdToURI from '../utilities/imageIdToURI';
|
|
19
29
|
class BaseVolumeViewport extends Viewport {
|
|
20
30
|
constructor(props) {
|
|
21
31
|
super(props);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type IStackViewport from '../types/IStackViewport';
|
|
2
2
|
import type IRenderingEngine from '../types/IRenderingEngine';
|
|
3
3
|
import type IVolumeViewport from '../types/IVolumeViewport';
|
|
4
|
-
import type { IViewport } from '../types/IViewport';
|
|
5
|
-
import type { PublicViewportInput } from '../types/IViewport';
|
|
4
|
+
import type { PublicViewportInput, IViewport } from '../types/IViewport';
|
|
6
5
|
declare class RenderingEngine implements IRenderingEngine {
|
|
7
6
|
readonly id: string;
|
|
8
7
|
hasBeenDestroyed: boolean;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import Events from '../enums/Events';
|
|
2
2
|
import renderingEngineCache from './renderingEngineCache';
|
|
3
3
|
import eventTarget from '../eventTarget';
|
|
4
|
-
import
|
|
4
|
+
import uuidv4 from '../utilities/uuidv4';
|
|
5
|
+
import triggerEvent from '../utilities/triggerEvent';
|
|
5
6
|
import { vtkOffscreenMultiRenderWindow } from './vtkClasses';
|
|
6
7
|
import ViewportType from '../enums/ViewportType';
|
|
7
8
|
import VolumeViewport from './VolumeViewport';
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import type { vtkImageData as vtkImageDataType } from '@kitware/vtk.js/Common/DataModel/ImageData';
|
|
2
2
|
import { mat4 } from 'gl-matrix';
|
|
3
|
-
import type { ActorEntry, CPUIImageData, ICamera, IImage, IImageData, IImagesLoader, IStackInput, IStackViewport, ImageLoadListener, Mat3, Point2, Point3, Scaling, StackViewportProperties, ViewReference } from '../types';
|
|
4
|
-
import type { ViewReferenceSpecifier, ReferenceCompatibleOptions, ViewportInput } from '../types/IViewport';
|
|
3
|
+
import type { ActorEntry, CPUIImageData, ICamera, IImage, IImageData, IImagesLoader, IStackInput, IStackViewport, ImageLoadListener, Mat3, Point2, Point3, Scaling, StackViewportProperties, ViewReference, ViewReferenceSpecifier, ReferenceCompatibleOptions, ViewportInput, ImagePixelModule, ImagePlaneModule } from '../types';
|
|
5
4
|
import Viewport from './Viewport';
|
|
6
5
|
import { InterpolationType, RequestType, ViewportStatus } from '../enums';
|
|
7
|
-
import type { ImagePixelModule, ImagePlaneModule } from '../types';
|
|
8
6
|
import type vtkRenderer from '@kitware/vtk.js/Rendering/Core/Renderer';
|
|
9
7
|
export interface ImageDataMetaData {
|
|
10
8
|
bitsAllocated: number;
|
|
@@ -8,9 +8,19 @@ import vtkImageSlice from '@kitware/vtk.js/Rendering/Core/ImageSlice';
|
|
|
8
8
|
import { mat4, vec2, vec3 } from 'gl-matrix';
|
|
9
9
|
import eventTarget from '../eventTarget';
|
|
10
10
|
import * as metaData from '../metaData';
|
|
11
|
-
import { actorIsA,
|
|
11
|
+
import { actorIsA, isImageActor } from '../utilities/actorCheck';
|
|
12
|
+
import * as colormapUtils from '../utilities/colormap';
|
|
13
|
+
import { getTransferFunctionNodes, setTransferFunctionNodes, } from '../utilities/transferFunctionUtils';
|
|
14
|
+
import * as windowLevelUtil from '../utilities/windowLevel';
|
|
15
|
+
import createLinearRGBTransferFunction from '../utilities/createLinearRGBTransferFunction';
|
|
16
|
+
import createSigmoidRGBTransferFunction from '../utilities/createSigmoidRGBTransferFunction';
|
|
17
|
+
import { updateVTKImageDataWithCornerstoneImage } from '../utilities/updateVTKImageDataWithCornerstoneImage';
|
|
18
|
+
import triggerEvent from '../utilities/triggerEvent';
|
|
19
|
+
import { isEqual } from '../utilities/isEqual';
|
|
20
|
+
import invertRgbTransferFunction from '../utilities/invertRgbTransferFunction';
|
|
21
|
+
import imageRetrieveMetadataProvider from '../utilities/imageRetrieveMetadataProvider';
|
|
22
|
+
import imageIdToURI from '../utilities/imageIdToURI';
|
|
12
23
|
import Viewport from './Viewport';
|
|
13
|
-
import { getColormap } from './helpers/cpuFallback/colors/index';
|
|
14
24
|
import drawImageSync from './helpers/cpuFallback/drawImageSync';
|
|
15
25
|
import { Events, InterpolationType, MetadataModules, RequestType, VOILUTFunctionType, ViewportStatus, } from '../enums';
|
|
16
26
|
import { loadAndCacheImage } from '../loaders/imageLoader';
|
|
@@ -20,15 +30,12 @@ import canvasToPixel from './helpers/cpuFallback/rendering/canvasToPixel';
|
|
|
20
30
|
import getDefaultViewport from './helpers/cpuFallback/rendering/getDefaultViewport';
|
|
21
31
|
import pixelToCanvas from './helpers/cpuFallback/rendering/pixelToCanvas';
|
|
22
32
|
import resize from './helpers/cpuFallback/rendering/resize';
|
|
23
|
-
import cache from '../cache';
|
|
33
|
+
import cache from '../cache/cache';
|
|
24
34
|
import { getConfiguration, getShouldUseCPURendering } from '../init';
|
|
25
35
|
import { createProgressive } from '../loaders/ProgressiveRetrieveImages';
|
|
26
|
-
import createLinearRGBTransferFunction from '../utilities/createLinearRGBTransferFunction';
|
|
27
|
-
import { getTransferFunctionNodes, setTransferFunctionNodes, } from '../utilities/transferFunctionUtils';
|
|
28
36
|
import correctShift from './helpers/cpuFallback/rendering/correctShift';
|
|
29
37
|
import resetCamera from './helpers/cpuFallback/rendering/resetCamera';
|
|
30
38
|
import { Transform } from './helpers/cpuFallback/rendering/transform';
|
|
31
|
-
import { findMatchingColormap } from '../utilities/colormap';
|
|
32
39
|
const EPSILON = 1;
|
|
33
40
|
class StackViewport extends Viewport {
|
|
34
41
|
constructor(props) {
|
|
@@ -627,7 +634,7 @@ class StackViewport extends Viewport {
|
|
|
627
634
|
return acc;
|
|
628
635
|
}, []);
|
|
629
636
|
const defaultActor = this.getDefaultActor();
|
|
630
|
-
const matchedColormap = findMatchingColormap(RGBPoints, defaultActor.actor);
|
|
637
|
+
const matchedColormap = colormapUtils.findMatchingColormap(RGBPoints, defaultActor.actor);
|
|
631
638
|
this.setColormap(matchedColormap);
|
|
632
639
|
}
|
|
633
640
|
resetToDefaultProperties() {
|
|
@@ -1772,7 +1779,7 @@ class StackViewport extends Viewport {
|
|
|
1772
1779
|
}
|
|
1773
1780
|
setColormapCPU(colormapData) {
|
|
1774
1781
|
this.colormap = colormapData;
|
|
1775
|
-
const colormap = getColormap(colormapData.name
|
|
1782
|
+
const colormap = colormapUtils.getColormap(colormapData.name);
|
|
1776
1783
|
this._cpuFallbackEnabledElement.viewport.colormap = colormap;
|
|
1777
1784
|
this._cpuFallbackEnabledElement.renderingTools = {};
|
|
1778
1785
|
this.fillWithBackgroundColor();
|
|
@@ -2,11 +2,11 @@ import { vec3 } from 'gl-matrix';
|
|
|
2
2
|
import { Events as EVENTS, VideoEnums as VideoViewportEnum, MetadataModules, } from '../enums';
|
|
3
3
|
import * as metaData from '../metaData';
|
|
4
4
|
import { Transform } from './helpers/cpuFallback/rendering/transform';
|
|
5
|
-
import
|
|
5
|
+
import triggerEvent from '../utilities/triggerEvent';
|
|
6
6
|
import Viewport from './Viewport';
|
|
7
7
|
import { getOrCreateCanvas } from './helpers';
|
|
8
8
|
import CanvasActor from './CanvasActor';
|
|
9
|
-
import cache from '../cache';
|
|
9
|
+
import cache from '../cache/cache';
|
|
10
10
|
class VideoViewport extends Viewport {
|
|
11
11
|
static { this.frameRangeExtractor = /(\/frames\/|[&?]frameNumber=)([^/&?]*)/i; }
|
|
12
12
|
constructor(props) {
|
|
@@ -6,7 +6,10 @@ import Events from '../enums/Events';
|
|
|
6
6
|
import ViewportStatus from '../enums/ViewportStatus';
|
|
7
7
|
import ViewportType from '../enums/ViewportType';
|
|
8
8
|
import renderingEngineCache from './renderingEngineCache';
|
|
9
|
-
import {
|
|
9
|
+
import { actorIsA, isImageActor } from '../utilities/actorCheck';
|
|
10
|
+
import triggerEvent from '../utilities/triggerEvent';
|
|
11
|
+
import * as planar from '../utilities/planar';
|
|
12
|
+
import isEqual from '../utilities/isEqual';
|
|
10
13
|
import hasNaNValues from '../utilities/hasNaNValues';
|
|
11
14
|
import { RENDERING_DEFAULTS } from '../constants';
|
|
12
15
|
import { InterpolationType } from '../enums';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { mat4 } from 'gl-matrix';
|
|
1
2
|
import type { BlendModes } from '../enums';
|
|
2
3
|
import { OrientationAxis } from '../enums';
|
|
3
4
|
import type { IVolumeInput, OrientationVectors, Point3, ViewReference, ViewReferenceSpecifier } from '../types';
|
|
4
5
|
import type { ViewportInput } from '../types/IViewport';
|
|
5
6
|
import BaseVolumeViewport from './BaseVolumeViewport';
|
|
6
|
-
import { mat4 } from 'gl-matrix';
|
|
7
7
|
declare class VolumeViewport extends BaseVolumeViewport {
|
|
8
8
|
private _useAcquisitionPlaneForViewPlane;
|
|
9
9
|
constructor(props: ViewportInput);
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
+
import { mat4, vec3 } from 'gl-matrix';
|
|
1
2
|
import vtkPlane from '@kitware/vtk.js/Common/DataModel/Plane';
|
|
2
|
-
import cache from '../cache';
|
|
3
|
+
import cache from '../cache/cache';
|
|
3
4
|
import { EPSILON, MPR_CAMERA_VALUES, RENDERING_DEFAULTS } from '../constants';
|
|
4
5
|
import { OrientationAxis, Events } from '../enums';
|
|
5
|
-
import { actorIsA,
|
|
6
|
+
import { actorIsA, isImageActor } from '../utilities/actorCheck';
|
|
7
|
+
import getClosestImageId from '../utilities/getClosestImageId';
|
|
8
|
+
import getSliceRange from '../utilities/getSliceRange';
|
|
9
|
+
import getSpacingInNormalDirection from '../utilities/getSpacingInNormalDirection';
|
|
10
|
+
import snapFocalPointToSlice from '../utilities/snapFocalPointToSlice';
|
|
11
|
+
import triggerEvent from '../utilities/triggerEvent';
|
|
6
12
|
import BaseVolumeViewport from './BaseVolumeViewport';
|
|
7
13
|
import setDefaultVolumeVOI from './helpers/setDefaultVolumeVOI';
|
|
8
14
|
import { setTransferFunctionNodes } from '../utilities/transferFunctionUtils';
|
|
9
15
|
import getImageSliceDataForVolumeViewport from '../utilities/getImageSliceDataForVolumeViewport';
|
|
10
|
-
import { mat4, vec3 } from 'gl-matrix';
|
|
11
16
|
import { transformCanvasToIJK } from '../utilities/transformCanvasToIJK';
|
|
12
17
|
import { transformIJKToCanvas } from '../utilities/transformIJKToCanvas';
|
|
13
18
|
class VolumeViewport extends BaseVolumeViewport {
|
|
@@ -6,7 +6,7 @@ import { Transform } from './helpers/cpuFallback/rendering/transform';
|
|
|
6
6
|
import Viewport from './Viewport';
|
|
7
7
|
import { getOrCreateCanvas } from './helpers';
|
|
8
8
|
import { EPSILON } from '../constants';
|
|
9
|
-
import
|
|
9
|
+
import triggerEvent from '../utilities/triggerEvent';
|
|
10
10
|
import { peerImport } from '../init';
|
|
11
11
|
const _map = Symbol.for('map');
|
|
12
12
|
const EVENT_POSTRENDER = 'postrender';
|
|
@@ -7,7 +7,7 @@ import doesImageNeedToBeRendered from './doesImageNeedToBeRendered';
|
|
|
7
7
|
import storedPixelDataToCanvasImageDataPseudocolorLUT from './storedPixelDataToCanvasImageDataPseudocolorLUT';
|
|
8
8
|
import storedPixelDataToCanvasImageDataPseudocolorLUTPET from './storedPixelDataToCanvasImageDataPseudocolorLUTPET';
|
|
9
9
|
import * as colors from '../colors/index';
|
|
10
|
-
import { clamp } from '../../../../utilities';
|
|
10
|
+
import { clamp } from '../../../../utilities/clamp';
|
|
11
11
|
function getRenderCanvas(enabledElement, image, invalidated) {
|
|
12
12
|
if (!enabledElement.renderingTools.renderCanvas) {
|
|
13
13
|
enabledElement.renderingTools.renderCanvas =
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import vtkVolume from '@kitware/vtk.js/Rendering/Core/Volume';
|
|
2
2
|
import { loadVolume } from '../../loaders/volumeLoader';
|
|
3
3
|
import createVolumeMapper from './createVolumeMapper';
|
|
4
|
-
import
|
|
4
|
+
import triggerEvent from '../../utilities/triggerEvent';
|
|
5
5
|
import { Events } from '../../enums';
|
|
6
6
|
import setDefaultVolumeVOI from './setDefaultVolumeVOI';
|
|
7
7
|
async function createVolumeActor(props, element, viewportId, suppressEvents = false) {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { loadAndCacheImage } from '../../loaders/imageLoader';
|
|
2
2
|
import * as metaData from '../../metaData';
|
|
3
|
-
import
|
|
3
|
+
import getMinMax from '../../utilities/getMinMax';
|
|
4
|
+
import * as windowLevel from '../../utilities/windowLevel';
|
|
4
5
|
import { RequestType } from '../../enums';
|
|
5
|
-
import cache from '../../cache';
|
|
6
|
+
import cache from '../../cache/cache';
|
|
6
7
|
const PRIORITY = 0;
|
|
7
8
|
const REQUEST_TYPE = RequestType.Prefetch;
|
|
8
9
|
async function setDefaultVolumeVOI(volumeActor, imageVolume) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import getImageSliceDataForVolumeViewport from '../../utilities/getImageSliceDataForVolumeViewport';
|
|
2
|
+
import triggerEvent from '../../utilities/triggerEvent';
|
|
2
3
|
import { Events } from '../../enums';
|
|
3
4
|
import { getRenderingEngine } from '../getRenderingEngine';
|
|
4
|
-
import BaseVolumeViewport from '../BaseVolumeViewport';
|
|
5
5
|
const state = {};
|
|
6
6
|
export function resetVolumeNewImageState(viewportId) {
|
|
7
7
|
if (state[viewportId] !== undefined) {
|
|
@@ -12,8 +12,8 @@ function volumeNewImageEventDispatcher(cameraEvent) {
|
|
|
12
12
|
const { renderingEngineId, viewportId } = cameraEvent.detail;
|
|
13
13
|
const renderingEngine = getRenderingEngine(renderingEngineId);
|
|
14
14
|
const viewport = renderingEngine.getViewport(viewportId);
|
|
15
|
-
if (!(
|
|
16
|
-
throw new Error(`volumeNewImageEventDispatcher: viewport
|
|
15
|
+
if (!('setVolumes' in viewport)) {
|
|
16
|
+
throw new Error(`volumeNewImageEventDispatcher: viewport does not have setVolumes method`);
|
|
17
17
|
}
|
|
18
18
|
if (state[viewport.id] === undefined) {
|
|
19
19
|
state[viewport.id] = 0;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import macro from '@kitware/vtk.js/macros';
|
|
2
2
|
import vtkOpenGLTexture from '@kitware/vtk.js/Rendering/OpenGL/Texture';
|
|
3
|
-
import cache from '../../cache';
|
|
3
|
+
import cache from '../../cache/cache';
|
|
4
4
|
function vtkStreamingOpenGLTexture(publicAPI, model) {
|
|
5
5
|
model.classHierarchy.push('vtkStreamingOpenGLTexture');
|
|
6
6
|
model.updatedFrames = [];
|
package/dist/esm/cache/cache.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import triggerEvent from '../utilities/triggerEvent';
|
|
2
|
+
import imageIdToURI from '../utilities/imageIdToURI';
|
|
2
3
|
import eventTarget from '../eventTarget';
|
|
3
4
|
import Events from '../enums/Events';
|
|
4
5
|
const ONE_GB = 1073741824;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { ImageQualityStatus, RequestType } from '../../enums';
|
|
2
|
+
import type { IImagesLoader, ImageLoadRequests, ImageVolumeProps, IStreamingVolumeProperties, PixelDataTypedArrayString, ScalingParameters } from '../../types';
|
|
3
|
+
import ImageVolume from './ImageVolume';
|
|
4
|
+
export default class BaseStreamingImageVolume extends ImageVolume implements IImagesLoader {
|
|
5
|
+
private framesLoaded;
|
|
6
|
+
private framesProcessed;
|
|
7
|
+
private framesUpdated;
|
|
8
|
+
protected autoRenderOnLoad: boolean;
|
|
9
|
+
protected cachedFrames: any[];
|
|
10
|
+
protected reRenderTarget: number;
|
|
11
|
+
protected reRenderFraction: number;
|
|
12
|
+
dataType: PixelDataTypedArrayString;
|
|
13
|
+
loadStatus: {
|
|
14
|
+
loaded: boolean;
|
|
15
|
+
loading: boolean;
|
|
16
|
+
cancelled: boolean;
|
|
17
|
+
callbacks: Array<(...args: unknown[]) => void>;
|
|
18
|
+
};
|
|
19
|
+
imagesLoader: IImagesLoader;
|
|
20
|
+
constructor(imageVolumeProperties: ImageVolumeProps, streamingProperties: IStreamingVolumeProperties);
|
|
21
|
+
protected invalidateVolume(immediate: boolean): void;
|
|
22
|
+
cancelLoading: () => void;
|
|
23
|
+
clearLoadCallbacks(): void;
|
|
24
|
+
protected callLoadStatusCallback(evt: any): void;
|
|
25
|
+
protected updateTextureAndTriggerEvents(imageIdIndex: any, imageId: any, imageQualityStatus?: ImageQualityStatus): void;
|
|
26
|
+
successCallback(imageId: string, image: any): void;
|
|
27
|
+
errorCallback(imageId: any, permanent: any, error: any): void;
|
|
28
|
+
load: (callback: (...args: unknown[]) => void) => void;
|
|
29
|
+
getLoaderImageOptions(imageId: string): {
|
|
30
|
+
targetBuffer: {
|
|
31
|
+
type: PixelDataTypedArrayString;
|
|
32
|
+
rows: any;
|
|
33
|
+
columns: any;
|
|
34
|
+
};
|
|
35
|
+
allowFloatRendering: boolean;
|
|
36
|
+
preScale: {
|
|
37
|
+
enabled: boolean;
|
|
38
|
+
scalingParameters: ScalingParameters;
|
|
39
|
+
};
|
|
40
|
+
transferPixelData: boolean;
|
|
41
|
+
requestType: RequestType;
|
|
42
|
+
transferSyntaxUID: any;
|
|
43
|
+
additionalDetails: {
|
|
44
|
+
imageId: string;
|
|
45
|
+
imageIdIndex: number;
|
|
46
|
+
volumeId: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
callLoadImage(imageId: any, imageIdIndex: any, options: any): any;
|
|
50
|
+
protected getImageIdsRequests(imageIds: string[], priorityDefault: number): {
|
|
51
|
+
callLoadImage: (imageId: any, imageIdIndex: any, options: any) => any;
|
|
52
|
+
imageId: string;
|
|
53
|
+
imageIdIndex: number;
|
|
54
|
+
options: {
|
|
55
|
+
targetBuffer: {
|
|
56
|
+
type: PixelDataTypedArrayString;
|
|
57
|
+
rows: any;
|
|
58
|
+
columns: any;
|
|
59
|
+
};
|
|
60
|
+
allowFloatRendering: boolean;
|
|
61
|
+
preScale: {
|
|
62
|
+
enabled: boolean;
|
|
63
|
+
scalingParameters: ScalingParameters;
|
|
64
|
+
};
|
|
65
|
+
transferPixelData: boolean;
|
|
66
|
+
requestType: RequestType;
|
|
67
|
+
transferSyntaxUID: any;
|
|
68
|
+
additionalDetails: {
|
|
69
|
+
imageId: string;
|
|
70
|
+
imageIdIndex: number;
|
|
71
|
+
volumeId: string;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
priority: number;
|
|
75
|
+
requestType: RequestType;
|
|
76
|
+
additionalDetails: {
|
|
77
|
+
volumeId: string;
|
|
78
|
+
};
|
|
79
|
+
}[];
|
|
80
|
+
getImageLoadRequests(priority: number): ImageLoadRequests[];
|
|
81
|
+
getImageIdsToLoad(): string[];
|
|
82
|
+
loadImages(): Promise<boolean>;
|
|
83
|
+
private _prefetchImageIds;
|
|
84
|
+
private _addScalingToVolume;
|
|
85
|
+
}
|