Skip to content

Commit

Permalink
fix(no sab): should work when shared array buffer is not required (#3686
Browse files Browse the repository at this point in the history
)
  • Loading branch information
sedghi authored Sep 29, 2023
1 parent 3dabee2 commit a67d72d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions extensions/cornerstone/src/init.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,7 @@ export default async function init({
configuration,
appConfig,
}: Types.Extensions.ExtensionParams): Promise<void> {

await cs3DInit({
rendering: {
preferSizeOverAccuracy: Boolean(appConfig.use16BitDataType),
useNorm16Texture: Boolean(appConfig.use16BitDataType),
},
});

// For debugging e2e tests that are failing on CI
cornerstone.setUseCPURendering(Boolean(appConfig.useCPURendering));

// Note: this should run first before initializing the cornerstone
switch (appConfig.useSharedArrayBuffer) {
case 'AUTO':
cornerstone.setUseSharedArrayBuffer(csEnums.SharedArrayBufferModes.AUTO);
Expand All @@ -64,6 +54,16 @@ export default async function init({
cornerstone.setUseSharedArrayBuffer(csEnums.SharedArrayBufferModes.TRUE);
}

await cs3DInit({
rendering: {
preferSizeOverAccuracy: Boolean(appConfig.use16BitDataType),
useNorm16Texture: Boolean(appConfig.use16BitDataType),
},
});

// For debugging e2e tests that are failing on CI
cornerstone.setUseCPURendering(Boolean(appConfig.useCPURendering));

cornerstone.setConfiguration({
...cornerstone.getConfiguration(),
rendering: {
Expand Down
2 changes: 1 addition & 1 deletion platform/docs/docs/configuration/configurationFiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ if auth headers are used, a preflight request is required.
- `showLoadingIndicator`: (default to true), if set to false, the loading indicator will not be shown when navigating between studies.
- `use16BitDataType`: (default to false), if set to true, it will use 16 bit data type for the image data wherever possible which has
significant impact on reducing the memory usage. However, the 16Bit textures require EXT_texture_norm16 extension in webGL 2.0 (you can check if you have it here https://webglreport.com/?v=2). In addition to the extension, there are reported problems for Intel Macs that might cause the viewer to crash. In summary, it is great a configuration if you have support for it.
- `useSharedArrayBuffer` (default to true), for volume loading we use sharedArrayBuffer to be able to
- `useSharedArrayBuffer` (default to 'TRUE', options: 'AUTO', 'FALSE', 'TRUE', note that these are strings), for volume loading we use sharedArrayBuffer to be able to
load the volume progressively as the data arrives (each webworker has the shared buffer and can write to it). However, there might be certain environments that do not support sharedArrayBuffer. In that case, you can set this flag to false and the viewer will use the regular arrayBuffer which might be slower for large volume loading.
- `supportsWildcard`: (default to false), if set to true, the datasource will support wildcard matching for patient name and patient id.
- `dangerouslyUseDynamicConfig`: Dynamic config allows user to pass `configUrl` query string. This allows to load config without recompiling application. If the `configUrl` query string is passed, the worklist and modes will load from the referenced json rather than the default .env config. If there is no `configUrl` path provided, the default behaviour is used and there should not be any deviation from current user experience.<br/>
Expand Down

0 comments on commit a67d72d

Please sign in to comment.