# Slicer crashes while trying to load DICOM files

**URL:** <https://discourse.slicer.org/t/slicer-crashes-while-trying-to-load-dicom-files/34931>\
**Category:** Support\
**Created:** [March 17, 2024, 12:03am UTC](https://discourse.slicer.org/t/slicer-crashes-while-trying-to-load-dicom-files/34931 "2024-03-17T00:03:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![arkinacar](https://avatars.discourse-cdn.com/v4/letter/a/8dc957/32.png) [@arkinacar](https://discourse.slicer.org/u/arkinacar)\
**Post date:** [March 17, 2024, 12:03am UTC](https://discourse.slicer.org/t/slicer-crashes-while-trying-to-load-dicom-files/34931/1 "2024-03-17T00:03:01Z")

</div>

Hello. I try to load DICOM files in the Slicer, yet it crashes while I’m trying to do so.  
I tried both the latest and the stable versions, yet the problem occurred in both.  
When I import the folder containing the DICOM files, the series appear on the right side. However, when I try to load them, Slicer crashes.  
Can it be problem regarding plugins? I can load jpeg files without any problems.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 17, 2024, 12:06am UTC](https://discourse.slicer.org/t/slicer-crashes-while-trying-to-load-dicom-files/34931/2 "2024-03-17T00:06:58Z")

</div>

Most likely your DICOM files are corrupted (for example, by incorrect anonymization). If the images do not contain patient information then you may share them (upload somewhere and post the link here) and we can have a look and tell what’s wrong with them and how to fix.

---

<div class="post-metadata">

**Author:** ![arkinacar](https://avatars.discourse-cdn.com/v4/letter/a/8dc957/32.png) [@arkinacar](https://discourse.slicer.org/u/arkinacar)\
**Post date:** [March 17, 2024, 9:18am UTC](https://discourse.slicer.org/t/slicer-crashes-while-trying-to-load-dicom-files/34931/3 "2024-03-17T09:18:41Z")

</div>

Ok now. I saw that my DICOM files were not anonymous. So, first, I exported them from my DICOM viewer as anonymous. Yet, I still can’t get them loaded in Slicer.  
Here, I share a Google Drive link, including an axial section of chest CT with 362 images.  
Thank you so much for your time and thanks in advance.  
Please tell me what I do wrong

> **[Google Drive: Sign-in](https://accounts.google.com/v3/signin/identifier?continue=https%3A%2F%2Fdrive.google.com%2Fdrive%2Ffolders%2F1NzTFqbgCKRHL4un8_upbALyUIa5apiI5%3Fusp%3Ddrive_link&followup=https%3A%2F%2Fdrive.google.com%2Fdrive%2Ffolders%2F1NzTFqbgCKRHL4un8_upbALyUIa5apiI5%3Fusp%3Ddrive_link&ifkv=ATuJsjwN-hgEMfBiNiD_8plpIS6SI6w_TirobyWVvOm6i37xW_DtV6hbD0KYBh2WTftHAZcg4EHA6g&osid=1&passive=1209600&service=wise&flowName=WebLiteSignIn&flowEntry=ServiceLogin&dsh=S1141598184%3A1710667063968212)**
>
> Access Google Drive with a Google account (for personal use) or Google Workspace account (for business use).

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 17, 2024, 11:24pm UTC](https://discourse.slicer.org/t/slicer-crashes-while-trying-to-load-dicom-files/34931/4 "2024-03-17T23:24:08Z")

</div>

Thank you. I’ve checked the file and it is highly unusual (allocates 32 bits to store a 14-bit image) but probably valid. I’ve submitted a fix to ITK (the library that we use for DICOM loading):

> <https://github.com/InsightSoftwareConsortium/ITK/pull/4522>
>
> Fix crash in ITK DICOM reader when attempting to read an unusual but valid DICOM… file, which has 32 bits allocated.
> Fixes the error reported at https://discourse.slicer.org/t/slicer-crashes-while-trying-to-load-dicom-files/34931/3
> 
> \## PR Checklist
> \- \[x\] No \[API changes\](https://github.com/InsightSoftwareConsortium/ITK/blob/master/CONTRIBUTING.md#breaking-changes) were made (or the changes have been approved)
> \- \[x\] No \[major design changes\](https://github.com/InsightSoftwareConsortium/ITK/blob/master/CONTRIBUTING.md#design-changes) were made (or the changes have been approved)
> \- \[\] Added test (or behavior not changed)
> \- \[x\] Updated API documentation (or API not changed)
> \- \[x\] Added \[license\](https://github.com/InsightSoftwareConsortium/ITK/blob/master/Utilities/KWStyle/ITKHeader.h) to new files (if any)
> \- \[x\] Added Python wrapping to new files (if any) as described in \[ITK Software Guide\](https://itk.org/ItkSoftwareGuide.pdf) Section 9.5
> \- \[x\] Added \[ITK examples\](https://github.com/InsightSoftwareConsortium/ITKSphinxExamples) for all new major features (if any)
> 
> Refer to the \[ITK Software Guide\](https://itk.org/ItkSoftwareGuide.pdf) for
> further development details if necessary.

It’ll probably take a couple of days to get the fix into Slicer.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 18, 2024, 3:54pm UTC](https://discourse.slicer.org/t/slicer-crashes-while-trying-to-load-dicom-files/34931/5 "2024-03-18T15:54:50Z")

</div>

@arkinacar can I add one of the slices of the image you shared to the test data sets of ITK toolkit? (that would allow all automatic testing to check this unusual but probably valid DICOM file variant)

---

<div class="post-metadata">

**Author:** ![arkinacar](https://avatars.discourse-cdn.com/v4/letter/a/8dc957/32.png) [@arkinacar](https://discourse.slicer.org/u/arkinacar)\
**Post date:** [March 18, 2024, 4:03pm UTC](https://discourse.slicer.org/t/slicer-crashes-while-trying-to-load-dicom-files/34931/6 "2024-03-18T16:03:53Z")

</div>

Sure! As long as the problem is solved, it is np really

Android için [Outlook](https://aka.ms/AAb9ysg) edinin

---

<div class="post-metadata">

**Author:** ![arkinacar](https://avatars.discourse-cdn.com/v4/letter/a/8dc957/32.png) [@arkinacar](https://discourse.slicer.org/u/arkinacar)\
**Post date:** [March 27, 2024, 7:55pm UTC](https://discourse.slicer.org/t/slicer-crashes-while-trying-to-load-dicom-files/34931/7 "2024-03-27T19:55:06Z")

</div>

Hello again. Is there any update regarding the issue?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 27, 2024, 8:34pm UTC](https://discourse.slicer.org/t/slicer-crashes-while-trying-to-load-dicom-files/34931/8 "2024-03-27T20:34:08Z")

</div>

The problem was in GDCM, used by ITK, used by Slicer. I’ve fixed the issue in GDCM, the fix was merged into ITK, the last step is to merge into Slicer. Since Slicer’s ITK has not been updated for a while, it’ll probably take a couple of more days. So, probably the fix will be available in the Slicer Preview Release late next week.
