# itk.js readImageDICOMFileSeries

**URL:** <https://discourse.itk.org/t/itk-js-readimagedicomfileseries/2086>\
**Category:** Beginner Questions\
**Tags:** javascript\
**Created:** [July 24, 2019, 3:47pm UTC](https://discourse.itk.org/t/itk-js-readimagedicomfileseries/2086 "2019-07-24T15:47:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aliu4](https://discourse.itk.org/letter_avatar_proxy/v4/letter/a/ecb155/32.png) [@aliu4](https://discourse.itk.org/u/aliu4)\
**Post date:** [July 24, 2019, 3:47pm UTC](https://discourse.itk.org/t/itk-js-readimagedicomfileseries/2086/1 "2019-07-24T15:47:06Z")

</div>

hello,

I am developing an application in vue-js and im having issues with the readImageDICOMFileSeries method. I’m currently not using a web-worker and it keeps returning this error. “ImageIO.worker.js:1 Uncaught SyntaxError: Unexpected token \<”. Here is the code for my component.

```
<template>
  <div>
    <v-btn @click="click">click!</v-btn>
    <input id="fileItem" type="file">
  </div>
</template>

<script>
import readImageDICOMFileSeries from "itk/readImageDICOMFileSeries";

export default {
  name: "Test",
  methods: {
click() {
  var file = document.getElementById("fileItem").files[0];
   readImageDICOMFileSeries(null, file)
    .then(function({ image, webWorker }) {
      console.log(image);
    })
    .catch(error => {
      console.error(error);
    });
}
  }
};
</script>
```

---

<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:** [July 31, 2019, 3:46pm UTC](https://discourse.itk.org/t/itk-js-readimagedicomfileseries/2086/2 "2019-07-31T15:46:25Z")

</div>

Hi Andrew,

As a first step, try to use [the itk.js UMD module](http://insightsoftwareconsortium.github.io/itk-js/examples/umd.html).

```auto
<script src="https://unpkg.com/itk@9.6.1/umd/itk.js"></script>

<script>
export default {
  name: "Test",
  methods: {
click() {
  var file = document.getElementById("fileItem").files[0];
   itk.readImageFile(null, file)
    .then(function({ image, webWorker }) {
      console.log(image);
    })
    .catch(error => {
      console.error(error);
    });
}
  }
};
</script>

```

For an interactive example, see

> **[itk-js-umd-example](https://glitch.com/~itk-js-umd-example)**
>
> Check out ~itk-js-umd-example on Glitch, the friendly community where everyone can discover & create the best apps on the web.

Note that for a single file, use the [`readImageFile`](http://insightsoftwareconsortium.github.io/itk-js/api/browser_io.html#readImageFile-webWorker-file-gt-webWorker-image) API.

To support both a single-file DICOM volume and a DICOM series, see this example:

> **[itk-read-dicom](https://glitch.com/~itk-read-dicom)**
>
> Read a DICOM image file series or a single DICOM image file.
> 🎏 Glitch is the friendly community where everyone can discover & create the best apps on the web.

Eventually, you may want to incorporate itk.js into your Webpack build. An overview and example of this is here:

> **[Using itk.js in a web browser application via Webpack](http://insightsoftwareconsortium.github.io/itk-js/examples/webpack.html)**
>
> This example demonstrates how to use itk.js in a web browser application built with Webpack. Find the full example in the itk-js/examples/Webpack directory of the GitHub repository. Since we as

You can also use the Unpkg.com-published web workers with Webpack:

> **[Using itk.js with modules stored on a CDN](http://insightsoftwareconsortium.github.io/itk-js/examples/unpkgio.html)**
>
> This example demonstrates how to use itk.js in a web browser application built with Webpack where the itk.js modules are stored on a Content Delivery Network (CDN). This is an alternative to bundling

---

<div class="post-metadata">

**Author:** ![surdu](https://discourse.itk.org/user_avatar/discourse.itk.org/surdu/32/2628_2.png) [@surdu](https://discourse.itk.org/u/surdu)\
**Post date:** [March 24, 2022, 4:12pm UTC](https://discourse.itk.org/t/itk-js-readimagedicomfileseries/2086/3 "2022-03-24T16:12:08Z")

</div>

Probably to late, but the problem is that the web-workers are not loaded correctly. In our case, we solved the problems as follow:

You need to place the `ImageIOs` and `WebWorkers` [from here](https://unpkg.com/browse/itk@13.0.1/) into the `public` forlder (in our example in `/public/itk/ImageIOs` and `/public/itk/WebWorkers`.

```auto
import itkreadImageDICOMFileSeries from "itk/readImageDICOMFileSeries";
import itkConfig from "itk/itkConfig";

// this configures ITK library to load the webworkers from 
// the corect path (relative to `/public`)
itkConfig.itkModulesPath = "/itk";

```

Then `readImageDICOMFileSeries` should work correctly
