When trying to create a DB in which the path contains a folder with a space in the name results in an error message: "Failed to create new database in folder “C:\Users\Folder with space\SlicerDICOMDatabase”. Changing the path in which all folders have no space is successful.
Also, if the database is created elsewhere and moved into the folder, it fails to import DICOM files.
I just tried on mac with space in database name path and also a space in the data path and both worked fine. Maybe others can try on other platforms? It should be the same everywhere.
Note also the database contains absolute paths to the files. It works for me to move the database to a path with spaces.
Microsoft Windows set up my local account on one of my workstations to be my full name with a space in it. When I use One Drive on that computer is when the problem occurs. I am planning to migrate my account to a new account having a name without a space.
As to you point out on best practice of having no spaces, I agree that it has been a custom since it was a requirement of past OS versions (I’ve been writing code since 1969). But in modern OS versions spaces are quite common and the software would ideally be able to handle them.
@sconrad I am running Windows 11 23H2 and was successful creating a new DICOM database in a path that contains a space.
I launched Slicer 5.8.1
I went to Edit->Application Settings
Selected the “DICOM” left side panel in settings
Clicked the “Database location” button and chose a new directory at “C:/My Folder With A Space”
I restarted Slicer 5.8.1.
I went into the DICOM module and imported a new DICOM file and successfully loaded it into the Slicer scene.
What version of Slicer and specific steps did you observe when it failed? Were you upgrading the Slicer DICOM database or creating a brand new empty one?
I’m using 5.8.1. My error occurred on Windows 10 while attempting to use a synchronized OneDrive folder for the database and/or the DICOM import directory. Given the previous replies that OneDrive may be the culprit, or possibly Windows 10, I installed Slicer on a Windows 11 workstation and was able to successfully create a database and import files from directories containing spaces on OneDrive. Tomorrow I will test the Windows 10 machine again on a non-OneDrive folder and determine if it is OneDrive on Windows 10, or some issue with my installation with Windows 10 itself.
Thanks for the replies, and I’ll report what i find tomorrow.
The issue is not just the OS, but every part of the software chain needs to handle this. I complex program like Slicer is like a layered cake, consisting of hundreds of libraries across three major operating systems and their versions. It only takes one combination of option not to support this for things to break.
For example in my field, my colleagues have a tendency use the full genetic knockout nomenclature as a file name to identify a sample. Unfortunately, nomenclature contains special characters like !, *, (), / and others. While it is possible to use to create filenames like that in modern operating systems (with use of proper escape characters of double quotes), whether they will be handled correctly within Slicer is a complete different story.
Please use latest Slicer Stable Release (currently 5.8.1). It should have no problem with spaces in paths. Have you set the folder name using the GUI (or you set it via command-line arguments or by modifying Slicer.ini file, …)? Is the folder writeable?
The DICOM database folder is created by SQLite database. It relies on sophisticated file locking APIs to ensure database integrity when multiple applications perform concurrent read/write operations. Virtual file systems (such as mapped network drives, Google drive, OneDrive, etc.) may not be able to fully emulate these complex file locking behaviors (some features are not implemented, some may not work reliably, and some cannot be implemented due to inherent speed and reliability limitations of network communication). Therefore, I would recommend to use local file system for DICOM database index storage, especially while you are building the database. If you want to share data between several users or need to process huge amount of data on your computer and you don’t have space for local storage then there are many solutions for these in Slicer, but that would be a separate discussion.
I have determined that the issue seems to be related to using OneDrive on Windows 10. I was able to use paths with spaces on a local drive, but not on a locally-synchronized OneDrive folder. Since my user name had a space, my only option is to create a new account without a space in the user name.
On a different workstation with Windows 11, I was able to use paths with spaces on my OneDrive folder.
Thanks for all of the support, and apologies for any delays in replying to this thread.