DICOM tools

DICOMperl (tgz) (deb)

2004.07.31 Updated DICOMperl library now skips sequence elements (DICOM value representation SQ) rather than die

2004.07.15 Updated DICOMperl library supports floating point elements (DICOM value representation FL/FD)

DICOM.pm is a Perl library that allows Perl programs to read the headers of medical image files conforming to DICOM standards.  It is written entirely in Perl, with no C components, in order to be as portable as possible.  Version 0.3 was written by Andrew Crabb and lives at http://dicomperl.sourceforge.net/ but unfortunately seems to no longer be maintained.  I have adapted it to be able to package it with MakeMaker, along with making some small modifications which will make it easier to update in the future.  Pending discussion with Andrew Crabb, I hope to maintain it in the future - I would like to release a version which can create new DICOM files, as opposed to the current release which can only write out modified versions of existing DICOM files.

Installation from the .tgz is the standard Perl install:

  1. perl Makefile.PL
  2. make
  3. make test
  4. (as root) make install

Known bugs:

dicom3_to_minc (source) (gz)

NEW 2005.01.16 Updated dicom3_to_minc now has a -separator option.

A new dicom to minc converter is now available for testing.  Note that the program name is dicom3_to_minc in order to avoid confusion with the old dicom_to_minc (derived from Peter Neelin's mri_to_minc converters).  The main difference between the two is that for dicom3_to_minc I have replaced the underlying DICOM implementation with the Perl-native DICOM module.  This frees you from the need to have Peter Neelin's Acr_nema library and associated tools, 'extract_acr_nema' and 'dump_acr_nema'.  The only requirements now are Perl 5 with Getopt::Tabular and File::Basename, both of which are available from CPAN, and the DICOM module, available above.

get_dicom_info (source) (gz)

A new version of get_dicom_info is also available.  It also uses Perl 5, Getopt::Tabular and the DICOM module (above), and so should now run on just about any platform with Perl 5.  The only difference from the old version is how the -attvalue option is handled: it now expects two arguments which are the group and element numbers, both in hexadecimal (without the leading 0x).  Thus, in order to get the Patient Name field you could either use `get_dicom_info -pname <file>` or  `get_dicom_info -attvalue 0010 0010 <file>`.

Old software

There is no documentation to speak of right now, but the requirements are:

get_dicom_info (Perl)

my_dicom_to_minc (Perl)

If you have been able to run dicom_to_minc, then you already have the accessory programs (extract, byte_swap, dump_acr_nema, extract-acr_nema) - if you don't then source (and perhaps some binaries) is available from http://www.bic.mni.mcgill.ca/~neelin/distrib/minc_converters/dicom/

my_dicom_to_minc is the same as the Peter Neelin distribution (to the best of my knowledge) except that it has a couple extra options - specifically '-stdin' which directs it to accept a list of dicom filenames via STDIN rather than as an argument list. I found this more useful than just doing `... | xargs dicom_to_minc ...` because of the dreaded "Arg list too long" error message.

get_dicom_info is simply a tool to retrieve a (tab separated) list of dicom fields from a set of dicom files. It is already aware of several dicom fields (the ones I found most frequently useful), which you can see by running `get_dicom_info -help`, but you can always manually specify other fields with the '-attvalue' option.