# Why I can not import DICOM?

**URL:** <https://discourse.slicer.org/t/why-i-can-not-import-dicom/204>\
**Category:** Support\
**Created:** [April 27, 2017, 2:06am UTC](https://discourse.slicer.org/t/why-i-can-not-import-dicom/204 "2017-04-27T02:06:30Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ShyhjenWang](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@ShyhjenWang](https://discourse.slicer.org/u/ShyhjenWang)\
**Post date:** [April 27, 2017, 2:06am UTC](https://discourse.slicer.org/t/why-i-can-not-import-dicom/204/1 "2017-04-27T02:06:30Z")

</div>

I try to import a series of DICOM data, but fail.  
It shows 0 new patients, 0 studies, …  
However, others can import the series with MIMICs.

---

<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:** [April 27, 2017, 2:10am UTC](https://discourse.slicer.org/t/why-i-can-not-import-dicom/204/2 "2017-04-27T02:10:33Z")

</div>

1. Use the latest nightly version of Slicer.
2. Use `DICOM Patcher` module to fix the DICOM files: Set the input directory to the location where your DICOM files are stored, set the output directory to another directory where the fixed, valid DICOM files will be stored (make sure the directory path doesn’t contain any special characters), click Patch, click Import, and then load the data using the DICOM module.

---

<div class="post-metadata">

**Author:** ![ShyhjenWang](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@ShyhjenWang](https://discourse.slicer.org/u/ShyhjenWang)\
**Post date:** [April 27, 2017, 3:51am UTC](https://discourse.slicer.org/t/why-i-can-not-import-dicom/204/3 "2017-04-27T03:51:35Z")

</div>

Sorry, where to get the DICOM patcher module?

---

<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:** [April 27, 2017, 12:15pm UTC](https://discourse.slicer.org/t/why-i-can-not-import-dicom/204/4 "2017-04-27T12:15:18Z")

</div>

It’s in Slicer, in the module list, Utilities category.

---

<div class="post-metadata">

**Author:** ![carba86](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/carba86/32/3943_2.png) [@carba86](https://discourse.slicer.org/u/carba86)\
**Post date:** [January 17, 2018, 12:15am UTC](https://discourse.slicer.org/t/why-i-can-not-import-dicom/204/5 "2018-01-17T00:15:56Z")

</div>

I am having the same problem. No way to fix it so far. Tried Nightly version as well as DICOM patcher with no success.

---

<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:** [January 17, 2018, 12:43am UTC](https://discourse.slicer.org/t/why-i-can-not-import-dicom/204/6 "2018-01-17T00:43:57Z")

</div>

What device was used to acquire the image?

---

<div class="post-metadata">

**Author:** ![carba86](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/carba86/32/3943_2.png) [@carba86](https://discourse.slicer.org/u/carba86)\
**Post date:** [January 17, 2018, 1:31am UTC](https://discourse.slicer.org/t/why-i-can-not-import-dicom/204/7 "2018-01-17T01:31:57Z")

</div>

GE Discovery 750 3T magnet. Ive tríed with MRIs from the Cancer Archive  
Imaging as …well

escribió:

---

<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:** [January 17, 2018, 1:37am UTC](https://discourse.slicer.org/t/why-i-can-not-import-dicom/204/8 "2018-01-17T01:37:19Z")

</div>

Great, this is very useful information. Most likely your DICOM database directory is not set correctly. To confirm this, could you copy-paste here the application log of a failed DICOM import? (log is available in menu: Help / Report a bug)

---

<div class="post-metadata">

**Author:** ![carba86](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/carba86/32/3943_2.png) [@carba86](https://discourse.slicer.org/u/carba86)\
**Post date:** [January 17, 2018, 1:56am UTC](https://discourse.slicer.org/t/why-i-can-not-import-dicom/204/9 "2018-01-17T01:56:08Z")

</div>

[WARNING][Python] 16.01.2018 22:52:33 [Python] (/private/var/folders/wm/7t6787qs7kb8fp5d8vjlvrnw0000gn/T/AppTranslocation/207F0FF5-0744-420D-8978-17417221E506/d/Slicer.app/Contents/bin/Python/slicer/util.py:955) - The database file path “/Users/leacarballo/Documents/SlicerDICOMDatabase/ctkDICOM.sql” cannot be used. Directory is not empty and not an existing DICOM database.  
Please pick a different database directory using the LocalDatabase button in the DICOM Browser  
[DEBUG][Qt] 16.01.2018 22:52:33 [] (unknown:0) - Switch to module: “DICOM”  
[CRITICAL][Stream] 16.01.2018 22:52:33 [] (unknown:0) - The database file path “/Users/leacarballo/Documents/SlicerDICOMDatabase/ctkDICOM.sql” cannot be used. Directory is not empty and not an existing DICOM database.  
[CRITICAL][Stream] 16.01.2018 22:52:33 [] (unknown:0) - Please pick a different database directory using the LocalDatabase button in the DICOM Browser  
[CRITICAL][FD] 16.01.2018 22:52:41 [] (unknown:0) - 2018-01-16 22:52:41.135 Slicer[593:70579] modalSession has been exited prematurely - check for a reentrant call to endModalSession:  
[WARNING][Qt] 16.01.2018 22:52:41 [] (unknown:0) - QSqlQuery::exec: database not open  
[DEBUG][Qt] 16.01.2018 22:52:41 [] (unknown:0) - SQL failed  
Bad SQL: SELECT Version from SchemaInfo;  
[DEBUG][Qt] 16.01.2018 22:52:41 [] (unknown:0) - Error text:  
[WARNING][Qt] 16.01.2018 22:52:41 [] (unknown:0) - QSqlQuery::exec: database not open  
[DEBUG][Qt] 16.01.2018 22:52:41 [] (unknown:0) - SQL failed  
Bad SQL: CREATE TABLE IF NOT EXISTS main.Filenames\_backup (Filename TEXT PRIMARY KEY NOT NULL )  
[DEBUG][Qt] 16.01.2018 22:52:41 [] (unknown:0) - Error text:  
[WARNING][Qt] 16.01.2018 22:52:41 [] (unknown:0) - QSqlQuery::exec: database not open  
[DEBUG][Qt] 16.01.2018 22:52:41 [] (unknown:0) - SQL failed  
Bad SQL: INSERT INTO Filenames\_backup SELECT Filename FROM Images;  
[DEBUG][Qt] 16.01.2018 22:52:41 [] (unknown:0) - Error text:  
[WARNING][Qt] 16.01.2018 22:52:41 [] (unknown:0) - QSqlQuery::exec: database not open  
[DEBUG][Qt] 16.01.2018 22:52:41 [] (unknown:0) - SQL failed  
Bad SQL: DROP TABLE IF EXISTS ‘SchemaInfo’;  
[DEBUG][Qt] 16.01.2018 22:52:41 [] (unknown:0) - Error text:  
[WARNING][Qt] 16.01.2018 22:52:41 [] (unknown:0) - QSqlQuery::exec: database not open  
[WARNING][Qt] 16.01.2018 22:52:41 [] (unknown:0) - QSqlQuery::exec: database not open  
[WARNING][Qt] 16.01.2018 22:52:41 [] (unknown:0) - QSqlQuery::exec: database not open  
[WARNING][Qt] 16.01.2018 22:52:41 [] (unknown:0) - QSqlQuery::exec: database not open  
[WARNING][Qt] 16.01.2018 22:52:41 [] (unknown:0) - QSqlQuery::exec: database not open  
[WARNING][Qt] 16.01.2018 22:52:41 [] (unknown:0) - QSqlQuery::exec: database not open  
[WARNING][Qt] 16.01.2018 22:52:41 [] (unknown:0) - QSqlQuery::exec: database not open  
[WARNING][Qt] 16.01.2018 22:52:41 [] (unknown:0) - QSqlQuery::exec: database not open  
[WARNING][Qt] 16.01.2018 22:52:41 [] (unknown:0) - QSqlQuery::exec: database not open  
[WARNING][Qt] 16.01.2018 22:52:41 [] (unknown:0) - QSqlQuery::exec: database not open  
[WARNING][Qt] 16.01.2018 22:52:41 [] (unknown:0) - QSqlQuery::exec: database not open  
[WARNING][Qt] 16.01.2018 22:52:41 [] (unknown:0) - QSqlQuery::exec: database not open  
[WARNING][Qt] 16.01.2018 22:52:41 [] (unknown:0) - QSqlQuery::exec: database not open  
[WARNING][Qt] 16.01.2018 22:52:41 [] (unknown:0) - QSqlQuery::exec: database not open  
[WARNING][Qt] 16.01.2018 22:52:41 [] (unknown:0) - QSqlQuery::exec: database not open  
[WARNING][Qt] 16.01.2018 22:52:41 [] (unknown:0) - QSqlQuery::exec: database not open  
[WARNING][Qt] 16.01.2018 22:52:41 [] (unknown:0) - QSqlQuery::exec: database not open  
[WARNING][Qt] 16.01.2018 22:52:41 [] (unknown:0) - QSqlQuery::exec: database not open  
[WARNING][Qt] 16.01.2018 22:52:41 [] (unknown:0) - QSqlQuery::exec: database not open  
[WARNING][Qt] 16.01.2018 22:52:41 [] (unknown:0) - QSqlQuery::exec: database not open  
[WARNING][Qt] 16.01.2018 22:52:41 [] (unknown:0) - QSqlQuery::exec: database not open  
[WARNING][Qt] 16.01.2018 22:52:41 [] (unknown:0) - QSqlQuery::exec: database not open  
[DEBUG][Qt] 16.01.2018 22:52:41 [] (unknown:0) - SQL failed  
Bad SQL: SELECT Filename from Filenames\_backup ;  
[DEBUG][Qt] 16.01.2018 22:52:41 [] (unknown:0) - Error text:  
[WARNING][Qt] 16.01.2018 22:52:41 [] (unknown:0) - QSqlQuery::exec: database not open  
[DEBUG][Qt] 16.01.2018 22:52:41 [] (unknown:0) - SQL failed  
Bad SQL: DROP TABLE main.Filenames\_backup;  
[DEBUG][Qt] 16.01.2018 22:52:41 [] (unknown:0) - Error text:  
[WARNING][Qt] 16.01.2018 22:52:41 [] (unknown:0) - QSqlQuery::prepare: database not open  
[WARNING][Qt] 16.01.2018 22:52:58 [] (unknown:0) - QSqlQuery::prepare: database not open  
[DEBUG][Qt] 16.01.2018 22:52:58 [] (unknown:0) - SQL failed  
Bad SQL:  
[DEBUG][Qt] 16.01.2018 22:52:58 [] (unknown:0) - Error text: Parameter count mismatch  
[WARNING][Qt] 16.01.2018 22:52:58 [] (unknown:0) - QSqlQuery::prepare: database not open  
[CRITICAL][Qt] 16.01.2018 22:52:58 [] (unknown:0) - SQLITE ERROR: Parameter count mismatch  
[WARNING][Qt] 16.01.2018 22:52:58 [] (unknown:0) - QSqlQuery::prepare: database not open  
[DEBUG][Qt] 16.01.2018 22:52:58 [] (unknown:0) - SQL failed

---

<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:** [January 17, 2018, 2:11am UTC](https://discourse.slicer.org/t/why-i-can-not-import-dicom/204/10 "2018-01-17T02:11:42Z")

</div>

This log message describes the problem and suggested solution:

> [@carba86](#):
>
> The database file path “/Users/leacarballo/Documents/SlicerDICOMDatabase/ctkDICOM.sql” cannot be used. Directory is not empty and not an existing DICOM database.
> 
> Please pick a different database directory using the LocalDatabase button in the DICOM Browser

Please set an empty folder for DICOM database that you have write access to, try DICOM import again, and let us know if it fixed the DICOM importing.

---

<div class="post-metadata">

**Author:** ![timeanddoctor](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/timeanddoctor/32/5839_2.png) [@timeanddoctor](https://discourse.slicer.org/u/timeanddoctor)\
**Post date:** [January 17, 2018, 12:15pm UTC](https://discourse.slicer.org/t/why-i-can-not-import-dicom/204/11 "2018-01-17T12:15:46Z")

</div>

If the system language is Chinese, the folder name of DICOM files should be named by English.  
I think this problem will be fixed in the futrue.

---

<div class="post-metadata">

**Author:** ![carba86](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/carba86/32/3943_2.png) [@carba86](https://discourse.slicer.org/u/carba86)\
**Post date:** [January 17, 2018, 12:44pm UTC](https://discourse.slicer.org/t/why-i-can-not-import-dicom/204/12 "2018-01-17T12:44:14Z")

</div>

Thank you Andras, you were right…it was the DICOM database directory indeed. I appreciate your help.

---

<div class="post-metadata">

**Author:** ![Syed\_Faiz\_Ali](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@Syed\_Faiz\_Ali](https://discourse.slicer.org/u/Syed_Faiz_Ali)\
**Post date:** [February 16, 2019, 2:20pm UTC](https://discourse.slicer.org/t/why-i-can-not-import-dicom/204/13 "2019-02-16T14:20:33Z")

</div>

Simply, just copy/cut the dcm file folder to some other location. It will work just fine… it did work fine in my case.

---

<div class="post-metadata">

**Author:** ![markyang19](https://avatars.discourse-cdn.com/v4/letter/m/45deac/32.png) [@markyang19](https://discourse.slicer.org/u/markyang19)\
**Post date:** [February 21, 2020, 12:34pm UTC](https://discourse.slicer.org/t/why-i-can-not-import-dicom/204/14 "2020-02-21T12:34:41Z")

</div>

I have the same problem. After changing the folder name from Chinese to English, this problem was fixed.

---

<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 21, 2020, 2:49pm UTC](https://discourse.slicer.org/t/why-i-can-not-import-dicom/204/15 "2020-02-21T14:49:13Z")

</div>

Starting from today, Slicer Preview Release (revision 28783) should be able to import DICOM files from any folder. See announcement and more details here: [Special characters in filenames and strings are now allowed](https://discourse.slicer.org/t/special-characters-in-filenames-and-strings-are-now-allowed/10375)

It is all very new and probably it will take a while to get all problems ironed out, but it should work.

---

<div class="post-metadata">

**Author:** ![Pablo\_Montes](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pablo_montes/32/6818_2.png) [@Pablo\_Montes](https://discourse.slicer.org/u/Pablo_Montes)\
**Post date:** [May 12, 2020, 8:02pm UTC](https://discourse.slicer.org/t/why-i-can-not-import-dicom/204/16 "2020-05-12T20:02:06Z")

</div>

Hi. I also have an internal error while loading dicom  
The message detail is:  
Exception thrown in event: calling methods on uninitialized ctkDICOMItem

Any suggestions? Thanks

---

<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:** [May 12, 2020, 8:05pm UTC](https://discourse.slicer.org/t/why-i-can-not-import-dicom/204/17 "2020-05-12T20:05:57Z")

</div>

Could you please try with the latest Slicer Preview Release?

---

<div class="post-metadata">

**Author:** ![Varsha](https://avatars.discourse-cdn.com/v4/letter/v/aeb1de/32.png) [@Varsha](https://discourse.slicer.org/u/Varsha)\
**Post date:** [March 10, 2021, 6:41am UTC](https://discourse.slicer.org/t/why-i-can-not-import-dicom/204/18 "2021-03-10T06:41:15Z")

</div>

I am facing a similar problem importing DICOM files. The message displayed is import completed: 0 patients, 0 studies. I tried installing quantitative reporting as well as copying the images to another folder but both don’t seem to be working. Even DICOM patcher is not solving the issue at hand. How can I load the images?

---

<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 11, 2021, 4:16am UTC](https://discourse.slicer.org/t/why-i-can-not-import-dicom/204/19 "2021-03-11T04:16:30Z")

</div>

Please follow [these instructions](https://slicer.readthedocs.io/en/latest/user_guide/modules/dicom.html#i-try-to-import-a-directory-of-dicom-files-but-nothing-shows-up-in-the-browser).

---

<div class="post-metadata">

**Author:** ![Julien\_D](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/julien_d/32/66125_2.png) [@Julien\_D](https://discourse.slicer.org/u/Julien_D)\
**Post date:** [June 2, 2023, 8:56pm UTC](https://discourse.slicer.org/t/why-i-can-not-import-dicom/204/20 "2023-06-02T20:56:02Z")

</div>

Hi, I had a similar problem (imported 0 new patient, 0 new studies) but copying/pasting all the dcm files in a new folder seems to have solved the issue. I can’t share the log because it shows the patient’s name in some places but I’ll gladly provide more info if needed.

[Next page](https://discourse.slicer.org/t/why-i-can-not-import-dicom/204.md?page=2)
