# import error in DICOM module

**URL:** <https://discourse.slicer.org/t/import-error-in-dicom-module/8511>\
**Category:** Support\
**Tags:** dicom\
**Created:** [September 20, 2019, 5:36pm UTC](https://discourse.slicer.org/t/import-error-in-dicom-module/8511 "2019-09-20T17:36:57Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahulba](https://avatars.discourse-cdn.com/v4/letter/r/7ba0ec/32.png) [@rahulba](https://discourse.slicer.org/u/rahulba)\
**Post date:** [September 20, 2019, 5:36pm UTC](https://discourse.slicer.org/t/import-error-in-dicom-module/8511/1 "2019-09-20T17:36:57Z")

</div>

Problem report for Slicer 4.10.2 win-amd64: [please describe expected and actual behavior]  
Getting  
0 New Patients, 0 New Studies  
please help…here is my log files  
thank you

 ![Screenshot%20(20)](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/f/5f481470e1e8818e3085fe077a52e29eda4d0305.png)

---

<div class="post-metadata">

**Author:** ![Chris\_Rorden](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chris_rorden/32/4073_2.png) [@Chris\_Rorden](https://discourse.slicer.org/u/Chris_Rorden)\
**Post date:** [September 20, 2019, 7:54pm UTC](https://discourse.slicer.org/t/import-error-in-dicom-module/8511/2 "2019-09-20T19:54:26Z")

</div>

As a first step, why not see if dcm2niix can handle these images.

1. Choose View/ExtensionManager menu
2. In “Install Extensions” tab, search for “Dcm2nii” - select the “SlicerDcm2nii” extension and install it.
3. Now in the main Slicer window you can show “All modules” and select “Dcm2niixGUI”. This will allow you to select the input directory.

---

<div class="post-metadata">

**Author:** ![rahulba](https://avatars.discourse-cdn.com/v4/letter/r/7ba0ec/32.png) [@rahulba](https://discourse.slicer.org/u/rahulba)\
**Post date:** [September 21, 2019, 10:18am UTC](https://discourse.slicer.org/t/import-error-in-dicom-module/8511/3 "2019-09-21T10:18:42Z")

</div>

It is showing error.Here is the error log…  
log

[INFO][Stream] 21.09.2019 15:38:33 [] (unknown:0) - ('running: ‘, [u’C:/Users/abhis/AppData/Roaming/NA-MIC/Extensions-28257/SlicerDcm2nii/lib/Slicer-4.10/qt-scripted-modules\\Resources\\bin\\dcm2niix’, ‘-1’, ‘-d’, ‘0’, ‘-f’, ‘tmpfxalef’, ‘-o’, ‘C:/Users/abhis/AppData/Local/Temp/Slicer/\_\_SlicerTemp\_\_’, ‘-e’, ‘y’, ‘-z’, ‘y’, ‘F:/rahuldce/DCEMRISERIES’])

[CRITICAL][Stream] 21.09.2019 15:38:33 [] (unknown:0) - Command ‘[u’C:/Users/abhis/AppData/Roaming/NA-MIC/Extensions-28257/SlicerDcm2nii/lib/Slicer-4.10/qt-scripted-modules\\Resources\\bin\\dcm2niix’, ‘-1’, ‘-d’, ‘0’, ‘-f’, ‘tmpfxalef’, ‘-o’, ‘C:/Users/abhis/AppData/Local/Temp/Slicer/\_\_SlicerTemp\_\_’, ‘-e’, ‘y’, ‘-z’, ‘y’, ‘F:/rahuldce/DCEMRISERIES’]’ returned non-zero exit status 2

---

<div class="post-metadata">

**Author:** ![Chris\_Rorden](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chris_rorden/32/4073_2.png) [@Chris\_Rorden](https://discourse.slicer.org/u/Chris_Rorden)\
**Post date:** [September 21, 2019, 11:30am UTC](https://discourse.slicer.org/t/import-error-in-dicom-module/8511/4 "2019-09-21T11:30:00Z")

</div>

@ljod do you have any thoughts on this? Has the SlicerDcm2nii extension been tested on Windows? Just looking at the output it looks like @rahulba is using Windows, and the output shows “\” and “/” where I would expect Windows to use just “”. I am not very familiar with Windows, but I wonder if this is causing issues.

@rahulba :

1. are you able to share a sample dataset via box, dropbox or google drive?
2. Do you have access to a MacOS or Linux computer to see if your issue is specific with Windows?

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [September 21, 2019, 1:02pm UTC](https://discourse.slicer.org/t/import-error-in-dicom-module/8511/5 "2019-09-21T13:02:56Z")

</div>

@rahulba did you try the suggestions in the FAQ?

[https://www.slicer.org/wiki/Documentation/Nightly/FAQ/DICOM](https://www.slicer.org/wiki/Documentation/Nightly/FAQ/DICOM)

---

<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:** [September 21, 2019, 2:02pm UTC](https://discourse.slicer.org/t/import-error-in-dicom-module/8511/6 "2019-09-21T14:02:55Z")

</div>

> [@Chris\_Rorden](#):
>
> Has the SlicerDcm2nii extension been tested on Windows?

Yes, it should work well on windows. [quote=“Chris\_Rorden, post:4, topic:8511”]  
output shows “\” and “/” where I would expect Windows to use just “”  
[/quote]

Multi-platform applications usually don’t have problems with mixed path separators.

Is it possible that dcm2niix returns 2 as exit status and does not print any error messages? (I’m just trying to find out if dcm2niix is started successfully or the error occurred before that)

---

<div class="post-metadata">

**Author:** ![Chris\_Rorden](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chris_rorden/32/4073_2.png) [@Chris\_Rorden](https://discourse.slicer.org/u/Chris_Rorden)\
**Post date:** [September 21, 2019, 2:54pm UTC](https://discourse.slicer.org/t/import-error-in-dicom-module/8511/7 "2019-09-21T14:54:27Z")

</div>

@lassoan - good catch, Exit code 2 reports that no valid files were found. However, no error is reported as the client asked for zero search depth. In this case, the exit code is explicit that no files are found, and therefore dcm2niix does not see the need to report an error. A quirk of dcm2niix generates a text error to the console when search depth is greater than zero but not when it is zero. The rationale is that with search depth 0 the calling software is explicitly requesting one folder, and might be calling multiple instances of dcm2niix to convert different folders [in parallel and asynchronously](https://github.com/neurolabusc/dcm2niiXL). The default behavior of dcm2niix is `-d 5`, which will search the specified folder and children 5 folders deep. This is useful if the user selects a parent DICOMDIR, or if a single series are spread across multiple child folders (e.g. some vendors limit a folder to 1000 2D DICOM images, so DWI and fMRI series are often stored in multiple folders). I can understand the Slicer developers may prefer to explicitly search only one folder, but they may want to provide some logic for the case where the user is intentionally selecting a root DICOM folder.

The source code is:

```
if (opts->dirSearchDepth > 0)
            	printError("Unable to find any DICOM images in %s (or subfolders %d deep)\n", indir, opts->dirSearchDepth);
            else //keep silent for dirSearchDepth = 0 - presumably searching multiple folders
            	{};

```

the dcm2niix error codes are:

```
EXIT_SUCCESS 0
EXIT_FAILURE 1 (GENERAL TYPE)
EXIT_NO_VALID_FILES_FOUND 2
EXIT_REPORT_VERSION 3
EXIT_CORRUPT_FILE_FOUND 4

```

However, it is unclear whether there are in fact no valid files in that folder or whether the folder is not being specified correctly.

@rahulba can you try running [dcm2niix](https://github.com/rordenlab/dcm2niix/releases) from the Windows command line: `dcm2niix F:/rahuldce/DCEMRISERIES` and tell us what error is reported? Are the DICOM files directly in this folder, or does this folder have a DICOMDIR with the actual DICOMs buried in a sub-folder?

---

<div class="post-metadata">

**Author:** ![rahulba](https://avatars.discourse-cdn.com/v4/letter/r/7ba0ec/32.png) [@rahulba](https://discourse.slicer.org/u/rahulba)\
**Post date:** [September 23, 2019, 10:42am UTC](https://discourse.slicer.org/t/import-error-in-dicom-module/8511/8 "2019-09-23T10:42:48Z")

</div>

> [@Chris\_Rorden](#):
>
> dcm2niix F:/rahuldce/DCEMRISERIES

yes i have read that and tried many things from that, nothing helped…thanks

---

<div class="post-metadata">

**Author:** ![rahulba](https://avatars.discourse-cdn.com/v4/letter/r/7ba0ec/32.png) [@rahulba](https://discourse.slicer.org/u/rahulba)\
**Post date:** [September 23, 2019, 10:44am UTC](https://discourse.slicer.org/t/import-error-in-dicom-module/8511/9 "2019-09-23T10:44:50Z")

</div>

i will share my data by google drive, please share your email…

---

<div class="post-metadata">

**Author:** ![Chris\_Rorden](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chris_rorden/32/4073_2.png) [@Chris\_Rorden](https://discourse.slicer.org/u/Chris_Rorden)\
**Post date:** [September 23, 2019, 10:49am UTC](https://discourse.slicer.org/t/import-error-in-dicom-module/8511/10 "2019-09-23T10:49:42Z")

</div>

My last name at sc.edu

---

<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:** [September 23, 2019, 11:38am UTC](https://discourse.slicer.org/t/import-error-in-dicom-module/8511/11 "2019-09-23T11:38:18Z")

</div>

You can also send private messages through discourse (click on the user’s name then in the displayed popup window click the message icon).
