I get asked, and am often in need myself, of sample DICOM files in various formats. By sample I mean no weird private tags and all of the identifying patient information has been removed. The files below are part of the collection I have built up over the years.

These files can be used to test applications you write using my PHP DICOM Class and can be opened in any image viewer, such as MicroDICOM.

Click on the thumbnail to get the DICOM file.

In this tutorial I’m going to post some example code and walk you through converting a DICOM multi-frame image (CINE Loop) into an mp4 video file. I chose MP4 because it works well with Apple and Microsoft products.

You’ll need ffmpeg installed with the ability to do x264. The ffmpeg site has many guides on how to do this. I used this guide for CentOS 6 for this tutorial.

You’ll need a copy of my PHP DICOM class installed.

You’ll need a copy of the example files.

Once you’ve got the prerequisites out of the way, run the commands below to download and run a copy of the example files.

wget http://www.deanvaughan.org/projects/multi-frame-to-mp4.tar.gz
tar zxvf multi-frame-to-mp4.tar.gz
cd Mutli-Frame_to_MP4/
./dcm2mp4.php sample.dcm

Your freshly created MP4 file is ./video_temp/sample.dcm.mp4, a copy is playing below:

Now take a look at dcm2mp4.php, it should be commented well enough to make it easy to understand what it is doing.