OHIF / Viewers

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

[Bug] "ReferenceError: Buffer is not defined" when datasetToBlob is called #3588

Closed dxlin closed 1 year ago

dxlin commented 1 year ago

Describe the Bug

"ReferenceError: Buffer is not defined" when datasetToBlob is called (i.e. export RT report).

Steps to Reproduce

  1. Start viewer
  2. Select Water Phantom study (or any with CT and PT) in TMTV mode
  3. Create "New Label" on right right
  4. Select "Rectangle ROI Threshold Tool"
  5. Create arbitrary rectangle in axial PT viewport
  6. Click "Run"
  7. Click "Create RT Report"

The current behavior

Due to "ReferenceError: Buffer is not defined" when datasetToBlob is called, application fails to create a file to be saved to local directory.

The expected behavior

File blob should be create from datasetToBlob, which can then be used to download file.

OS

Windows 10

Node version

18.16.0

Browser

Edge v115.0.1901.188

sedghi commented 1 year ago

yeah buffer is in node, you should add the Buffer as dependency, see the @cornerstonejs/adapters

dxlin commented 1 year ago

I've tried adding "buffer" as a dependency to package.json as well as to: extensions\default\package.json extensions\tmtv\package.json extensions\cornerstone-dicom-sr\package.json

But ended up with the same error. I did find a possible solution and made a PR: https://github.com/OHIF/Viewers/pull/3590

sedghi commented 1 year ago

I can't reproduce this, please re-open if the issue persists