What is Dicomverter?
Dicomverter is a perl script that sorts a collection of DICOM images into subdirectory based on what acquisition they belong to. Within the subdirectories, the files are named according to their position within the acquisition.
It can also be instructed to run a MINC conversion script, more as a convenience to MINC users. It would be trivial to change the conversion script used.
Requirements
Dicomverter is a Perl script and it has only been used on fairly recent (5.6.x and 5.8.x) versions of Perl. I make no claims that it will work with previous versions. The complete requirements are as follow:
- Perl 5.6.x or above (may work with earlier versions);
- Linux, Mac OS X and possibly others;
- DICOM.pm, the Perl module to read and write DICOM, either my version or Jonathan Harlap's will do.
If you wish to convert DICOM to MINC, you will need one of:
- Peter Neelin's dicom_to_minc and acr_nema tools;
- Jonathan Harlap's dicom3_to_minc (renamed to dicom_to_minc);
- The dcm2mnc program that ships with recent MINC distributions (I have not tried it.)
Usage
Usage:
dicomverter -m [ -o output_dir ] input_dir
dicomverter -s [ -o output_dir ] input_dir
Flags:
-m Convert to minc directly
-s Sort out the DICOM file and rename them
Etc.
Dicomverter was created to solve an annoying problem: Some PACS can generate CDs with nearly random names for every image files. Combined with dicom_to_minc's habit of choking when the files are not in reasonnable order, this can lead to some very frustrating times when dealing with hundreds of images.
By inspecting the DICOM images, their acquisition and their positions in the acquisition can be retrieved fairly easily. This is basically what dicomverter does, it parses the DICOM image files with DICOM.pm and then it makes copies of the files in the proper sub-directories. The copies are named <slice_number>.dcm where <slice_number> is a number from 1 to n.
Known Bugs
- The presence of a DICOMDIR file sometimes confuses dicomverter and it may use this file in the place of a valid image resulting in a blank slice;
- If DICOM.pm can't understand the DICOM files, the behaviour is undefined.
Comments
I appreciate any comments or suggestions relating to this tool. I can be reached at acv@miniguru.ca.
Download
You can find Dicomverter here.