# How to read Dicom using VTK from header

**URL:** https://discourse.vtk.org/t/how-to-read-dicom-using-vtk-from-header/6954
**Category:** Support
**Tags:** file-formats
**Created:** [October 25, 2021, 8:00am UTC](https://discourse.vtk.org/t/how-to-read-dicom-using-vtk-from-header/6954 "2021-10-25T08:00:14Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Riad](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/r/f08c70/32.png) [@Riad](https://discourse.vtk.org/u/Riad)
#### Post date: [October 25, 2021, 8:00am UTC](https://discourse.vtk.org/t/how-to-read-dicom-using-vtk-from-header/6954/1 "2021-10-25T08:00:15Z")

</div>

Hello, I have some issues when I try to read Dicom from header. I Have to files (File1.IMG and file2.hdr) and I’m using this code:  
vtkSmartPointer\< vtkDICOMImageReader \> reader = vtkSmartPointer\< vtkDICOMImageReader \>::New();  
reader-\>SetFileName(path\_to\_file1);  
reader-\>Update();

There was a problem retrieving Data from : Path\_to\_File1

The same code works good when I use a set of dicom slices (file1.dcm, file2.dcm, file3.dcm…filen.dcm)  
vtkSmartPointer\< vtkDICOMImageReader \> reader = vtkSmartPointer\< vtkDICOMImageReader \>::New();  
reader-\>SetDirectoryName(path\_to\_serie);  
reader-\>Update();

Do you have any idea about this issue please !!

thank you
