Introduction: Pumpkin PACS/Pumpkin Pi
The Pumpkin PACS was constructed for the MGH Radiology Pumpkin Decorating Contest. It is a standalone DICOM workstation capable of displaying many standard types of radiology images.
The pumpkin contains a Raspberry Pi which projects images onto a screen using a Microvision SHOWWX+ HDMI pico projector. The screen is made of tracing paper. The application displaying the images is Aeskulap http://aeskulap.nongnu.org/.
The steps below include details of how to install the radiology workstation software and get images to the device - but the basic mechanism could be used on any project where a Raspberry Pi is projecting a mirror image so that it appears correctly when it illuminates a screen from behind.
FDA warning: this device is not for clinical or culinary use. The screen isn't bright or sharp enough to meet the guidelines of the American College of Radiology. No strictly documented engineering process was followed nor any attempt was made to adhere to the good manufacturing process outlined in the FDA's 510(k) requirements. However - it is absurd and you're reading this so it might be of some interest.
[Added in edit: The images here belong to the patient (me, the author) are were not downloaded from the clinical servers at the hospital. It's my knee :-)]
PACS - Picture Archive and Communication System. This is what a radiology department typically uses to accept/store/display medical images.
DICOM - Digital Imaging and Communications in Medicine. This is a computer protocol for medical images. It is widely used in Radiology and Cardiology.
Step 1: Basic Hardware and Software Installation
- an SD card that is at least 8GB in size.
- a USB hub (that's the blue box in the picture). I'm using the TrendNet TU2-700.
a projector unit. I chose the Microvision SHOWWX+ HDMI projector:
- It's a laser projector - so focus wasn't a problem.
- It had generally good reviews and was compatible with the iPad 2's 30 pin connector - so I can use this for other projects.
- An HDMI micro-to-standard cable (the MicroVision SHOWWX+ has a micro-HDMI connector and the Raspberry Pi a standard connector)
- A USB mouse
- A USB keyboard (this is only really needed when you're configuring the device - I didn't need the keyboard when I was showing the pumpkin).
- A pumpkin.
- A small powerstrip (two outlets needed).
- You may want to have a standard HDMI monitor for doing the installation and configuration on the Pi. I found it easier to read than the projection unit.
- A ethernet connection (or you could install an 802.11 wireless). If you do install a wireless connection you may want to add another power source - I have power going to a USB hub and the Raspberry Pi is plugged into the hub.
Install your Raspberry Pi system onto an SD card that is at least 8GB in size.
- Download a Raspberry Pi image. I used the 2012-09-18-wheezy-raspbian one - I see that a newer one has been released. Install on your SD card. Follow the instructions on http://www.raspberrypi.org/downloads
- Expand your root partition http://raspberrypi.stackexchange.com/questions/499/how-can-i-resize-my-root-partition/946#946
- Insert the SD card into the Raspberry Pi; attach the keyboard, mouse, monitor, and plug it into your network.
There are several installations and updates which need to be applied to the Raspberry Pi
- Run sudo apt-get update to get the latest code.
- You need to install git: sudo apt-get install git-core
- You need to upgrade the firmware. A very nice utility for doing this is rpi-update: https://github.com/Hexxeh/rpi-update. Follow the instructions at this link; I did need to do the step where you install new certificates. If you don't update the firmware you the display can't be 'reflected' for display on a back projection screen.
Install a DICOM viewer
- sudo apt-get install aeskulap
- That's all :-). The program is under the graphics program menu.
Set the Pi to automatically log in, launch X-Windows and launch the Aeskulap program. This means that the user doesn't have to type anything - which means that you don't need a keyboard attached to the pumpkin later.
- Setting up the Pi to automatically log in and launch X-windows is described here: http://elinux.org/RPi_Debian_Auto_Login
To make Aeskulap load at boot time enter the following command to edit the autostart file:
sudo nano /etc/xdg/lxsession/LXDE/autostart
Add a line to launch aeskulap at start:
@lxpanel --profile LXDE
@pcmanfm --desktop --profile LXDE
@aeskulap --profile LXDE
Set up the display to be mirrored:
sudo nano /boot/config.txt
Then add the line
The config.txt file is attached to the instructable.
Step 2: Load DICOM Images Onto the Device
Aeskulap can do a DICOM CFIND over the network to retrieve images or it can read DICOM part 10 images from disk. Both work - it depends on what you want to do.
DICOM CSTORE SCU option
If you are going to be live on the network you need a server (a DICOM CSTORE SCP). I used an Osirix workstation running on my Mac. The only issue here was that the server connection dialog box in Aeskulap didn't fit on the screen so you couldn't enter all of the information. So - I temporarily modified /boot/config.txt to rotate the screen 270 degrees so that I could see the entire dialog box and enter the correct parameters (see the comments in the /boot/config.txt file).
This worked perfectly fine but I decided not to do this because
- I didn't believe that the hospital IT folks would be happy with me putting a pumpkin on their network.
- If the device was rebooted then I'd have to re-set up the network for DICOM (the DHCP address might have changed) and then fetch the images over again. I also didn't know what the network connectivity in the room.
Local DICOM storage option
Aeskulap can read in load in local files as well.
- In Osirix - I exported the studies of interest with a DICOMDIR file.
- I used Cyberduck https://itunes.apple.com/us/app/cyberduck/id409222199?mt=12 to send the files over SFTP. But any SFTP client will work if sshd is running on your Raspberry Pi.
- I copied the studies into a subfolder of the 'pi' home directory.
If you have a DICOM CD from a hospital you might be able to copy the entire directory over to the Pi. Make sure that you can find the DICOMDIR file. If this fie isn't present- the images may be in a proprietary format instead of in DICOM.
Then - in Aeskulap - open the DICOMDIR file and then select the study from the study browser. The images will be displayed on the monitor.
At this point the software part of the project is complete - you should be able to boot the Raspberry Pi and it will launch Aeskulap when it is completed. Use the mouse to load the DICOMDIR file and you're ready to display images.
Step 3: Carve the Pumpkin
The pumpkin should have one flat side for the screen. There was about 7" between the front and back of the pumpkin - this was long enough for the screen we were using. We started with the projector and moved a piece of paper back and forth until we got the size screen we wanted, then we selected the pumpkin.
The hole in the top should be big enough so that the Raspberry Pi and USB hub can be placed in the pumpkin.
I had to carve a hole in the back for the pico projector so that I could have more distance from the front of the projector to the screen.
You really want to scrape inside the pumpkin to get out the 'guts' so that it is relatively dry. I didn't want to see if the Raspberry Pi was amphibious.
Step 4: Insert Electronics Into Pumpkin
The inside of the pumpkin is damp. I put the Raspberry Pi into a case and then used the bottom of a plastic container to hold the Raspberry Pi and the USB hub. The projector was inserted into the back of the pumpkin to maximize the distance from the screen so that the image would be larger. Some plastic knives were used to hold this in place.
The screen was just placed into the hole at the front of the pumpkin - the hole had been cut so that the screen just rested there.
The micro-to-standard HDMI cable is used to connect the projector to the Pi. The USB hub is attached to the Pi with two cables - one for power and the other to the Pi's USB connector so you can plug in the mouse (and keyboard when you're editing configurations).
Step 5: Acknowlegements & Future Work
I ran into one large snag in this project with the Raspberry Pi. I could not figure out how to mirror the screen output so that it could be back-projected onto a screen. The standard Linux mechanism for doing this is to use the xrandr utility. However, the Raspberry Pi does not yet fully support xrandr.
I posted some questions on the Raspberry Pi forums. I knew that the bootloader could rotate the screen (by 90, 180, 270 degrees) but it could not reflect it. The bootloader is closed source so I couldn't modify the code.. but a suggestion was made that I contact Dom (Dom Cobley) to ask for reflection to be added as a feature. I sent him a request and he created two new bootloader options that same day:
display_rotate=0x10000 (like -x)
display_rotate=0x20000 (like -y)
If he hadn't done this I would have had to resort to using optics to mirror the image - which might have meant that the pumpkin wouldn't have been done in time for Halloween. I'm very grateful - thanks Dom!
I'm also very thankful for the Aeskulap DICOM viewer. I was sure that I would have to do a lot of DICOM hacking to get this to work on the Pi. I really wasn't expecting that a single command line would install a viewer that worked flawlessly. Just amazing.
The Raspberry Pi folks have made a wonderful gizmo and community. Without them I would have needed a much larger pumpkin.
And lastly - thanks to the MGH radiology department for having a pumpkin decorating contest that inspired all of this. It's a great place to work.
Display quality: The use of tracing paper as the projection screen did lower the quality of the display. Perhaps some frosted plastic or other fine-grained, thin layered material would work better.
This year's project was on the client side - perhaps a server-side one would use the heat output from servers to keep the pumpkins warm at night - a true server farm. But the Pi might not generate enough heat.
Perhaps using the GPIO ports with some type of motion detector could be used to change the images on the screen? Sort of a 'haunted PACS'?
Conductive strips on the outside of the pumpkin might enable a 'touch sensitive' UI. Didn't have time for this this year.