OHIF / Viewers

OHIF zero-footprint DICOM viewer and oncology specific Lesion Tracker, plus shared extension packages
https://docs.ohif.org/
MIT License
3.2k stars 3.31k forks source link

[Bug] OHIF not working on some Android devices #4286

Open ionutdobre opened 3 months ago

ionutdobre commented 3 months ago

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:

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

sedghi commented 3 months ago

Have you tried on more recent android os?

tonygonzalez811 commented 3 months ago

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

ionutdobre commented 3 months ago

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

tonygonzalez811 commented 3 months ago

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

image

image

image

image

ionutdobre commented 2 months ago

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!

sedghi commented 2 months ago

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
ionutdobre commented 2 months ago

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.

arturojain commented 2 months ago

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