Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sedghi committed Oct 2, 2023
1 parent b7b677e commit 0672002
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
11 changes: 9 additions & 2 deletions extensions/cornerstone/src/init.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ export default async function init({
// Note: this should run first before initializing the cornerstone
// DO NOT CHANGE THE ORDER
const value = appConfig.useSharedArrayBuffer;
let sharedArrayBufferDisabled = false;

if (value === 'AUTO') {
cornerstone.setUseSharedArrayBuffer(csEnums.SharedArrayBufferModes.AUTO);
} else if (value === 'FALSE' || value === false) {
cornerstone.setUseSharedArrayBuffer(csEnums.SharedArrayBufferModes.FALSE);
sharedArrayBufferDisabled = true;
} else {
cornerstone.setUseSharedArrayBuffer(csEnums.SharedArrayBufferModes.TRUE);
}
Expand Down Expand Up @@ -99,10 +101,15 @@ export default async function init({
window.extensionManager = extensionManager;
window.commandsManager = commandsManager;

if (appConfig.showWarningMessageForCrossOrigin && !window.crossOriginIsolated) {
if (
appConfig.showWarningMessageForCrossOrigin &&
!window.crossOriginIsolated &&
!sharedArrayBufferDisabled
) {
uiNotificationService.show({
title: 'Cross Origin Isolation',
message: 'Cross Origin Isolation is not enabled, volume rendering will not work (e.g., MPR)',
message:
'Cross Origin Isolation is not enabled, read more about it here: https://docs.ohif.org/faq/',
type: 'warning',
});
}
Expand Down
5 changes: 5 additions & 0 deletions platform/docs/docs/deployment/cors.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,14 @@ In particular, three of OHIF’s features depend on these configurations:
- [XMLHttpRequests to fetch data from data sources](#cors-in-ohif)



## SharedArrayBuffer
A `SharedArrayBuffer` is a JavaScript object that is similar to an `ArrayBuffer` but can be shared between web workers and the window that spawned them via the `postMessage` API. See [SharedArrayBuffer in MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) for more information.

:::tip
To turn off Shared Array Buffer completely, just set `useSharedArrayBuffer` to `false` in the [OHIF configuration](../configuration/configurationFiles.md). But keep in mind that you won't get the performance boost that Shared Array Buffer offers for decoding and rendering big volumes when web workers write to the same memory space.
:::

### Security Requirements

In order to use `SharedArrayBuffer` objects in the browser, the following security conditions must be met:
Expand Down
3 changes: 3 additions & 0 deletions platform/docs/docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ If you have resources and would like to fund the development of a feature,
please [contact us](https://www.ohif.org) or work with community members that
offer [consulting services][commercial-support].

### Cross Origin Isolation
If you encounter a warning while running OHIF indicating that your application is not cross-origin isolated, it implies that volume rendering, such as MPR, will not function properly since they depend on Shared Array Buffers. To resolve this issue, we recommend referring to our comprehensive guide on Cross Origin Isolation available at [./deployment/cors.md](./deployment/cors.md).

### Who should I contact about Academic Collaborations?

[Gordon J. Harris](https://www.dfhcc.harvard.edu/insider/member-detail/member/gordon-j-harris-phd/)
Expand Down

0 comments on commit 0672002

Please sign in to comment.