Slicer3/DICOM import mechanism
From Slicer Wiki
Home < Slicer3 < DICOM import mechanism
Some DICOM-enabled applications have import mechanisms that run in the background. One system, the GE Advantage Windows Workstation, monitors a specific directory and imports dicom files that arrive into that directory.
Proposal 1:
Create a program (without a user interface) that monitors a specific directory for dicom files. When a file arrives in this directory, the program parses the file and populates an SQL database. This database can be accessed by other applications that may or may not have a user interface. For example, Slicer3 could provide a GUI to browse the database and load user selected DICOM series.
Issues
- Should the program move the DICOM files to another location once they arrive
- On startup, should the program synchronize the database with existing files. For example, if a user deletes the DICOM files with an OS command like rm, should the program delete the corresponding entries in the database, or, should the sync be user driven.
Components
- An SQL Schema.
- A library to monitor files.
- A program to parse DICOM files and populate an SQL database.
- A GUI to browse and load DICOM files from the SQL database.
Progress
- FileWatcher has been placed in Slicer3/Libs. From the link, "FileWatcher is a C++ wrapper for OS file monitoring systems. Currently it uses Win32 ReadDirectoryChangesW for monitoring changes in Windows, and inotify in linux. OSX is supported via kqueue and directory scans." FileWatcher is portable and has a liberal (MIT) license.
- A Patient/Study/Series/Image sqlite schema has been designed.
- DicomToSQLite recursively parses directories looking for dicom file. Creates sql statements to populate a database using the schema described here. Also creates a NRRD nhdr file that references the original dicom files.