# readImageFile - webworker

**URL:** https://discourse.itk.org/t/readimagefile-webworker/4248
**Category:** Beginner Questions
**Created:** [July 7, 2021, 10:13am UTC](https://discourse.itk.org/t/readimagefile-webworker/4248 "2021-07-07T10:13:22Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![sam](https://discourse.itk.org/user_avatar/discourse.itk.org/sam/32/2169_2.png) [@sam](https://discourse.itk.org/u/sam)
#### Post date: [July 7, 2021, 10:13am UTC](https://discourse.itk.org/t/readimagefile-webworker/4248/1 "2021-07-07T10:13:22Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [July 7, 2021, 3:03pm UTC](https://discourse.itk.org/t/readimagefile-webworker/4248/2 "2021-07-07T15:03:58Z")

</div>

Maybe you could look at this [refactoring](https://github.com/OpenImaging/miqa-phase1/pull/39/commits/2da90a90f73cd69ed6c2172c43bef1c2796b2fac), which uses itk.js `WorkerPool`.

---

<div class="post-metadata">

### Author: ![sam](https://discourse.itk.org/user_avatar/discourse.itk.org/sam/32/2169_2.png) [@sam](https://discourse.itk.org/u/sam)
#### Post date: [July 7, 2021, 3:51pm UTC](https://discourse.itk.org/t/readimagefile-webworker/4248/3 "2021-07-07T15:51:17Z")

</div>

i will take a look thank you

---

<div class="post-metadata">

### Author: ![Mathews\_JS](https://discourse.itk.org/user_avatar/discourse.itk.org/mathews_js/32/2655_2.png) [@Mathews\_JS](https://discourse.itk.org/u/Mathews_JS)
#### Post date: [April 22, 2022, 8:20am UTC](https://discourse.itk.org/t/readimagefile-webworker/4248/4 "2022-04-22T08:20:42Z")

</div>

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…

---

<div class="post-metadata">

### Author: ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)
#### Post date: [May 13, 2022, 10:39am UTC](https://discourse.itk.org/t/readimagefile-webworker/4248/5 "2022-05-13T10:39:53Z")

</div>

Hello,

First, please update to [itk-wasm](https://wasm.itk.org).

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

HTH,  
Matt

---

<div class="post-metadata">

### Author: ![sam](https://discourse.itk.org/user_avatar/discourse.itk.org/sam/32/2169_2.png) [@sam](https://discourse.itk.org/u/sam)
#### Post date: [May 20, 2022, 1:19pm UTC](https://discourse.itk.org/t/readimagefile-webworker/4248/6 "2022-05-20T13:19:12Z")

</div>

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.
