# Dicom images and progress rendering

**URL:** https://discourse.vtk.org/t/dicom-images-and-progress-rendering/249
**Category:** Support
**Created:** [February 9, 2019, 6:52am UTC](https://discourse.vtk.org/t/dicom-images-and-progress-rendering/249 "2019-02-09T06:52:44Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Romain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/romain/32/32_2.png) [@Romain](https://discourse.vtk.org/u/Romain)
#### Post date: [February 9, 2019, 6:52am UTC](https://discourse.vtk.org/t/dicom-images-and-progress-rendering/249/1 "2019-02-09T06:52:44Z")

</div>

Hello everyone,

I work with DICOM series. Each series contain around 500 slices. I use the great module vtk-dicom to do all the reading part.

During reading of those slices, is it possible to display the slice read?

Actually, I put an observer to the reader on the ProgressEvent to display the progression but not the images.

I don’t find any example and didn’t find anything in the documentation.

Is it possible?

Thank you

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [February 9, 2019, 5:25pm UTC](https://discourse.vtk.org/t/dicom-images-and-progress-rendering/249/2 "2019-02-09T17:25:31Z")

</div>

In vtk-dicom v0.8.9, you can call reader-\>GetProgressText() in your observer to get the name of file that is currently being read.

---

<div class="post-metadata">

### Author: ![Romain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/romain/32/32_2.png) [@Romain](https://discourse.vtk.org/u/Romain)
#### Post date: [February 9, 2019, 11:32pm UTC](https://discourse.vtk.org/t/dicom-images-and-progress-rendering/249/3 "2019-02-09T23:32:17Z")

</div>

Thank you for your answer.

I think I didn’t expose my problem quite well.

For example, I have a series of 500 Dicom files. During the reading, I suppose that not all dicom are loaded at the same time.  
Is it possible during the reading phase to display the image loaded (not the image file) file after file?

---

<div class="post-metadata">

### Author: ![dgobbi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/dgobbi/32/18_2.png) [@dgobbi](https://discourse.vtk.org/u/dgobbi)
#### Post date: [February 10, 2019, 4:07am UTC](https://discourse.vtk.org/t/dicom-images-and-progress-rendering/249/4 "2019-02-10T04:07:38Z")

</div>

The quick answer is no, because the buffer that vtkDICOMReader reads the individual files into is not accessible through its API.

A longer answer is that the reading of images is centralized in a single internal virtual method, appropriately called ReadOneFile(), so you could write a subclass that overrides this method and does what you need. For example, you could add another output to vtkDICOMReader that is big enough for just one image, and you could modify ReadOneFile() so that it copies the most recently read file into that output.

---

<div class="post-metadata">

### Author: ![Romain](https://discourse.vtk.org/user_avatar/discourse.vtk.org/romain/32/32_2.png) [@Romain](https://discourse.vtk.org/u/Romain)
#### Post date: [February 10, 2019, 7:09am UTC](https://discourse.vtk.org/t/dicom-images-and-progress-rendering/249/5 "2019-02-10T07:09:06Z")

</div>

Ok great. Thank you so much for your answer and explanations.  
I will try to subclass vtkDICOMReader then give you a feedback on it.
