@cornerstonejs/core 4.21.5 → 4.21.6
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 +2 -1
- package/dist/esm/RenderingEngine/BaseVolumeViewport.js +17 -2
- package/dist/esm/RenderingEngine/VolumeViewport.js +2 -8
- package/dist/esm/RenderingEngine/VolumeViewport3D.js +2 -8
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { mat4 } from 'gl-matrix';
|
|
2
2
|
import type { BlendModes, InterpolationType } from '../enums';
|
|
3
3
|
import { OrientationAxis } from '../enums';
|
|
4
|
-
import type { FlipDirection, IImageData, IVolumeInput, OrientationVectors, Point2, Point3, VolumeViewportProperties, ViewReferenceSpecifier, ReferenceCompatibleOptions, ViewReference, ICamera } from '../types';
|
|
4
|
+
import type { ActorEntry, FlipDirection, IImageData, IVolumeInput, OrientationVectors, Point2, Point3, VolumeViewportProperties, ViewReferenceSpecifier, ReferenceCompatibleOptions, ViewReference, ICamera } from '../types';
|
|
5
5
|
import type { VoiModifiedEventDetail } from '../types/EventTypes';
|
|
6
6
|
import type { PlaneRestriction, ViewportInput } from '../types/IViewport';
|
|
7
7
|
import type { TransferFunctionNodes } from '../types/ITransferFunctionNode';
|
|
@@ -56,6 +56,7 @@ declare abstract class BaseVolumeViewport extends Viewport {
|
|
|
56
56
|
private setSmoothing;
|
|
57
57
|
protected shouldUseCustomRenderPass(): boolean;
|
|
58
58
|
getRenderPasses: () => any[];
|
|
59
|
+
protected _restoreVolumeRenderingDefaults(volumeActor: ActorEntry, volumeId: string): void;
|
|
59
60
|
resetToDefaultProperties(volumeId: string): void;
|
|
60
61
|
private setPreset;
|
|
61
62
|
setSampleDistanceMultiplier(multiplier: number): void;
|
|
@@ -14,13 +14,13 @@ import invertRgbTransferFunction from '../utilities/invertRgbTransferFunction';
|
|
|
14
14
|
import createSigmoidRGBTransferFunction from '../utilities/createSigmoidRGBTransferFunction';
|
|
15
15
|
import transformWorldToIndex from '../utilities/transformWorldToIndex';
|
|
16
16
|
import { findMatchingColormap, updateOpacity as colormapUpdateOpacity, updateThreshold as colormapUpdateThreshold, getThresholdValue, getMaxOpacity, } from '../utilities/colormap';
|
|
17
|
-
import { getTransferFunctionNodes } from '../utilities/transferFunctionUtils';
|
|
17
|
+
import { getTransferFunctionNodes, setTransferFunctionNodes, } from '../utilities/transferFunctionUtils';
|
|
18
18
|
import createVolumeActor from './helpers/createVolumeActor';
|
|
19
19
|
import volumeNewImageEventDispatcher, { resetVolumeNewImageState, } from './helpers/volumeNewImageEventDispatcher';
|
|
20
20
|
import Viewport from './Viewport';
|
|
21
21
|
import vtkSlabCamera from './vtkClasses/vtkSlabCamera';
|
|
22
22
|
import getVolumeViewportScrollInfo from '../utilities/getVolumeViewportScrollInfo';
|
|
23
|
-
import { actorIsA } from '../utilities/actorCheck';
|
|
23
|
+
import { actorIsA, isImageActor } from '../utilities/actorCheck';
|
|
24
24
|
import snapFocalPointToSlice from '../utilities/snapFocalPointToSlice';
|
|
25
25
|
import getVoiFromSigmoidRGBTransferFunction from '../utilities/getVoiFromSigmoidRGBTransferFunction';
|
|
26
26
|
import isEqual, { isEqualAbs, isEqualNegative } from '../utilities/isEqual';
|
|
@@ -837,6 +837,21 @@ class BaseVolumeViewport extends Viewport {
|
|
|
837
837
|
shouldUseCustomRenderPass() {
|
|
838
838
|
return !this.useCPURendering;
|
|
839
839
|
}
|
|
840
|
+
_restoreVolumeRenderingDefaults(volumeActor, volumeId) {
|
|
841
|
+
if (!isImageActor(volumeActor)) {
|
|
842
|
+
return;
|
|
843
|
+
}
|
|
844
|
+
const properties = this.getDefaultProperties(volumeId);
|
|
845
|
+
if (properties?.preset || properties?.colormap) {
|
|
846
|
+
this.setProperties(properties, volumeId, true);
|
|
847
|
+
}
|
|
848
|
+
else {
|
|
849
|
+
const transferFunction = volumeActor.actor
|
|
850
|
+
.getProperty()
|
|
851
|
+
.getRGBTransferFunction(0);
|
|
852
|
+
setTransferFunctionNodes(transferFunction, this.initialTransferFunctionNodes);
|
|
853
|
+
}
|
|
854
|
+
}
|
|
840
855
|
resetToDefaultProperties(volumeId) {
|
|
841
856
|
const properties = this.globalDefaultProperties;
|
|
842
857
|
if (properties.colormap?.name) {
|
|
@@ -3,7 +3,7 @@ import vtkPlane from '@kitware/vtk.js/Common/DataModel/Plane';
|
|
|
3
3
|
import cache from '../cache/cache';
|
|
4
4
|
import { EPSILON, MPR_CAMERA_VALUES, RENDERING_DEFAULTS } from '../constants';
|
|
5
5
|
import { OrientationAxis, Events } from '../enums';
|
|
6
|
-
import { actorIsA
|
|
6
|
+
import { actorIsA } from '../utilities/actorCheck';
|
|
7
7
|
import getClosestImageId from '../utilities/getClosestImageId';
|
|
8
8
|
import getSliceRange from '../utilities/getSliceRange';
|
|
9
9
|
import getSpacingInNormalDirection from '../utilities/getSpacingInNormalDirection';
|
|
@@ -11,7 +11,6 @@ import snapFocalPointToSlice from '../utilities/snapFocalPointToSlice';
|
|
|
11
11
|
import triggerEvent from '../utilities/triggerEvent';
|
|
12
12
|
import BaseVolumeViewport from './BaseVolumeViewport';
|
|
13
13
|
import setDefaultVolumeVOI from './helpers/setDefaultVolumeVOI';
|
|
14
|
-
import { setTransferFunctionNodes } from '../utilities/transferFunctionUtils';
|
|
15
14
|
import getImageSliceDataForVolumeViewport from '../utilities/getImageSliceDataForVolumeViewport';
|
|
16
15
|
import { transformCanvasToIJK } from '../utilities/transformCanvasToIJK';
|
|
17
16
|
import { transformIJKToCanvas } from '../utilities/transformIJKToCanvas';
|
|
@@ -466,12 +465,7 @@ class VolumeViewport extends BaseVolumeViewport {
|
|
|
466
465
|
throw new Error(`imageVolume with id: ${volumeId} does not exist in cache`);
|
|
467
466
|
}
|
|
468
467
|
setDefaultVolumeVOI(volumeActor.actor, imageVolume);
|
|
469
|
-
|
|
470
|
-
const transferFunction = volumeActor.actor
|
|
471
|
-
.getProperty()
|
|
472
|
-
.getRGBTransferFunction(0);
|
|
473
|
-
setTransferFunctionNodes(transferFunction, this.initialTransferFunctionNodes);
|
|
474
|
-
}
|
|
468
|
+
this._restoreVolumeRenderingDefaults(volumeActor, volumeId);
|
|
475
469
|
const eventDetails = {
|
|
476
470
|
...super.getVOIModifiedEventDetail(volumeId),
|
|
477
471
|
};
|
|
@@ -3,8 +3,7 @@ import { OrientationAxis, Events } from '../enums';
|
|
|
3
3
|
import cache from '../cache/cache';
|
|
4
4
|
import setDefaultVolumeVOI from './helpers/setDefaultVolumeVOI';
|
|
5
5
|
import triggerEvent from '../utilities/triggerEvent';
|
|
6
|
-
import { actorIsA
|
|
7
|
-
import { setTransferFunctionNodes } from '../utilities/transferFunctionUtils';
|
|
6
|
+
import { actorIsA } from '../utilities/actorCheck';
|
|
8
7
|
import BaseVolumeViewport from './BaseVolumeViewport';
|
|
9
8
|
class VolumeViewport3D extends BaseVolumeViewport {
|
|
10
9
|
constructor(props) {
|
|
@@ -98,12 +97,7 @@ class VolumeViewport3D extends BaseVolumeViewport {
|
|
|
98
97
|
throw new Error(`imageVolume with id: ${volumeId} does not exist in cache`);
|
|
99
98
|
}
|
|
100
99
|
setDefaultVolumeVOI(volumeActor.actor, imageVolume);
|
|
101
|
-
|
|
102
|
-
const transferFunction = volumeActor.actor
|
|
103
|
-
.getProperty()
|
|
104
|
-
.getRGBTransferFunction(0);
|
|
105
|
-
setTransferFunctionNodes(transferFunction, this.initialTransferFunctionNodes);
|
|
106
|
-
}
|
|
100
|
+
this._restoreVolumeRenderingDefaults(volumeActor, volumeId);
|
|
107
101
|
this.setCamera(this.initialCamera);
|
|
108
102
|
triggerEvent(this.element, Events.VOI_MODIFIED, super.getVOIModifiedEventDetail(volumeId));
|
|
109
103
|
}
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "4.21.
|
|
1
|
+
export declare const version = "4.21.6";
|
package/dist/esm/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '4.21.
|
|
1
|
+
export const version = '4.21.6';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/core",
|
|
3
|
-
"version": "4.21.
|
|
3
|
+
"version": "4.21.6",
|
|
4
4
|
"description": "Cornerstone3D Core",
|
|
5
5
|
"module": "./dist/esm/index.js",
|
|
6
6
|
"types": "./dist/esm/index.d.ts",
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
"type": "individual",
|
|
98
98
|
"url": "https://ohif.org/donate"
|
|
99
99
|
},
|
|
100
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "f353e5f47d7535dd369b6a7e65ef12ef3f797153"
|
|
101
101
|
}
|