Cornerstone3D initialization

Hi, I’m trying to use cornerstone 3D to render some Dicom files but I just cannot get rid of this error - @cornerstonejs/core is not initialized, run init() first. This is my import code -

import * as cornerstone3D from ‘@cornerstonejs/core’;
cornerstone3D.init();

I’m definitely missing something but I’ve been through the documentation and examples and I cannot find any reference to how cornerstone3D actually needs to be initialized.

Any help is appreciated.

you should await init

Thanks for the guidance on this.

Can you help me understand better the need to use await and where the Promise comes into play in the init function?

I’d also be happy to submit a PR to update the type and construct a Promise in the body if you think that would be appropriate.

checkout our examples, they show the usage Render Stack of Images | Cornerstone.js