Skip to content

Commit

Permalink
fix(config): support more values for the useSharedArrayBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
sedghi committed Oct 2, 2023
1 parent c9c57b0 commit 2f7866c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ function _getDisplaySetsFromSeries(instances, servicesManager, extensionManager)
const referencedSeriesSequence = instance.ReferencedSeriesSequence;

if (!referencedSeriesSequence) {
throw new Error('ReferencedSeriesSequence is missing for the SEG');
console.error('ReferencedSeriesSequence is missing for the SEG');
return;
}

const referencedSeries = referencedSeriesSequence[0] || referencedSeriesSequence;
Expand Down
18 changes: 9 additions & 9 deletions extensions/cornerstone/src/init.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@ export default async function init({
appConfig,
}: Types.Extensions.ExtensionParams): Promise<void> {
// Note: this should run first before initializing the cornerstone
switch (appConfig.useSharedArrayBuffer) {
case 'AUTO':
cornerstone.setUseSharedArrayBuffer(csEnums.SharedArrayBufferModes.AUTO);
break;
case 'FALSE':
cornerstone.setUseSharedArrayBuffer(csEnums.SharedArrayBufferModes.FALSE);
break;
default:
cornerstone.setUseSharedArrayBuffer(csEnums.SharedArrayBufferModes.TRUE);
// DO NOT CHANGE THE ORDER
const value = appConfig.useSharedArrayBuffer;

if (value === 'AUTO') {
cornerstone.setUseSharedArrayBuffer(csEnums.SharedArrayBufferModes.AUTO);
} else if (value === 'FALSE' || value === false) {
cornerstone.setUseSharedArrayBuffer(csEnums.SharedArrayBufferModes.FALSE);
} else {
cornerstone.setUseSharedArrayBuffer(csEnums.SharedArrayBufferModes.TRUE);
}

await cs3DInit({
Expand Down

0 comments on commit 2f7866c

Please sign in to comment.