@cornerstonejs/core 0.46.0 → 0.46.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/cjs/utilities/index.d.ts +2 -1
- package/dist/cjs/utilities/index.js +4 -1
- package/dist/cjs/utilities/index.js.map +1 -1
- package/dist/cjs/utilities/isPTPrescaledWithSUV.d.ts +3 -0
- package/dist/cjs/utilities/isPTPrescaledWithSUV.js +8 -0
- package/dist/cjs/utilities/isPTPrescaledWithSUV.js.map +1 -0
- package/dist/cjs/utilities/renderToCanvasGPU.js +3 -4
- package/dist/cjs/utilities/renderToCanvasGPU.js.map +1 -1
- package/dist/esm/utilities/index.d.ts +2 -1
- package/dist/esm/utilities/index.js +2 -1
- package/dist/esm/utilities/index.js.map +1 -1
- package/dist/esm/utilities/isPTPrescaledWithSUV.d.ts +3 -0
- package/dist/esm/utilities/isPTPrescaledWithSUV.js +5 -0
- package/dist/esm/utilities/isPTPrescaledWithSUV.js.map +1 -0
- package/dist/esm/utilities/renderToCanvasGPU.js +3 -4
- package/dist/esm/utilities/renderToCanvasGPU.js.map +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +2 -2
- package/src/utilities/index.ts +2 -0
- package/src/utilities/isPTPrescaledWithSUV.ts +7 -0
- package/src/utilities/renderToCanvasGPU.ts +5 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cornerstonejs/core",
|
|
3
|
-
"version": "0.46.
|
|
3
|
+
"version": "0.46.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/umd/index.js",
|
|
6
6
|
"types": "dist/esm/index.d.ts",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"type": "individual",
|
|
44
44
|
"url": "https://ohif.org/donate"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "a853107a5b908984ec3649ec3c0d9a61e7c3397f"
|
|
47
47
|
}
|
package/src/utilities/index.ts
CHANGED
|
@@ -44,6 +44,7 @@ import applyPreset from './applyPreset';
|
|
|
44
44
|
import deepMerge from './deepMerge';
|
|
45
45
|
import getScalingParameters from './getScalingParameters';
|
|
46
46
|
import getScalarDataType from './getScalarDataType';
|
|
47
|
+
import isPTPrescaledWithSUV from './isPTPrescaledWithSUV';
|
|
47
48
|
|
|
48
49
|
// name spaces
|
|
49
50
|
import * as planar from './planar';
|
|
@@ -89,6 +90,7 @@ export {
|
|
|
89
90
|
snapFocalPointToSlice,
|
|
90
91
|
getImageSliceDataForVolumeViewport,
|
|
91
92
|
isImageActor,
|
|
93
|
+
isPTPrescaledWithSUV,
|
|
92
94
|
actorIsA,
|
|
93
95
|
getViewportsWithImageURI,
|
|
94
96
|
getClosestStackImageIndexForPoint,
|
|
@@ -4,6 +4,7 @@ import StackViewport from '../RenderingEngine/StackViewport';
|
|
|
4
4
|
import { IImage } from '../types';
|
|
5
5
|
import { getRenderingEngine } from '../RenderingEngine/getRenderingEngine';
|
|
6
6
|
import RenderingEngine from '../RenderingEngine';
|
|
7
|
+
import isPTPrescaledWithSUV from './isPTPrescaledWithSUV';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Renders an cornerstone image to a Canvas. This method will handle creation
|
|
@@ -112,7 +113,10 @@ export default function renderToCanvasGPU(
|
|
|
112
113
|
element.addEventListener(Events.IMAGE_RENDERED, onImageRendered);
|
|
113
114
|
viewport.renderImageObject(image);
|
|
114
115
|
|
|
115
|
-
|
|
116
|
+
// force a reset camera to center the image
|
|
117
|
+
viewport.resetCamera();
|
|
118
|
+
|
|
119
|
+
if (modality === 'PT' && !isPTPrescaledWithSUV(image)) {
|
|
116
120
|
viewport.setProperties({
|
|
117
121
|
voiRange: {
|
|
118
122
|
lower: image.minPixelValue,
|
|
@@ -124,7 +128,3 @@ export default function renderToCanvasGPU(
|
|
|
124
128
|
viewport.render();
|
|
125
129
|
});
|
|
126
130
|
}
|
|
127
|
-
|
|
128
|
-
const _isPTImagePreScaledWithSUV = (image: IImage) => {
|
|
129
|
-
return image.preScale.scaled && image.preScale.scalingParameters.suvbw;
|
|
130
|
-
};
|