# Problem about the Itk.js readImageDICOMFileSeries function

**URL:** https://discourse.itk.org/t/problem-about-the-itk-js-readimagedicomfileseries-function/1167
**Category:** Beginner Questions
**Created:** [July 31, 2018, 3:02am UTC](https://discourse.itk.org/t/problem-about-the-itk-js-readimagedicomfileseries-function/1167 "2018-07-31T03:02:58Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Mason](https://discourse.itk.org/letter_avatar_proxy/v4/letter/m/da6949/32.png) [@Mason](https://discourse.itk.org/u/Mason)
#### Post date: [July 31, 2018, 3:02am UTC](https://discourse.itk.org/t/problem-about-the-itk-js-readimagedicomfileseries-function/1167/1 "2018-07-31T03:02:58Z")

</div>

Hello folks. I have been learning itk.js for several days. I have a problem about the readImageDICOMFileSeries function. Here are some codes I wrote to read a DICOM file series as an itk.js Image object.

```
const files = document.getElementById('file').files;
readImageDICOMFileSeries(null, files)
    .then((worker)=>{
            const {image}=worker;
            console.log(image);
    })
    .catch(error=>{
            console.error(error);
            alert(error.message);
    })

```

Well, it worked fine for some dcm files. However, when I tried some files from another hospital, it just throw exceptions like this

```
message
:
"Could not read file: /work/4970_0001_259881493.dcm"
stack
:
"Error: Could not read file: /work/4970_0001_259881493.dcm↵ at readImageEmscriptenFSDICOMFileSeries (http://localhost:8080/itk/WebWorkers/ImageIO.worker.js:57:356)↵ at readDICOMImageSeries (http://localhost:8080/itk/WebWorkers/ImageIO.worker.js:30:3933)↵ at http://localhost:8080/itk/WebWorkers/ImageIO.worker.js:30:4284↵ at i (http://localhost:8080/itk/WebWorkers/ImageIO.worker.js:2:2049)↵ at o (http://localhost:8080/itk/WebWorkers/ImageIO.worker.js:2:1874)↵ at http://localhost:8080/itk/WebWorkers/ImageIO.worker.js:2:2423"
__proto__

```

Are there any incompatibility problems in the itk.js library?

---

<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, 2018, 3:36am UTC](https://discourse.itk.org/t/problem-about-the-itk-js-readimagedicomfileseries-function/1167/2 "2018-07-31T03:36:15Z")

</div>

Hi Mason,

> [@Mason](#):
>
> “Could not read file: /work/4970\_0001\_259881493.dcm”

Is this file part of the same series?

To find more information, try loading the data with [3D Slicer](https://www.slicer.org/), [dcmdump](https://support.dcmtk.org/docs/dcmdump.html) or [gdcmdump](http://gdcm.sourceforge.net/html/gdcmdump.html).

Hope this helps,  
Matt

---

<div class="post-metadata">

### Author: ![Mason](https://discourse.itk.org/letter_avatar_proxy/v4/letter/m/da6949/32.png) [@Mason](https://discourse.itk.org/u/Mason)
#### Post date: [July 31, 2018, 3:44am UTC](https://discourse.itk.org/t/problem-about-the-itk-js-readimagedicomfileseries-function/1167/3 "2018-07-31T03:44:03Z")

</div>

This file is the first file of the series. And this series can be loaded in other softwares correctly. I have tried several series from the same hospital and they could not work using this code neither.

---

<div class="post-metadata">

### Author: ![Mason](https://discourse.itk.org/letter_avatar_proxy/v4/letter/m/da6949/32.png) [@Mason](https://discourse.itk.org/u/Mason)
#### Post date: [July 31, 2018, 3:49am UTC](https://discourse.itk.org/t/problem-about-the-itk-js-readimagedicomfileseries-function/1167/4 "2018-07-31T03:49:21Z")

</div>

The names of these files contained some Chinese characters at first. The program came across some UTF-8 and UTF-16 issues. I thought Chinese characters were not be allowed so I changed the file names. Could this be the reason to lead to this error?

---

<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, 2018, 4:13am UTC](https://discourse.itk.org/t/problem-about-the-itk-js-readimagedicomfileseries-function/1167/5 "2018-07-31T04:13:31Z")

</div>

> [@Mason](#):
>
> The names of these files contained some Chinese characters at first. The program came across some UTF-8 and UTF-16 issues. I thought Chinese characters were not be allowed so I changed the file names. Could this be the reason to lead to this error?

It may be that the DICOM files contain Chinese characters, and these are currently causing issues because [we are not currently building DCMTK with ICU support in itk.js](https://github.com/InsightSoftwareConsortium/itk-js/blob/master/src/Docker/itk-js-base/Dockerfile#L26), which is [used for character conversion](https://github.com/DCMTK/dcmtk/blob/53d89d546c9d6644427fcfa788c69996bca1b239/INSTALL#L274-L366).

To address this, we should find a file that exhibits the behavior that we can use in a regression test, and enable libiconv or icu support within the DCMTK build.

---

<div class="post-metadata">

### Author: ![Mason](https://discourse.itk.org/letter_avatar_proxy/v4/letter/m/da6949/32.png) [@Mason](https://discourse.itk.org/u/Mason)
#### Post date: [July 31, 2018, 4:17am UTC](https://discourse.itk.org/t/problem-about-the-itk-js-readimagedicomfileseries-function/1167/6 "2018-07-31T04:17:47Z")

</div>

Thanks, Matt.
