Skip to content

radiplab/dwv_simple

Repository files navigation

dwv-simple

Want to embed DICOM studies in online quizzes? This may be the answer for you. ivmartel developed the wonderful DWV (DICOM Web Viewer) and made it freely available on Github. I took a version of that viewer, and hacked it down and modified it to have the simple interface I wanted. The goal was to have something that basically just looked like an image on a quiz, but surprise, you could interact with it too. Here's an example. Multiple sequences are also supported. This is NOT a PACS and its limatations will be readily apparent. But it works pretty well for a narrow scope.

Here's how you control the viewer:

  • Right-click or double-tap and drag to window-level
  • Left-click and drag to zoom
  • Double-click to zoom on a specific area. Double-click again to reset.

Requirements

  • Web server with PHP capability

Getting Started

I use XAMPP for testing. You can install it, change your DocumentRoot directory to dwv_simple, start the server, and go to localhost on a browser to see it in action. For your convenience, I've included some anonymized DICOM in this repository so there will be a link to select called "Example CT Abdomens". You can see it in action.

The intention was for the case files to be relatively decoupled from the actual viewer. The viewer assumes the following folder structure:

  • Folders inside the "dicom" directory are separate studies.
  • .zip files within each study folder are separate sequences, and will be displayed as links in a top bar within the viewer. Any other file types are ignored.

The viewer takes the following URL arguments: (look at the URL generated by index.php to see an example)

  • casefolder (required): Name of the folder containing a case
  • sequence (optional): If there are multiple sequences in a folder but you only want to display one, provide the name of that sequence
  • message (optional): Will display a message along the top bar
  • begin_image_number (optional): Beginning image number
  • begin_window_width (optional): Beginning window width (otherwise the default is used)
  • begin_window_level (optional): Beginning window level
  • begin_zoom (optional): Beginning zoom level, zoomed to the center

Important high-level files include:

  • index.php: This will list all folders in the dicom folder with a link to see each in the DWV (dwv.php)
  • dwv.php: Wrapper around the modified DWV. This finds all .zip files in the directory specified in the URL and lists those as individual sequences in a top bar.
  • viewer.php: Modified DWV, embedded by the above dwv.php.

Working with DICOM

If you want to start creating your own cases, check out my dicom_utils page for Python methods that make it easier to work with DICOM. There are methods to anonymize DICOM and compress it into a zipfile. It applies the maximum possible compression to still be readable by DWV, so you can make your files as small as possible. There is also a discussion on that repository about my image processing setup.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published