How to get base 64 from cornerstone

364 Views Asked by At

In OHIF I need to get base 64 value from cornerstone.because I need to pass the jpeg/png to a api for some prediction task in python flask.

1

There are 1 best solutions below

0
On

OHIF uses Cornerstone.js to render the image to a canvas. If you only need the rendered pixel values, you can use the Canvas API's toDataUrl. If you need the underlying / original pixel data, you can use the underlying cornerstone image's getPixelData method.