Skip to content

[Bug] Loading little endian CT into stack viewport stalls on receival of first image #2649

@m-a-r-k-1

Description

@m-a-r-k-1

Describe the Bug

TLDR Description
Loading little endian CT from dcm4chee into stack viewport does not work. Viewport contains no image data.
Imageloader sends request to pacs for first image. Receives image data and then stalls. No errors. viewport.setStack() never finishes. viewport.render() is never called.
"@cornerstonejs/core": "^4.16.0",
"@cornerstonejs/dicom-image-loader": "^4.16.0"
Pacs dcm4chee, Wado RS

Full Description
I use cornerstone core and dicomImageloader in an angular 21 application
fs.js is excluded, core and image loader init are called in app initializer
metadata is retrieved with dicomweb-client.retrieveSeriesMetadata(). I think I found a bug there. You need to pass a request as parameter now. I think that is not intentional. But it is possible to work arround that.

Metadata is looking alright. It is also set in imageloader. I forgot that first and got errors because of missing pixel related metadata.

ImageIDs look alright and data is received. Example ID: http://localhost:4200/api/pacs/studies/1.2.276.0.50.192168001206.7900268.518024.2/series/1.2.276.0.50.192168001217.15024870.8474320.5/instances/1.2.276.0.50.192168001217.15024870.8474320.6
Also tried with /frames/1 append. Same result. But I assume thats not needed for non multiframe CT. e.g. not enhanced.

Configuring onLoadend output for imageloader shows that the request for the first image is answered by dcm4chee with status 200, multipart/related; type=application/octet-stream, and the response also contains dicom data. Imageloader also does request "Accept: multipart/related; type=application/octet-stream; transfer-syntax=*" with default settings.

It is a well known little endinan CT study that was send to dcm4chee via dcm4chee scu. Dcm4chee is queried via wado rs. I also loaded it into another viewer without problems. Also tried a non enhanced MR Little endian with same results. So I am rather sure the image data is not the problem.

I tried loading the first image manually with dicomImageloader and then pass it to dicom-parser to get some error output. However the IImageLoadObject is never returned. I then tried it like this:
const loadObj = dicomImageLoader.wadors.loadImage(imageId);
loadObj.promise
.then(img => console.log('[test] wadors.loadImage success', img))
.catch(err => console.error('[test] wadors.loadImage error', err));
Still no output.

Now I am kinda stuck and dont know how to figure out what exactly is not working and why. I am happy to provide more information.

Steps to Reproduce

  1. Send little endian CT to dcm4chee
  2. Try to load this CT into cornerstone stack viewport with wadors
  3. Viewport is present in the dom without imagedata
  4. Request and response for first image are present in network stack of browser console
  5. I tested with chrome and edge

The current behavior

The viewport does not contains image data.
viewport.setStack() never finishes
viewport.renderStack() is never called
DicomImageloader request and receives the first image. But then stalls

The expected behavior

The viewport contains the CT Image data.
All images are request from Pacs and laoded by dicomImageloader
viewport.setStack() does finish
viewport.Render() is invoked and does finish

System Information

System:
OS: Windows 11 10.0.26200
CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz
Memory: 17.02 GB / 31.73 GB
Binaries:
Node: 24.0.0 - C:\nvm4w\nodejs\node.EXE
npm: 11.3.0 - C:\nvm4w\nodejs\npm.CMD
Browsers:
Chrome: 145.0.7632.160
Edge: Chromium (143.0.3650.80)
Internet Explorer: 11.0.26100.7309

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions