# use ITK on the web

**URL:** https://discourse.itk.org/t/use-itk-on-the-web/4183
**Category:** Beginner Questions
**Created:** [June 6, 2021, 4:49am UTC](https://discourse.itk.org/t/use-itk-on-the-web/4183 "2021-06-06T04:49:55Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![zrxiaojie](https://discourse.itk.org/user_avatar/discourse.itk.org/zrxiaojie/32/2113_2.png) [@zrxiaojie](https://discourse.itk.org/u/zrxiaojie)
#### Post date: [June 6, 2021, 4:49am UTC](https://discourse.itk.org/t/use-itk-on-the-web/4183/1 "2021-06-06T04:49:55Z")

</div>

Hi, I’m new to ITK and interested in medical image processing on the web. I tried using [itk-js (insightsoftwareconsortium.github.io)](http://insightsoftwareconsortium.github.io/itk-js/) to read a dicom series, then showed them on the web through vtk.js. It worked. However, when I want to do some image segmentation, I can’t find the API like itkConnectedThresholdFilter. Is it because ITK mainly targets desktop software and is there a more suitable solution? Any suggestions will be helpful. Thanks 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: [June 7, 2021, 6:06pm UTC](https://discourse.itk.org/t/use-itk-on-the-web/4183/2 "2021-06-07T18:06:30Z")

</div>

All ITK filters should be exposed. More insight here:

> [@ITK.js](https://discourse.itk.org/t/itk-js/622/4):
>
> Hi @sedghi , Yes, ITK.js provides access to all ITK filters! If the data is in a file [itk.js can be used to read the file](https://insightsoftwareconsortium.github.io/itk-js/api/browser_io.html). If the data is in a vtk.js vtkImageData, it can be converted to an itk.js Image with the [vtk.js convertVtkToItkImage](https://kitware.github.io/vtk-js/api/Common_DataModel_ITKHelper.html). For Otsu thresholding download the [Threshold an Imaging Using Otsu](https://itk.org/ITKExamples/src/Filtering/Thresholding/ThresholdAnImageUsingOtsu/Documentation.html) example, and build it with ITK.js: curl -O https://itk.org/ITKExamples/src/Filtering/Thresholding/ThresholdAnImageUsingOtsu/ThresholdAnImageUsingOtsu.zip unzip ThresholdAnImageUsingOts…

---

<div class="post-metadata">

### Author: ![zrxiaojie](https://discourse.itk.org/user_avatar/discourse.itk.org/zrxiaojie/32/2113_2.png) [@zrxiaojie](https://discourse.itk.org/u/zrxiaojie)
#### Post date: [June 9, 2021, 2:01pm UTC](https://discourse.itk.org/t/use-itk-on-the-web/4183/3 "2021-06-09T14:01:37Z")

</div>

Thank you @dzenanz , the message you provided helps me a lot! But when I tried some example like [Hello World](http://insightsoftwareconsortium.github.io/itk-js/examples/hello_world_node.html) step by step, I failed to realize it because I only get a 0kb file named itk-js-build-env in the ./web-build after run npx itk-js build . Is it because I miss something? As a beginner, this confuses me a lot.

---

<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: [June 9, 2021, 4:06pm UTC](https://discourse.itk.org/t/use-itk-on-the-web/4183/4 "2021-06-09T16:06:37Z")

</div>

@matt.mccormick should be able to help.

---

<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: [June 9, 2021, 10:16pm UTC](https://discourse.itk.org/t/use-itk-on-the-web/4183/5 "2021-06-09T22:16:53Z")

</div>

Hi @zrxiaojie

> [@zrxiaojie](#):
>
> [Hello World](http://insightsoftwareconsortium.github.io/itk-js/examples/hello_world_node.html) step by step, I failed to realize it because I only get a 0kb file named itk-js-build-env in the ./web-build after run npx itk-js buil

Are there any errors or messages when running the example?

What operating system are you using?

---

<div class="post-metadata">

### Author: ![zrxiaojie](https://discourse.itk.org/user_avatar/discourse.itk.org/zrxiaojie/32/2113_2.png) [@zrxiaojie](https://discourse.itk.org/u/zrxiaojie)
#### Post date: [June 10, 2021, 3:31am UTC](https://discourse.itk.org/t/use-itk-on-the-web/4183/6 "2021-06-10T03:31:10Z")

</div>

Hi @matt.mccormick , my operating system is Windows 10 home version, and the docker seems to be running normally. After I run npx itk-js build . of the itkjs Hello World example, a folder named web-build is created but there is only one file itk-js-build-env in the result

 ![image](https://discourse.itk.org/uploads/default/original/2X/0/034e4701b44208a8eb5fd6e5f0fb8157afc1f418.png)  
 ![image](https://discourse.itk.org/uploads/default/original/2X/f/fc7664754df32e11094f63d0bcc44befaa5e888e.png)

---

<div class="post-metadata">

### Author: ![zrxiaojie](https://discourse.itk.org/user_avatar/discourse.itk.org/zrxiaojie/32/2113_2.png) [@zrxiaojie](https://discourse.itk.org/u/zrxiaojie)
#### Post date: [June 10, 2021, 9:49am UTC](https://discourse.itk.org/t/use-itk-on-the-web/4183/7 "2021-06-10T09:49:53Z")

</div>

Additionally, I try it on another computer with Ubuntu just now. I got the same result.

---

<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: [June 10, 2021, 3:06pm UTC](https://discourse.itk.org/t/use-itk-on-the-web/4183/8 "2021-06-10T15:06:48Z")

</div>

@zrxiaojie thanks for the follow-up!

There was an error in the default image in the most recent version. [A patch](https://github.com/InsightSoftwareConsortium/itk-js/pull/427) is being released to correct the version and to also improve error reporting when this occurs. In the meantime,

```auto
npx itk-js build --image insighttoolkit/itk-js:20210520-bafb1b5 .

```

Can be used to explicitly specify the image.

On Windows, make sure that [shared folders](https://docs.docker.com/docker-for-windows/troubleshoot/#volumes) are enabled on the drive.

---

<div class="post-metadata">

### Author: ![zrxiaojie](https://discourse.itk.org/user_avatar/discourse.itk.org/zrxiaojie/32/2113_2.png) [@zrxiaojie](https://discourse.itk.org/u/zrxiaojie)
#### Post date: [June 12, 2021, 3:16pm UTC](https://discourse.itk.org/t/use-itk-on-the-web/4183/9 "2021-06-12T15:16:43Z")

</div>

Thank you for your reply! Maybe there are some problems with my device or I haven’t mastered the use of the dock yet, I haven’t successfully built it with that version of image. But it’s okay, I think I should first learn the knowledge and principles of itk and itkjs. Then I will try a few more times!

---

<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: [June 15, 2021, 2:46pm UTC](https://discourse.itk.org/t/use-itk-on-the-web/4183/10 "2021-06-15T14:46:30Z")

</div>

@zrxiaojie keep up the effort! We are here to help.

itk.js `14.1.1` is now available with the corrected default image.
