@cornerstonejs/core 1.83.0 → 1.83.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cornerstonejs/core",
3
- "version": "1.83.0",
3
+ "version": "1.83.2",
4
4
  "description": "",
5
5
  "main": "src/index.ts",
6
6
  "types": "dist/types/index.d.ts",
@@ -47,5 +47,5 @@
47
47
  "type": "individual",
48
48
  "url": "https://ohif.org/donate"
49
49
  },
50
- "gitHead": "b6bbf9b56de9aab45972d53e0c311280d5d8453f"
50
+ "gitHead": "1bff09cef11f9f116a0a852f0c44d982ee0291d2"
51
51
  }
@@ -185,22 +185,37 @@ function vtkStreamingOpenGLVolumeMapper(publicAPI, model) {
185
185
  }
186
186
 
187
187
  if (shouldReset) {
188
- model.scalarTexture.setOglNorm16Ext(
189
- model.context.getExtension('EXT_texture_norm16')
190
- );
188
+ const norm16Ext = model.context.getExtension('EXT_texture_norm16');
189
+ model.scalarTexture.setOglNorm16Ext(norm16Ext);
191
190
 
192
191
  model.scalarTexture.releaseGraphicsResources(model._openGLRenderWindow);
193
192
  model.scalarTexture.resetFormatAndType();
194
193
 
195
- model.scalarTexture.create3DFilterableFromRaw(
196
- dims[0],
197
- dims[1],
198
- dims[2],
199
- numComp,
200
- scalars.getDataType(),
201
- scalars.getData(),
202
- model.renderable.getPreferSizeOverAccuracy()
203
- );
194
+ // If preferSizeOverAccuracy is true or we're using a norm16 texture,
195
+ // we need to use the FromDataArray method to create the texture for scaling.
196
+ // Otherwise, we can use the FromRaw method.
197
+ if (
198
+ model.renderable.getPreferSizeOverAccuracy() ||
199
+ (norm16Ext && dataType === VtkDataTypes.UNSIGNED_SHORT) ||
200
+ dataType === VtkDataTypes.SHORT
201
+ ) {
202
+ model.scalarTexture.create3DFilterableFromDataArray(
203
+ dims[0],
204
+ dims[1],
205
+ dims[2],
206
+ scalars,
207
+ model.renderable.getPreferSizeOverAccuracy()
208
+ );
209
+ } else {
210
+ model.scalarTexture.create3DFilterableFromRaw(
211
+ dims[0],
212
+ dims[1],
213
+ dims[2],
214
+ numComp,
215
+ scalars.getDataType(),
216
+ scalars.getData()
217
+ );
218
+ }
204
219
  } else {
205
220
  model.scalarTexture.deactivate();
206
221
  model.scalarTexture.update3DFromRaw(data);
package/src/index.ts CHANGED
@@ -45,6 +45,7 @@ import {
45
45
  getWebWorkerManager,
46
46
  canRenderFloatTextures,
47
47
  peerImport,
48
+ resetInitialization,
48
49
  } from './init';
49
50
 
50
51
  // Classes
@@ -89,6 +90,7 @@ export {
89
90
  init,
90
91
  isCornerstoneInitialized,
91
92
  peerImport,
93
+ resetInitialization,
92
94
  // configs
93
95
  getConfiguration,
94
96
  setConfiguration,
package/src/init.ts CHANGED
@@ -272,6 +272,10 @@ function isCornerstoneInitialized(): boolean {
272
272
  return csRenderInitialized;
273
273
  }
274
274
 
275
+ function resetInitialization(): void {
276
+ csRenderInitialized = false;
277
+ }
278
+
275
279
  /**
276
280
  * This function returns a copy of the config object. This is used to prevent the
277
281
  * config object from being modified by other parts of the program.
@@ -328,4 +332,5 @@ export {
328
332
  getWebWorkerManager,
329
333
  canRenderFloatTextures,
330
334
  peerImport,
335
+ resetInitialization,
331
336
  };