# how to modify Medical4 example of vtk to accept DICOM format slices

**URL:** https://discourse.itk.org/t/how-to-modify-medical4-example-of-vtk-to-accept-dicom-format-slices/2549
**Category:** Beginner Questions
**Created:** [December 19, 2019, 8:45am UTC](https://discourse.itk.org/t/how-to-modify-medical4-example-of-vtk-to-accept-dicom-format-slices/2549 "2019-12-19T08:45:19Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![sag](https://discourse.itk.org/user_avatar/discourse.itk.org/sag/32/2041_2.png) [@sag](https://discourse.itk.org/u/sag)
#### Post date: [December 19, 2019, 8:45am UTC](https://discourse.itk.org/t/how-to-modify-medical4-example-of-vtk-to-accept-dicom-format-slices/2549/1 "2019-12-19T08:45:19Z")

</div>

Hi,

I am trying to replace quarter.1…quater.xx with quarter1.dcm…quarterxx.dcm,  
questions:

1. what is the format of headsq/quarter.1…quarter.xx?
2. how to convert DICOM slices to headsq slice formats?
3. would be that fixed with modification of the Medical1…Medical4 vtk example?

any help appreciated

Regards,  
sag

---

<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: [December 19, 2019, 2:43pm UTC](https://discourse.itk.org/t/how-to-modify-medical4-example-of-vtk-to-accept-dicom-format-slices/2549/2 "2019-12-19T14:43:01Z")

</div>

That is a more of VTK question, belonging to the [VTK forum](https://discourse.vtk.org/). But here is my stab at it:

1. `" DATADIR/headsq/quarter"` is just an example of a path to a 3D image. The image(s) are described in [vtkVolume16Reader’s documentation](https://vtk.org/doc/nightly/html/classvtkVolume16Reader.html#details).
2. You should combine it with [VTK’s read DICOM example](https://vtk.org/Wiki/VTK/Examples/Cxx/IO/ReadDICOMSeries)

---

<div class="post-metadata">

### Author: ![sag](https://discourse.itk.org/user_avatar/discourse.itk.org/sag/32/2041_2.png) [@sag](https://discourse.itk.org/u/sag)
#### Post date: [December 19, 2019, 3:35pm UTC](https://discourse.itk.org/t/how-to-modify-medical4-example-of-vtk-to-accept-dicom-format-slices/2549/3 "2019-12-19T15:35:01Z")

</div>

HI dzenan,  
I got it to work by using vtkDICOMImageReader to read the DICOM slice files in Medical3.cxx and then i need to generalize the extent of the image and other things to make the sagittal, cronal and axial blades to center at iso center of volume. I am not happy with coloring of this this, In medical3 there are bwlut, huelut, and salut if i am not mistaken, but bwlut for sagittal is disastrous for center slice at least and you dont see much it is almost completely white with some black segments with are related to perhaps some tissues in back of the subject. bone and skin i removed in the Image3.cxx and also tried to figure out how to make the black and white segmented sagittal look like.

The strangest thing is that i have check these slices in paraview and they look not sharp but sort of output of Gaussian lowpass filter !?

any suggestions? these dicom slices come from TCIA site/head&neck CT, sort of not happy with the contrast, brightness, colors, how to pick out a tumor of sort of very at early stages of tumor? not happy with image quality!

any help to fix color tables saturation, hue, brightness would be appreciated!

Regards,

sag

---

<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: [December 19, 2019, 3:45pm UTC](https://discourse.itk.org/t/how-to-modify-medical4-example-of-vtk-to-accept-dicom-format-slices/2549/4 "2019-12-19T15:45:35Z")

</div>

> [@sag](#):
>
> …and they look not sharp…  
> …sort of not happy with the contrast…

Pick a different image, or a different image collection. If you must work with those images, welcome to the world of image processing, where nothing is perfect, and some things are far from perfection 😃

> [@sag](#):
>
> help to fix color tables saturation, hue, brightness

This is a straight up question for [VTK forum](https://discourse.vtk.org/)!

---

<div class="post-metadata">

### Author: ![sag](https://discourse.itk.org/user_avatar/discourse.itk.org/sag/32/2041_2.png) [@sag](https://discourse.itk.org/u/sag)
#### Post date: [December 20, 2019, 12:48pm UTC](https://discourse.itk.org/t/how-to-modify-medical4-example-of-vtk-to-accept-dicom-format-slices/2549/5 "2019-12-20T12:48:37Z")

</div>

Hi dzenan,

Thanks any ways I found some problem in my dataset and that is they are 2d images of slices which are rectangular (270 x 320) in these cases quality is even worse. I now try to change the image to 64 x 64 and then see what happens

Regards,  
sag
