# How to read series of Dicom images into Django using ITK.js for web volume rendering using VTK.js?

**URL:** https://discourse.itk.org/t/how-to-read-series-of-dicom-images-into-django-using-itk-js-for-web-volume-rendering-using-vtk-js/4420
**Category:** Beginner Questions
**Tags:** dicom, django, itkjs, vtkjs
**Created:** [September 14, 2021, 5:09pm UTC](https://discourse.itk.org/t/how-to-read-series-of-dicom-images-into-django-using-itk-js-for-web-volume-rendering-using-vtk-js/4420 "2021-09-14T17:09:31Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Yuvi-416](https://discourse.itk.org/user_avatar/discourse.itk.org/yuvi-416/32/2279_2.png) [@Yuvi-416](https://discourse.itk.org/u/Yuvi-416)
#### Post date: [September 14, 2021, 5:09pm UTC](https://discourse.itk.org/t/how-to-read-series-of-dicom-images-into-django-using-itk-js-for-web-volume-rendering-using-vtk-js/4420/1 "2021-09-14T17:09:31Z")

</div>

Hello everyone,  
I want to load series of DICOM images into the server and want to visualize it as a volume rendering using vtk.js on the web. As I found here ([https://discourse.vtk.org/t/request-hundreds-images-by-http/4154](https://discourse.vtk.org/t/request-hundreds-images-by-http/4154)) that vtk.js doesn’t have support to load DICOM images so instead of VTK.js, I have to use ITK.js to read the Dicom image and later need to pass the input to the VTK.js for visualization.

I followed some examples from VTK.js pages and they worked very well in the Django framework, now I need to implement the ITK.js part to call DICOM series images.

Is there a way to just pass the ITK.js library like _**vtk.js [unpkg.com](https://unpkg.com/vtk.js)**_ in the Django framework or do I need to build from the beginning? I just need it to read Dicom images as my work is related to DICOM files.

And also I couldn’t find a better example of how to call or load DICOM images using ITK.js and then what should I pass to VTK.js.

Any helpful link related to ITK.js and VTK.js for reading the series of Dicom images in the Django framework would be healful.

Thank you!

---

<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: [September 14, 2021, 6:00pm UTC](https://discourse.itk.org/t/how-to-read-series-of-dicom-images-into-django-using-itk-js-for-web-volume-rendering-using-vtk-js/4420/2 "2021-09-14T18:00:46Z")

</div>

MIQA project uses itk.js and django. It only handles NIFTIs at the moment, but you could find some inspiration here:

> <https://github.com/OpenImaging/miqa/blob/683dca91c592d95537a291bfcaeab6effeb11eab/client/src/store/index.ts#L69-L166>

---

<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: [September 14, 2021, 10:10pm UTC](https://discourse.itk.org/t/how-to-read-series-of-dicom-images-into-django-using-itk-js-for-web-volume-rendering-using-vtk-js/4420/3 "2021-09-14T22:10:57Z")

</div>

Hi,

To use itk.js from [unpkg.com](http://unpkg.com), see this example:

> **[itk-js/examples/UMD at master · InsightSoftwareConsortium/itk-js](https://github.com/InsightSoftwareConsortium/itk-js/tree/master/examples/UMD)**
>
> master/examples/UMD

To read a DICOM series, use [`readImageDICOMFileSeries`](https://insightsoftwareconsortium.github.io/itk-js/api/browser_io.html#readImageDICOMFileSeries-fileList-singleSortedSeries-false-gt-image-webWorkerPool). To read a multi-frame DICOM, use [`readImageFile`](https://insightsoftwareconsortium.github.io/itk-js/api/browser_io.html#readImageFile-webWorker-file-gt-webWorker-image).

Convert the resulting `itk/Image` to a `vtkImageData` with [`convertItkToVtkImage`](https://kitware.github.io/vtk-js/api/Common_DataModel_ITKHelper.html).

---

<div class="post-metadata">

### Author: ![Yuvi-416](https://discourse.itk.org/user_avatar/discourse.itk.org/yuvi-416/32/2279_2.png) [@Yuvi-416](https://discourse.itk.org/u/Yuvi-416)
#### Post date: [September 27, 2021, 9:53am UTC](https://discourse.itk.org/t/how-to-read-series-of-dicom-images-into-django-using-itk-js-for-web-volume-rendering-using-vtk-js/4420/4 "2021-09-27T09:53:24Z")

</div>

Hi,  
Sorry for the late reply and thanks for the suggestion.  
I successfully use ITK.js to read the Dicom images in the Django framework. I couldn’t use itk.js from [unpkg.com](http://unpkg.com/) as I guess there’s some problem either on my side or somewhere inside that package. But after passing **itk.js** as like this  
`<script src="https://unpkg.com/itk@14.0.1/umd/itk.js"></script>` worked for me.  
I was wondering is there any way to pass below function in VTK.js:  
`smooth = vtk.vtkImageGaussianSmooth()`  
I searched a lot but I couldn’t find an image gaussian function inside both itk and vtk.js.  
Do you have any suggestions for this?  
Thank you!

---

<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: [September 27, 2021, 3:28pm UTC](https://discourse.itk.org/t/how-to-read-series-of-dicom-images-into-django-using-itk-js-for-web-volume-rendering-using-vtk-js/4420/5 "2021-09-27T15:28:24Z")

</div>

Is there something problematic about [SmoothWithRecursiveGaussian](https://itk.org/ITKExamples/src/Filtering/Smoothing/SmoothWithRecursiveGaussian/Documentation.html)?
