OHIF/Viewers

[Bug] OHIF not working on some Android devices

Opened this issue · 8 comments

Describe the Bug

Hi! We have encountered an issue with the latest OHIF viewer on certain Android devices. Specifically, the viewer fails to display instances correctly, resulting in a fully black or grey image. This problem is reproducible on a Samsung phone but does not occur on a OnePlus phone, suggesting device-specific behavior.

Additional Information:

  • This issue has been reproduced across multiple studies available on the OHIF viewer platform (https://viewer.ohif.org/)
  • Screenshot of the issue on the Samsung device:
Screenshot 2024-07-12 at 12 52 03

Could you please provide guidance or a fix for this issue? Any insights into why this might be happening on specific devices would be greatly appreciated.

Steps to Reproduce

  1. Open the OHIF viewer on a Samsung Android device
  2. Load the following study: Study Link
  3. Observe the display of instances within the study

The current behavior

The instances are displayed as fully black or grey images.

The expected behavior

The instances within the study should display correctly as they do on other devices, including a OnePlus phone and desktop browsers.

OS

Android 12

Node version

Browser

Chrome 126.0.6478.122

Have you tried on more recent android os?

Hello Sedghi, many users do not have the financial capacity to maintain the latest generation equipment.

Hello @sedghi!

We’ve tested the OHIF viewer on a Samsung device running Android 13 and encountered the same problem with instances not displaying correctly:

IMG_5495
IMG_5493
IMG_5494


Additionally, we’ve tested it on a Pixel device running Android 12, and instances are loaded properly:

IMG_5498
IMG_5496
IMG_5497

Same here, we have tested on Honor, Xiaomi and it works, on mid and low range Samsung it fails

image

image

image

image

Hi @sedghi! I wanted to follow up on this issue to see if there have been any updates or if there’s any guidance you could provide to help resolve it. Thanks!

I think you need to find the configuration that works best for you. You can force CPU rendering, which might be suitable for some use cases, but you won't get MPR, segmentation, and 3D rendering. Take a look at the cornerstone.init function and set the useCPURendering option to true.

https://github.com/cornerstonejs/cornerstone3D/blob/main/packages/core/src/init.ts

// TODO: Change config into a class with methods to better control get/set
const defaultConfig = {
  gpuTier: undefined,
  detectGPUConfig: {},
  isMobile: false, // Is mobile device
  rendering: {
    useCPURendering: false,
    // GPU rendering options
    preferSizeOverAccuracy: false,
    useNorm16Texture: false,
    strictZSpacingForVolumeViewport: true,
  },
  // Cache
  enableCacheOptimization: true,
  /**
   * Imports peer modules.
   * This may just fallback to the default import, but many packaging
   * systems don't deal with peer imports properly.
   */
  peerImport: (moduleId) => null,
};
```origin/m

I’ve tested it, and yes, it will resolve the issue.

However, the following problems remain:
• How do I know when to enable software rendering and when not to (which devices have this problem)?
• In an older version of OHIF v3, hardware acceleration worked even on older devices.

I also have this problem. Is there a way to define useCPURendering only on Android devices?