Viewers icon indicating copy to clipboard operation
Viewers copied to clipboard

OHIF Viewer Display Issues with DICOM Images: "decodeRGB: rgbBuffer length must be divisible by 3" and "RangeError: model.size is not a multiple of model.numberOfComponents"

Open scope-antofa opened this issue 1 year ago • 4 comments

Describe the Bug

Problem Description

I'm encountering display issues with certain DICOM images in the OHIF Viewer. While some images are displayed correctly, others fail to load, and specific errors are shown in the browser's developer console. The errors are:

  • Uncaught (in promise) Error: decodeRGB: rgbBuffer length must be divisible by 3
  • Uncaught (in promise) RangeError: model.size is not a multiple of model.numberOfComponents

DICOM Image Details

The problematic DICOM images have the following characteristics:

  • ImageType: DERIVED\SECONDARY\OTHER\NONE
  • PhotometricInterpretation: RGB
  • BitsAllocated, BitsStored, HighBit: 8 bits
  • PixelRepresentation: 0 (unsigned)
  • PixelData sizes match the expected sizes based on the dimensions and bit configuration.

Local Loading Behavior

When loading these DICOM images locally in OHIF, a different behavior is observed, indicating a potential issue with how images are processed or handled in different loading contexts.

Additional Information

  • Reviewing the PixelData with dcmdump shows that the data size is consistent with the image dimensions and color depth.
  • The problem seems to be related to how OHIF handles or interprets the RGB data of the DICOM images.

Any guidance or solutions to resolve these display issues in OHIF would be greatly appreciated.

image

RESULTADOS7IMGANO.zip

Steps to Reproduce

  1. Load the affected DICOM images into the OHIF Viewer.
  2. Observe that certain images do not display and check the console for the mentioned errors.

The current behavior

I'm encountering display issues with certain DICOM images in the OHIF Viewer. While some images are displayed correctly, others fail to load, and specific errors are shown in the browser's developer console. The errors are:

  • Uncaught (in promise) Error: decodeRGB: rgbBuffer length must be divisible by 3
  • Uncaught (in promise) RangeError: model.size is not a multiple of model.numberOfComponents

The expected behavior

All DICOM images should be displayed correctly in the OHIF viewer without errors in the console.

OS

Windows 10

Node version

OHIF Viewer (3.8.0-beta.45)

Browser

Firefox Dev 122.0b

scope-antofa avatar Jan 18 '24 17:01 scope-antofa

I encountered similar issue after updating kitware/vtk.js version to "29.3.0" from "27.3.1"

DataArray.js:518 Uncaught (in promise) RangeError: model.size is not a multiple of model.numberOfComponents at f (DataArray.js:518:11) at Object.n [as newInstance] (macros2.js:917:5) at ig.createVTKImageData (StackViewport.ts:1603:25) at ig._createVTKImageData (StackViewport.ts:1634:28) at ig._updateActorToDisplayImageId (StackViewport.ts:2284:10) at ig.renderImageObject (StackViewport.ts:2104:14) at renderToCanvasGPU.ts:136:14 at new Promise () at ed (renderToCanvasGPU.ts:83:10) at c (loadImageToCanvas.ts:60:7)

raviaiken avatar Feb 03 '24 12:02 raviaiken

Just to add, this issue started on version "@kitware/vtk.js": "29.1.2".

TFRadicalImaging avatar Feb 05 '24 15:02 TFRadicalImaging

There is a bit of conversation about this change here https://github.com/Kitware/vtk-js/commit/3cc3abb871cabb79831d26bb268990549ef6ca59

This is affecting us with CT SENTINEL NODE SCANs from Siemens machines

nigelheap avatar Feb 25 '24 20:02 nigelheap

I dragged and dropped them in https://viewer-dev.ohif.org/localbasic and worked fine

sedghi avatar Feb 26 '24 15:02 sedghi

Hi! I'm getting this error for a particular dicom file, and not in others. Is there any solution for this yet?

saumitra91 avatar Mar 18 '24 12:03 saumitra91

Hi how to replace with DCOM images

Srikanthkurva avatar Mar 20 '24 16:03 Srikanthkurva

@sedghi regarding your above comment, what version of ohif is being used on that demo?

Hasan-aga avatar Apr 03 '24 10:04 Hasan-aga

Hi! I'm getting this error for a particular dicom file, and not in others. Is there any solution for this yet?

Bug disappears using the latest version of OHIF.

saumitra91 avatar Apr 03 '24 10:04 saumitra91