@cornerstonejs/core 1.13.2 → 1.14.0
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/RenderingEngine/BaseVolumeViewport.d.ts +2 -1
- package/dist/cjs/RenderingEngine/BaseVolumeViewport.js +13 -1
- package/dist/cjs/RenderingEngine/BaseVolumeViewport.js.map +1 -1
- package/dist/cjs/loaders/volumeLoader.d.ts +1 -1
- package/dist/cjs/loaders/volumeLoader.js.map +1 -1
- package/dist/cjs/types/AffineMatrix.d.ts +27 -0
- package/dist/cjs/types/AffineMatrix.js +3 -0
- package/dist/cjs/types/AffineMatrix.js.map +1 -0
- package/dist/cjs/types/Mat3.d.ts +1 -11
- package/dist/cjs/types/ViewportProperties.d.ts +2 -1
- package/dist/cjs/types/index.d.ts +2 -1
- package/dist/esm/RenderingEngine/BaseVolumeViewport.d.ts +2 -1
- package/dist/esm/RenderingEngine/BaseVolumeViewport.js +13 -1
- package/dist/esm/RenderingEngine/BaseVolumeViewport.js.map +1 -1
- package/dist/esm/loaders/volumeLoader.d.ts +1 -1
- package/dist/esm/loaders/volumeLoader.js.map +1 -1
- package/dist/esm/types/AffineMatrix.d.ts +27 -0
- package/dist/esm/types/AffineMatrix.js +2 -0
- package/dist/esm/types/AffineMatrix.js.map +1 -0
- package/dist/esm/types/Mat3.d.ts +1 -11
- package/dist/esm/types/ViewportProperties.d.ts +2 -1
- package/dist/esm/types/index.d.ts +2 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +2 -2
- package/src/RenderingEngine/BaseVolumeViewport.ts +23 -0
- package/src/loaders/volumeLoader.ts +2 -2
- package/src/types/AffineMatrix.ts +8 -0
- package/src/types/Mat3.ts +3 -11
- package/src/types/ViewportProperties.ts +3 -1
- package/src/types/index.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/umd/index.js",
|
|
6
6
|
"types": "dist/esm/index.d.ts",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"type": "individual",
|
|
47
47
|
"url": "https://ohif.org/donate"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "412a909b78d75807d79a27979667e80cecec354f"
|
|
50
50
|
}
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
BlendModes,
|
|
14
14
|
Events,
|
|
15
|
+
InterpolationType,
|
|
15
16
|
OrientationAxis,
|
|
16
17
|
ViewportStatus,
|
|
17
18
|
VOILUTFunctionType,
|
|
@@ -367,6 +368,23 @@ abstract class BaseVolumeViewport extends Viewport implements IVolumeViewport {
|
|
|
367
368
|
return newRGBTransferFunction;
|
|
368
369
|
}
|
|
369
370
|
|
|
371
|
+
private setInterpolationType(
|
|
372
|
+
interpolationType: InterpolationType,
|
|
373
|
+
volumeId?: string
|
|
374
|
+
) {
|
|
375
|
+
const applicableVolumeActorInfo = this._getApplicableVolumeActor(volumeId);
|
|
376
|
+
|
|
377
|
+
if (!applicableVolumeActorInfo) {
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
const { volumeActor } = applicableVolumeActorInfo;
|
|
382
|
+
const volumeProperty = volumeActor.getProperty();
|
|
383
|
+
|
|
384
|
+
// @ts-ignore
|
|
385
|
+
volumeProperty.setInterpolationType(interpolationType);
|
|
386
|
+
}
|
|
387
|
+
|
|
370
388
|
/**
|
|
371
389
|
* Sets the properties for the volume viewport on the volume
|
|
372
390
|
* (if fusion, it sets it for the first volume in the fusion)
|
|
@@ -449,6 +467,7 @@ abstract class BaseVolumeViewport extends Viewport implements IVolumeViewport {
|
|
|
449
467
|
invert,
|
|
450
468
|
colormap,
|
|
451
469
|
preset,
|
|
470
|
+
interpolationType,
|
|
452
471
|
}: VolumeViewportProperties = {},
|
|
453
472
|
volumeId?: string,
|
|
454
473
|
suppressEvents = false
|
|
@@ -467,6 +486,10 @@ abstract class BaseVolumeViewport extends Viewport implements IVolumeViewport {
|
|
|
467
486
|
this.setVOI(voiRange, volumeId, suppressEvents);
|
|
468
487
|
}
|
|
469
488
|
|
|
489
|
+
if (typeof interpolationType !== 'undefined') {
|
|
490
|
+
this.setInterpolationType(interpolationType);
|
|
491
|
+
}
|
|
492
|
+
|
|
470
493
|
if (VOILUTFunction !== undefined) {
|
|
471
494
|
this.setVOILUTFunction(VOILUTFunction, volumeId, suppressEvents);
|
|
472
495
|
}
|
|
@@ -132,7 +132,7 @@ let unknownVolumeLoader;
|
|
|
132
132
|
*/
|
|
133
133
|
function loadVolumeFromVolumeLoader(
|
|
134
134
|
volumeId: string,
|
|
135
|
-
options
|
|
135
|
+
options?: VolumeLoaderOptions
|
|
136
136
|
): Types.IVolumeLoadObject {
|
|
137
137
|
const colonIndex = volumeId.indexOf(':');
|
|
138
138
|
const scheme = volumeId.substring(0, colonIndex);
|
|
@@ -210,7 +210,7 @@ export function loadVolume(
|
|
|
210
210
|
*/
|
|
211
211
|
export async function createAndCacheVolume(
|
|
212
212
|
volumeId: string,
|
|
213
|
-
options
|
|
213
|
+
options?: VolumeLoaderOptions
|
|
214
214
|
): Promise<Record<string, any>> {
|
|
215
215
|
if (volumeId === undefined) {
|
|
216
216
|
throw new Error(
|
package/src/types/Mat3.ts
CHANGED
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This represents a 3x3 matrix of numbers
|
|
3
3
|
*/
|
|
4
|
-
type Mat3 =
|
|
5
|
-
number,
|
|
6
|
-
|
|
7
|
-
number,
|
|
8
|
-
number,
|
|
9
|
-
number,
|
|
10
|
-
number,
|
|
11
|
-
number,
|
|
12
|
-
number,
|
|
13
|
-
number
|
|
14
|
-
];
|
|
4
|
+
type Mat3 =
|
|
5
|
+
| [number, number, number, number, number, number, number, number, number]
|
|
6
|
+
| Float32Array;
|
|
15
7
|
|
|
16
8
|
export default Mat3;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VOILUTFunctionType } from '../enums';
|
|
1
|
+
import { InterpolationType, VOILUTFunctionType } from '../enums';
|
|
2
2
|
import { VOIRange } from './voi';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -11,6 +11,8 @@ type ViewportProperties = {
|
|
|
11
11
|
VOILUTFunction?: VOILUTFunctionType;
|
|
12
12
|
/** invert flag - whether the image is inverted */
|
|
13
13
|
invert?: boolean;
|
|
14
|
+
/** interpolation type */
|
|
15
|
+
interpolationType?: InterpolationType;
|
|
14
16
|
};
|
|
15
17
|
|
|
16
18
|
export type { ViewportProperties };
|
package/src/types/index.ts
CHANGED
|
@@ -81,6 +81,7 @@ import type { ViewportProperties } from './ViewportProperties';
|
|
|
81
81
|
import type { PixelDataTypedArray } from './PixelDataTypedArray';
|
|
82
82
|
import type { ImagePixelModule } from './ImagePixelModule';
|
|
83
83
|
import type { ImagePlaneModule } from './ImagePlaneModule';
|
|
84
|
+
import type { AffineMatrix } from './AffineMatrix';
|
|
84
85
|
|
|
85
86
|
export type {
|
|
86
87
|
// config
|
|
@@ -173,4 +174,5 @@ export type {
|
|
|
173
174
|
PixelDataTypedArray,
|
|
174
175
|
ImagePixelModule,
|
|
175
176
|
ImagePlaneModule,
|
|
177
|
+
AffineMatrix,
|
|
176
178
|
};
|