readImageFile - webworker

Hello everyone, I work on an application that allows to read medical images (DICOM format) and I use a itk js (readImageFile) that allows to read these images but that returns a webworker to each image read the problem is when I read several images it generates several webworker and it blocks the browser, is there a way to remove them from network or resources, (I tried webworker.terminate() but it does not work in my case) thank you in advance.

Maybe you could look at this refactoring, which uses itk.js WorkerPool.


i will take a look thank you

Hi Sam,
I am also facing the same issue of loading multiple dcm images using itkjs (readImageFile) and end up with many webworkers.

I am curious to know, whether you have solved this issue. Kindly let me know if you have solved this.
Thank you…


First, please update to itk-wasm.

The web-worker should be re-used in subsequent calls to the functions.


Hello Mathews,

I’m sorry for my late reply, I didn’t find a solution unfortunately, I don’t use itk JS anymore.

Best regards.