I am expecting my folder full of dcm files to be imported as they would normally when using the DICOM import GUI (which works well. I am simply trying to practice using this scripting method). I am using the latest version of Slicer 4.11.0 and Python 3.6.7. I will attach a picture of my Slicer screen. No error is being given with my current implementation but nothing is happening. No files are loaded.
I am using the script provided in the python script repository given below:
How to load DICOM files into the scene from a folder
This code loads all DICOM objects into the scene from a file folder. All the registered plugins are evaluated and the one with the highest confidence will be used to load the data. Files are imported into a temporary DICOM database, so the current Slicer DICOM database is not impacted.
dicomDataDir = "c:/my/folder/with/dicom-files" # input folder with DICOM files
loadedNodeIDs = [] # this list will contain the list of all loaded node IDs
from DICOMLib import DICOMUtils
with DICOMUtils.TemporaryDICOMDatabase() as db:
DICOMUtils.importDicom(dicomDataDir, db)
patientUIDs = db.patients()
for patientUID in patientUIDs:
loadedNodeIDs.extend(DICOMUtils.loadPatientByUID(patientUID))