# Why these dicom files exported by gdcm cannot be recongnized correctly by 3d slicer?

**URL:** <https://discourse.slicer.org/t/why-these-dicom-files-exported-by-gdcm-cannot-be-recongnized-correctly-by-3d-slicer/29591>\
**Category:** Support\
**Tags:** dicom\
**Created:** [May 23, 2023, 12:59am UTC](https://discourse.slicer.org/t/why-these-dicom-files-exported-by-gdcm-cannot-be-recongnized-correctly-by-3d-slicer/29591 "2023-05-23T00:59:46Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shannon\_Chow](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/shannon_chow/32/66067_2.png) [@Shannon\_Chow](https://discourse.slicer.org/u/Shannon_Chow)\
**Post date:** [May 23, 2023, 12:59am UTC](https://discourse.slicer.org/t/why-these-dicom-files-exported-by-gdcm-cannot-be-recongnized-correctly-by-3d-slicer/29591/1 "2023-05-23T00:59:46Z")

</div>

I exported multiple slices of the same series (and the same study) using [GDCM](https://gdcm.sourceforge.net/) in C++. The data is attached [here](https://drive.google.com/file/d/13xKxE014ZmDDnCrZGY8DfQ6mZDjhZaJ3/view?usp=share_link).  
But it seems that 3D Slicer cannot recognize these files correctly:

1. Each dcm file was recognized as a volume  
[image](https://i.stack.imgur.com/wb0kF.png)
2. After import, nothing is displayed in Slicer.

I think I’ve filled some inappropriate content into some important dicom Tags. But there are hundreds of tags, how to find which one[s] is[are] inappropriate? How to make these dicom files compatible with Slicer?

---

<div class="post-metadata">

**Author:** ![pearsonm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pearsonm/32/18514_2.png) [@pearsonm](https://discourse.slicer.org/u/pearsonm)\
**Post date:** [May 23, 2023, 1:35am UTC](https://discourse.slicer.org/t/why-these-dicom-files-exported-by-gdcm-cannot-be-recongnized-correctly-by-3d-slicer/29591/2 "2023-05-23T01:35:55Z")

</div>

One problem is that there is no windowing information. Both WindowWidth and WindowCenter are 0 and you should also have SmallestImagePixelValue and LargestImagePixelValue. There may be other issues as well.

---

<div class="post-metadata">

**Author:** ![Shannon\_Chow](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/shannon_chow/32/66067_2.png) [@Shannon\_Chow](https://discourse.slicer.org/u/Shannon_Chow)\
**Post date:** [May 23, 2023, 6:53am UTC](https://discourse.slicer.org/t/why-these-dicom-files-exported-by-gdcm-cannot-be-recongnized-correctly-by-3d-slicer/29591/3 "2023-05-23T06:53:46Z")

</div>

Thx for your reply. I’ve added all your mentioned tags but still unresolved.

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/c/bc5adcdbf347360c2226b6b642d95812c2a1a8a7.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/e/de1f13143c0762959a539fa8cc35e76825ed92cd.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/2/b2fa034868d61a819cd5daa2e051a2697bf8b675.png)

---

<div class="post-metadata">

**Author:** ![pearsonm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pearsonm/32/18514_2.png) [@pearsonm](https://discourse.slicer.org/u/pearsonm)\
**Post date:** [May 23, 2023, 7:51am UTC](https://discourse.slicer.org/t/why-these-dicom-files-exported-by-gdcm-cannot-be-recongnized-correctly-by-3d-slicer/29591/4 "2023-05-23T07:51:36Z")

</div>

I can load the study (with errors) on my local build of Slicer. Try using a nightly build.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/9/c/9c5802aca4a978164f8fed4ba68ac1bd5317ed59.png)

---

<div class="post-metadata">

**Author:** ![Shannon\_Chow](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/shannon_chow/32/66067_2.png) [@Shannon\_Chow](https://discourse.slicer.org/u/Shannon_Chow)\
**Post date:** [May 24, 2023, 1:08am UTC](https://discourse.slicer.org/t/why-these-dicom-files-exported-by-gdcm-cannot-be-recongnized-correctly-by-3d-slicer/29591/5 "2023-05-24T01:08:05Z")

</div>

I got the following errors with version 4.10.0 r27501.  
Is there any information of which tag was filled wrong value or missed?

```auto
Python 2.7.13 (default, Oct 18 2018, 22:10:33) [MSC v.1900 64 bit (AMD64)] on win32
>>> 
Traceback (most recent call last):
  File "C:\Program Files\Slicer 4.10.0\lib\Slicer-4.10\qt-scripted-modules\DICOMLib\DICOMWidgets.py", line 737, in getLoadablesFromFileLists
    loadablesByPlugin[plugin] = plugin.examine(fileLists)
  File "C:/Program Files/Slicer 4.10.0/bin/../lib/Slicer-4.10/qt-scripted-modules/MultiVolumeImporterPlugin.py", line 106, in examine
    loadables += self.examineFiles(files)
  File "C:/Program Files/Slicer 4.10.0/bin/../lib/Slicer-4.10/qt-scripted-modules/MultiVolumeImporterPlugin.py", line 493, in examineFiles
    mvNodes = self.initMultiVolumes(subseriesLists[key])
  File "C:/Program Files/Slicer 4.10.0/bin/../lib/Slicer-4.10/qt-scripted-modules/MultiVolumeImporterPlugin.py", line 789, in initMultiVolumes
    tagValue = self.tm2ms(tagValueStr) # convert to ms
  File "C:/Program Files/Slicer 4.10.0/bin/../lib/Slicer-4.10/qt-scripted-modules/MultiVolumeImporterPlugin.py", line 756, in tm2ms
    raise IOError("Invalid DICOM time string: "+tm+" (failed to parse HHMMSS)")
IOError: Invalid DICOM time string: 14:47:47 (failed to parse HHMMSS)
Warning: Plugin failed: MultiVolumeImporterPlugin

See python console for error message.
DICOM Plugin failed: Invalid DICOM time string: 14:47:47 (failed to parse HHMMSS)
Warning in DICOM plugin Scalar Volume when examining loadable Series Number: Unnamed Series: Reference image in series does not contain geometry information. Please use caution.

Loading with imageIOName: GDCM
Could not read scalar volume using GDCM approach. Error is: FileFormatError
Loading with imageIOName: DCMTK
Could not read scalar volume using DCMTK approach. Error is: FileFormatError

Could not load: Series Number: Unnamed Series as a Scalar Volume

```

---

<div class="post-metadata">

**Author:** ![Shannon\_Chow](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/shannon_chow/32/66067_2.png) [@Shannon\_Chow](https://discourse.slicer.org/u/Shannon_Chow)\
**Post date:** [May 24, 2023, 1:09am UTC](https://discourse.slicer.org/t/why-these-dicom-files-exported-by-gdcm-cannot-be-recongnized-correctly-by-3d-slicer/29591/6 "2023-05-24T01:09:30Z")

</div>

How to modify my dicom files to fix the errors?

---

<div class="post-metadata">

**Author:** ![pearsonm](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pearsonm/32/18514_2.png) [@pearsonm](https://discourse.slicer.org/u/pearsonm)\
**Post date:** [May 24, 2023, 2:12am UTC](https://discourse.slicer.org/t/why-these-dicom-files-exported-by-gdcm-cannot-be-recongnized-correctly-by-3d-slicer/29591/7 "2023-05-24T02:12:38Z")

</div>

To fix the immediate problem, time fields need to be in the format “HHMMSS.FFFFFF” so 14:47:47 needs to be changed to 144747.000000 (see the TM field at [https://dicom.nema.org/dicom/2013/output/chtml/part05/sect\_6.2.html](https://dicom.nema.org/dicom/2013/output/chtml/part05/sect_6.2.html))  
In your original file this is the field AcquisitionTime.

You should also upgrade your Slicer if possible as 5.x is better able to handle non-compliant DICOM files.

---

<div class="post-metadata">

**Author:** ![Shannon\_Chow](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/shannon_chow/32/66067_2.png) [@Shannon\_Chow](https://discourse.slicer.org/u/Shannon_Chow)\
**Post date:** [May 26, 2023, 1:19am UTC](https://discourse.slicer.org/t/why-these-dicom-files-exported-by-gdcm-cannot-be-recongnized-correctly-by-3d-slicer/29591/8 "2023-05-26T01:19:46Z")

</div>

Changing time format did not solve the problem. But I can load my dcm files after upgrade Slicer to 5.3.0. Great Thx!
