# RuntimeError: No valid DICOM-NRRD pairs found in the directories

**URL:** <https://discourse.slicer.org/t/runtimeerror-no-valid-dicom-nrrd-pairs-found-in-the-directories/41644>\
**Category:** Support\
**Created:** [February 12, 2025, 11:42am UTC](https://discourse.slicer.org/t/runtimeerror-no-valid-dicom-nrrd-pairs-found-in-the-directories/41644 "2025-02-12T11:42:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kwonheokju](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/kwonheokju/32/78416_2.png) [@kwonheokju](https://discourse.slicer.org/u/kwonheokju)\
**Post date:** [February 12, 2025, 11:42am UTC](https://discourse.slicer.org/t/runtimeerror-no-valid-dicom-nrrd-pairs-found-in-the-directories/41644/1 "2025-02-12T11:42:05Z")

</div>

Hi, I’m trying to do machine learning using raw data in dicom format and mask data in nrrd format.  
However, the number of dicom files and the number of slices of nrd are not the same.  
When I open dicom and nrrd together using slicer, it’s matching, what’s the problem?

---

<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:** [February 13, 2025, 4:26am UTC](https://discourse.slicer.org/t/runtimeerror-no-valid-dicom-nrrd-pairs-found-in-the-directories/41644/2 "2025-02-13T04:26:00Z")

</div>

Reconstruction of a 3D volume from 2D slices is a very complex task. Most likely there is no problem, there can be several valid reasons for the input slices not matching the dimensions of the reconstructed volume. Tell us more about your data.

---

<div class="post-metadata">

**Author:** ![kwonheokju](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/kwonheokju/32/78416_2.png) [@kwonheokju](https://discourse.slicer.org/u/kwonheokju)\
**Post date:** [February 13, 2025, 4:47am UTC](https://discourse.slicer.org/t/runtimeerror-no-valid-dicom-nrrd-pairs-found-in-the-directories/41644/3 "2025-02-13T04:47:55Z")

</div>

No, I’m not trying to reconstruct 2D into 3D.  
In slicer, the number of dcm and nrd is the same, but the number of indexes is not the same when imported from python.
