Imaging as a service: Two significant web-based browsers

From two major academic centres come a pair of web browser-native medical image viewers that are leading the way to web-based imaging.

BrainBrowser

brainbrowser_3 _250BrainBrowser comes from the neuroscience department at McGill University, well-known for their neuroimaging tools and the MINC file format.  BrainBrowser is distributed as a Javascript library that is installed on a web server, and uses familiar Web technologies such as HTML5, CSS, JavaScript and WebGL to provide 3D surface and volume rendering of neuroimage data sets within your browser.  Data can come from the server, or BrainBrowser can read local data sets, in which case no information leaves your computer.

The project comprises two components. VolumeViewer can perform slice-by-slice display of volumetric data, which currently must be in the MINC format.  It can display multiple volumes through time (an important feature for functional neuroimaging) and renders a multiplanar view of the data volume.  SurfaceViewer loads surface datasets such as generated by FreeSurfer or MNI software, and has many of the features you’d expect from an installed application – only you don’t need to install it.  Both of these applications have an extensible plug-in architecture so can be expanded to other file formats.

The fully-documented source code is available at GitHub, and several presentations demonstrate the architecture and technologies used in the project.  You can approach this software at several levels.  Run from the project’s servers, BrainBrowser can act as a Web Service, rendering your local data within your browser, no data transfer occurs in either direction.  For a locally-hosted and customizable installation, download the source code and install it on a local server.

BrainBrowser is a serious application from a major university.  While the demos appeal to everyone, the advanced features of this specialized software will be of particular benefit to researchers in the brain imaging field.

Slice:Drop

slicedrop_slicedrop_github_comSliceDrop makes imaging about as simple as it can be: drag and drop some image files on your browser, and they are rendered on the spot.  Impatient?  Download these MRI files and drop them on the SliceDrop window from the link above.  There’s more to the application than this, of course, but it demonstrates how easy it can be.  There are other pre-packaged demos on the project’s home page.

SliceDrop comes from Boston Children’s Hospital, and it’s built on their X Toolkit, which is a heavy-hitting scientific visualisation application using WebGL for 2D and 3D rendering in browser-based JavaScript apps.  Xtk reads a wide variety of file formats for volumetric, mesh, and fibre data, and SliceDrop inherits this ability.  Being web-native means that SliceDrop will run on a portable OS, though given the lack of a local file system, it will require data to be downloaded rather than loaded locally.

The technologies behind SliceDrop include WebGL, HTML5 Canvas, and JavaScript.  If you’re a developer, source code can be forked from GitHub.

BrainBrowser and SliceDrop are terrific examples of what is capable with standard web technologies.  Either of these applications can have you viewing images in less than a minute, no software required.  For many needs, web-based imaging is the way forward.

Live demos in your browser

A new page devoted to live demonstrations of web-based viewers is here:

http://idoimaging.com/demo/

 As medical imaging moves to the Web, there will be ever more programs available to try immediately in your browser, with no installation required.  We’ll bring them to you through our Live Demo page.

A variety of technologies are used to bring imaging into the browser; the demonstration programs include use of JavaScript, HTML5, WebGL, and Java Web Start.  All the demo programs originate from a server and are displayed in your browser, but the data can take different paths.  Sometimes the images are transferred to you as original DICOM files, sometimes as image files (in JPG or another format), sometimes all the data stays within your computer, and yet other times the rendering is done remotely and the original image files never leave the server.  Web-based imaging is a new and rapidly-changing technology, there’s going to be much more development in this field.

DICOM de-identification: More than meets the eye

De-identifying medical image files is usually harder than it first seems.  There is patient data to think about: that seems obvious.  But if you remove all identifying data (that’s true anonymisation), you have lost your primary means of finding a study.  So perhaps what you want is pseudonymisation – replacing the primary patient identifier with a pseudonum, or code.  But patient information can be scattered throughout a DICOM file, and some manufacturers even store it in private fields in the header.  OK, you say, remove the private fields.  But that can break some proprietary software that relies on those fields…sometimes, but not always.

Then there are less-obvious fields.  The names of staff, the institution, the scanner serial number, and many more fields, all can be used to identify the scan, and through that, the patient.  Dates and times are a particularly good way to identify a scan, but may be essential information for calculating drug or radioisotope decay, or the interval between scans.  So these may need to be changed, but the relative interval between them retained.

This is a complex issue for which is no single answer.  There are several publications available that discuss the matter in detail (this summary from David Clunie is a good introduction).  The amount of editing required is a function of the amount of information initially present, the intended (or unintended) recipient of the data, and the desired level of identification.  What is needed is a set of tools that are powerful enough to perform the task, yet flexible enough to be configured for the particular application.

Here at I Do Imaging World HQ, we are publishing sample data for public use, so it is heavily anonymised.  We use a combination of tools when de-identifying DICOM data:

  1. A tool to examine the headers, so we know what we are dealing with.
  2. A dedicated de-identification program for the bulk of the work.
  3. Something to compare the before- and after- images, so we know what’s changed.
  4. An element-by-element editor to modify individual fields, or remove those missed by the anonymiser.

Here is just one example of the software available to perform each of these steps, chosen for their quality and for the fact they’re all Java-based, so will run on any desktop OS.  We’ll look at DicomBrowser for steps 1 and 4 (viewing the headers and editing individual elements), DicomCleaner for the heavy work of de-idenfication, and Loni Inspector for the side-by-side comparison.

Viewing and editing: DicomBrowser

DicomBrowser (home page) comes from the Neuroinformatics Research Group at Washington University, the home of XNAT, the powerhouse open-source platform for neuroimaging research and processing.  This is a program that does more than it promises: it can edit as well as view the headers of entire DICOM studies, it can send to a PACS node, and it has an advanced scripting language (shared with other software from the same group) for power users.  It’s distributed with native installers for the three desktop platforms, and has comprehensive documentation available including an academic publication that cover its abilities in detail.

The easy way to run DicomBrowser is through its GUI (though it also can be run from the command line,  allowing the input files to be specified in advance rather than hunting through the GUI).  Point it at a directory containing any number of studies and DICOM files, and it will parse the contents and present a collated view in an hierarchical view of patient – study – series – instance.  Header elements that have a single value at a particular level are presented as such: the patient details, for example, are constant throughout all instances and can be edited at the highest (patient) level by clicking on the value field.  Several actions are available for the element value: Clear (keeping the element), Delete (removing the element), or Assign (store a new value).  Entirely new elements can also be created.

Where an element has multiple values at a given level (say a multi-series scan viewed at the study level), the number of discrete values is displayed, and clicking on the values field presents a dialog box with a drop-down selector for the value to edit.  Viewing the element at a lower level will reduce the field to a single value.

DicomBrowser_3DicomBrowser can be scripted, for power users.  Anonymisation scripts are written in DicomEdit, a custom language shared with XNAT, that has many of the features needed by programmers, including variables, constraints, conditional operators, and string operations.  The language also includes the ability to call a web service URL and include the returned value in a constructed element value.  Specific to DICOM editing is a UID generator to create DICOM UIDs that are unrelated to the original values, yet consistent across a DICOM series.  Taking it a level higher, batch processing is provided through a companion program,  DicomRemap, which uses XML files to provide per-element custom editing.  This is a nontrivial task, but such is the nature of DICOM editing, and if you need it, the functionality is there, though with one caveat: DicomBrowser does not handle Dicom Sequences, an advanced feature of the DICOM standard.

Bulk anonymisation: DicomCleaner

DicomCleaner (home page) comes from PixelMed’s David Clunie, a major figure in the DICOM world and publisher of the Medical Image Format FAQ.  DicomCleaner is a power tool for anonymising or ‘cleaning’ large quantities of DICOM data, and as expected coming from the DICOM authority, is rigorous in its adherence to the standard.

DicomCleaner’s approach to the complex problem of editing hundreds of header elements  is to define blocks of elements to be removed or edited, providing multiple levels of anonymisation that reach deeply into the DICOM structure while keeping the user interactions to a manageable level.  The program is particularly strong at maintaining the relationships between essential structures such as UIDS, and the temporal relationships between dates and times are preserved.  DicomCleaner can also handle DICOM sequences, and can add the standard-specified information block describing the alterations performed on the files during process.

dicomcleaner_3

The depth of editing is apparent upon comparison of the original and cleaned files: at the highest level the great majority of the header elements are removed or modified.  Lighter editing can retain some fields, such as series descriptions.  For annotations contained within the pixel data, the program provides an editor to specify regions of the image to be blacked out.  Image data can come from and be saved to local files, or a network PACS connection.  This is a program that does a lot of heavy work with minimal user input, so a thorough reading of the documentation helps to understand the work being done.

Comparing DICOM images: LONI Inspector

Verifying the anonymisation process is aided by viewing the results.  Given that a single DICOM image may contain over 300 fields, checking a complete list of values can be overwhelming.  Seeing which fields have been edited can help make the reviewing task a lot easier.

LONI Inspector (home page) is designed for this job.  In addition to DICOM, this program can read and compare the headers of AFNI, ANALYZE, ECAT, GE, Interfile, MINC, and NIFTI files. Filters help to locate and display values of interest, and when comparing multiple files, the differences can be highlighted, shown in isolation, or excluded.  The header data may be exported as CSV or XML files for inclusion in other programs.

loniinspector_0

Summary

Editing and anonymising image files, particularly DICOM, is a big job.  If you’re performing the same editing, especially on familiar data, a single program may be sufficient.  But for complex or new data, or for developing a process, a balance between usability and thoroughness means that more than one program might be needed.  To prepare the heavily-anonymised sample data for the I Do Imaging PACS, the three programs above were used in sequence:

  • DicomCleaner does the bulk of the anonymisation, but care must be taken not to remove required values.  In our case, the series descriptions were retained, but most other editing blocks were performed.
  • LONI Inspector was then run on the before-and-after images, to highlight fields with identifying information that might have been missed or are to be edited.
  • DicomBrowser is used both in its viewing and editing modes.  The final editing was performed here, with several comparison iterations using Inspector.  If a large amount of similar data were being processed, we could have developed a custom script to perform these operations, but with only a few data sets required, the GUI approach was sufficient.

These three programs are all written in Java.  This means they will run on any platform, but there is the additional step of installing Java itself, and keeping up with its numerous (and intrusive, and sometimes problem-causing) updates.  You’ll also be reminded when you start the applications that Java is slow, at least when the program is loading.  These minor issues are the current price of cross-platform compatibility.

Anonymisation, done right, is not an easy task, and there’s a limit to how simple it can be made.  But with these three professional tools, it’s possible for anyone to perform customised standards-compliant editing with the minimum effort.  The hard work has already been done for you.

 

Imaging in the palm of your hand: Phone-based DICOM viewers

Here are two really capable DICOM viewers, iOviyam and DWV, either of which can probably run on the phone you’re carrying right now, with no installs or software downloads.  They’re both up and live on our demo server (skip to the end of each review if you’re impatient to try them).

Both these programs let a standard smartphone query a PACS, and display the images that are retrieved.  How on earth does a cell phone handle the complexity of the heavyweight DICOM protocol?  It doesn’t.  As far as the phone is aware, it’s talking to a web server, which just happens to be serving medical-looking images.  These two programs both are deployed as a module within the industry-leading DCM4CHEE PACS server, and in fact installing each involves copying only one or two files, if you have such an installation running (no trivial task, but our wiki notes might help).

So for most people, this is imaging as a web service: something you connect to using whatever device is handy.  It provides a convenient mobile phone interface to a PACS, allowing querying by patient details and dates.  The DICOM images are retrieved from the PACS by the server module, then converted to standard web-technology images and sent to any HTML5-capable browser (anything from the last few years).  Your phone never knows it’s talking to a PACS.


iOviyam

IMG_3893
iOviyam2
 doesn’t take much longer to launch than it does to say.  It is the smartphone/tablet companion to the HTML5-based Oviyam2, and comes from the same productive team at Raster Images.  It’s a highly capable 2D viewer, with many of the features you’d look for in a desktop viewer.  Security is provided by the hosting PACS, so you need an account to connect to the server and view images.  Once logged in, there’s a nicely mobile-optimized search window, leading on to the image viewer. There are technical notes online in the dcm4che.org forum, which go in to more detail about the back-end architecture of the server module (there’s nothing at the client end).  iOviyam can use the web-oriented WADO protocol to talk to the PACS server, but can also act as a standard PACS client, and is configured into the server as such.  But the user is protected from all this, and just needs a login.

Try it right now!  The link below will route to iOviyam2 if you’re on a mobile device, and to the desktop-browser version of Oviyam2 if you’re on a computer.  You’ll need a login: it’s guest and the password is guest.  Easy.

Click here to launch the iOviyam viewer.


DWV – DICOM Web Viewer

DWV on iPhone

DWV is a new HTML image viewer from Yves Martelli.  It’s implemented in Javascript and HTML5, so it too will run on anything with a modern web browser.  It is deployed from a growing list of PACS servers, including ConQuest, DCM4CHEE, and the innovative up-and-comer, Orthanc.  DWV is launched from within the PACS search interface, rather than having its own search functionality as with iOviyam, and it can also be launched directly from a URL (the program’s website has some examples of this, as does our wiki entry for DWV).

The browser itself has the now-familiar subset of functions for the limited space available on a mobile device screen: pan, zoom, scroll, windowing and colour mapping.  DWV also offers a limited range of image filters, and the display of DICOM header values with real-time searching.  That’s a lot of functionality to fit into a small screen.

DWV is installed on our PACS server, and there are two ways of accessing it.  The first is to log in to the DCM4CHEE PACS server (username guest, password guest), and click ‘Search’ with all search fields empty (don’t worry about the warning, there are very few images to search).  Then, click the ‘eye’ icon to open the web viewer.  You can then choose between the installed web viewers (currently, DWV and Weasis).  Click on DWV, and you’ll get a new tab with the image volume loading.

dwv_in_dcm4chee_0

dwv_in_dcm4chee_1
                                       
The second way to open the DWV demo is just to click on one of the link images below.  Simpler, but less choice.


Click the images below to launch the DWV image viewer in your browser

1040_cardiac_mr_2d_150

Knee axial MR 23 sl

1010_04_ax_2d_0
                     
DWV’s chief developer is an imaging software professional and has provided all the resources that power users and developers would look for.  Source code is available at the project’s GitHub repository, along with extensive documentation of the code and the technical aspects of DICOM integration.  There’s a comprehensive wiki and a complete description of the development environment.  Yves has generously released this project under the GNU GPL and welcomes collaborators.  This would be an excellent opportunity to get involved in a cutting-edge imaging project that already has a solid background and a working product.

Web DICOM viewers are still a new technology, but one that is  evolving rapidly.  As we move from ‘computers’ to ‘devices’, the advantages of a zero-install workstation are so numerous and compelling that it seems clear that, for many needs, this is the immediate future of imaging.

ORS Viewer – the first FDA-approved free clinical workstation

ORSVisualSI_bug_largeFrom Object Research Systems in Monteal comes ORS Viewer Lite, a slightly reduced version of their flagship medical imaging workstation.  This is a serious workstation from a commercial company, and is the first free imaging workstation to be approved by the US FDA, Health Canada, and CE Mark – a significant step forward in free medical imaging software.  Gaining these approvals is a lengthy and expensive project, and Object Research Systems should be applauded for releasing this high-level workstation to the free  software movement.  Naturally, they support themselves by selling and supporting the full version of this program, which includes 3D reconstruction, volume rendering, endoscopy, and advanced modality-specific plugins.  But the Lite version lacks only these advanced features, it is not restricted in any way (though you’ll have to buy the full version to do the cool 3D beetle rendering).

As a 2D workstation, ORS Visual Lite has plenty of capabilities and can handle multiple sequences with image fusion and linked cursors.  The configuration options are particularly extensive, and include advanced features such as customisable key shortcuts for many functions, and saveable custom anonymization rule groups.  The program is fully PACS-capable, adding remote nodes is straightforward, as is query/retrieve, and send.  Processed scans can be exported to a removable media or remote PACS destination.  The clinical emphasis of this application is apparent with its support of user accounts and login, MPR and MIP views, text and graphical annotations, and DICOM print and report.

ORS Visual Lite is an excellent product, and its release is a good day for the free software community.  In a crowded PACS workstation marketplace, Object Research Systems deserve to be rewarded for being the first to make this bold step.

Web-based DICOM viewers – read about them, try them!

Medical imaging is a leader in the trend of applications moving to the browser. Browser-based imaging applications use a variety of web technologies, both new (such as HTML5, just a few years old) and longer-established (Java, which has been around since the mid 90s). The availability of new web technologies and  high-level development tools has made it increasingly easy to build and deploy web apps that can approach the power and versatility of installed applications, with little or no client preparation required. Here, we’ll look at two image viewers affiliated with the dcm4che project, and deployed on top of the DCM4CHEE server, that take different approaches to getting images from the confines of a complex PACS server, and into a common web browser.

Weasis

Weasis is a Java Web Start application developed by Nicolas Roduit. Java Web Start comes as part of the free Java Runtime Environment that most personal computers have installed. It is activated when a JNLP file is downloaded in your browser (usually by clicking on a link), and it downloads and installs the Java application linked to this file. The application is stored on the computer, so subsequent launches can omit the download step unless the application is out of date. One of the key terms here is ‘computer’ – downloaded Java apps can’t be run on tablets (Android or iOS) for legal and technical reasons. JWS traces its history to around 2002 and accordingly, is built around computers rather than portable devices.

Weasis does not require any preparation by the user beyond the presence of Java. It’s deployed as part of a PACS installation, primarily the widely-used open source DCM4CHEE. Communications between Weasis and the PACS server is by means of  WADO, a DICOM standard designed to facilitate image viewing over the Web. The installation of Weasis on the server is not difficult, but does depend upon a rather complex PACS server, so we’ll concentrate on the viewer itself.

Clicking on a Weasis launch icon downloads the JNLP file.  The downloaded application may start automatically, but increasingly, this association is disabled for security reasons, so the downloaded file must be located and clicked to start the application (see the wiki notes).  Also, running the application for the first time will present a series of popup windows to authorise the application (a familiar part of life with Java applications).

Weasis launches as an application independent of the web browser and in fact from this point may subsequently be run as an installed program. Data comes along with the download or may be read from disk like any other imaging application. It’s a fairly standard 2D image viewer with no reslicing or volume rendering, but it runs quickly and provides comprehensive controls for adjusting brightness, contrast, scale, and colour map. There are tools for measuring distances and areas, and multiple studies can be displayed in a split screen. Weasis doesn’t provide all the functionality of a heavier viewer, but from a correctly-configured site, you can be viewing images within a minute of clicking a link, no installation required.

Try it out!  Click on one of the images below to download Weasis along with the data set.  The second and subsequent downloads are faster, as they don’t have to download the viewer.

1010_06_ax_2d_1_150

1010_02_ax_2d_0_150

1030_knee_mr_2d_150

1040_cardiac_mr_2d_150

There are other links to images and the Weasis viewer from the Sample Data page on our technical wiki.

There are extensive installation notes on the dcm4che site, which also has an active forum.  If you’d like to install Weasis on an image server, take advantage of I Do Imaging’s wiki notes, based upon the experience of installing this software several times on different platforms. They may save you hours of work.

Oviyam

Here’s another approach to browser-based viewing. Oviyam is entirely developed in HTML5, a modern Web technology that greatly enhances the capabilities of a web browser. In this approach, Oviyam is installed as a component of a PACS server and performs all the DICOM communications within the server, to which Oviyam appears as a standard PACS node. On the network side of the image server, Oviyam acts similarly to web server, sending image data to the browser in standard web formats. So a modern HTML5-capable browser can display the images without requiring any DICOM or PACS functionality.

Installing Oviyam, then, is strictly a server-side operation. And on a properly-configured DCM4CHee installation, it’s as simple as copying a .war file into the server’s directory structure. The client then visits a web location (port 8080, the default port of the JBoss framework underlying DCM4CHEE), and never knows it’s accessing a PACS. Oviyam provides all the basic functionality of a 2D browser, with no installation of any kind on the client end. It even works on portable devices: iOviyam provides pure HTML5 to a compatible web browser.

Try it out! Oviyam2 is installed on our public PACS server. Login is ‘guest’ with the password ‘guest’.  Click on the ‘idoimaging’ tab, then on ‘Sample Data’ at the top (or just ‘Search’), to bring up a list of studies.

Click here…
oviyam_data_annotated
…to get this.
oviyam_viewer

MRIdb: Image management, in a virtual machine

MRIdb is an interesting new application for storing and managing images, from Imperial College London. Building upon the stalwart dcm4chee image store, it combines the functionality of a PACS with study-level management and access control, administered through a web interface. Also bundled is the PostgreSQL database for storing images and open source applications for viewing and converting images. MRIdb itself is the Java-based management application, and is the primary means of interaction with the system. Through this interface you log in (authentication with LDAP is supported), view or download images, and manage related images by grouping them into projects.

One unique aspect of this project is its optional deployment as a preconfigured virtual machine. This is a single downloaded file which is run within the VirtualBox application, a free application from Oracle that runs on any platform.
Oracle_VM_VirtualBox_Manager The virtual machine contains an entire CentOS Linux operating system, and all the MRIdb components, all configured and already running. Once started, the virtual machine (which in this case has the IP address 10.0.1.7) is accessible in a number of ways.

Firstly, the MRIdb application is accessed by browser through the default HTTP port of the VM. Here’s where you can create projects and associate them with individual scans, a convenient means of managing large numbers of studies, and a useful research-oriented feature not provided by traditional clinical PACS systems.
Features found in most PACS clients, such as search by various fields, are also available. Image viewing is provided in two ways, by launching an instance of the ImageJ viewer, or through the in-browser Weasis viewer.
mridb_study

Then, to communicate with MRIdb using DICOM standard protocols, the dcm4chee instance provides full PACS functionality. This is accessed using standard DICOM tools, such as a network-capable image viewer, another PACS, or any DICOM-compliant tools. For security, the default dcm4chee instance requires that remote AE titles be configured in order to send or receive studies. The server uses the standard port 11112 and AE Title ‘DCM4CHEE’, as shown in this example of sending an image to the store:

$ dcmsnd -L DCM4CHE  DCM4CHEE@10.0.1.7:11112 IM-0001-0100.dcm

Alternatively, the dcm4chee instance has its own web interface, running on its standard port of 8080. Through this you can search the PACS directly, and configure your remote AE entities. It’s a pretty dense interface, but this is a commercial grade application.
mridb_dcm4chee

Finally, you can SSH into the virtual machine itself. Always a kick to find another machine running within your computer. Log in to it, and you have a full Linux environment to explore the MRIdb components, which start running when the VM is initialized.
mridb_virtualbox

In this test, the virtual machine launched quickly and with no intervention required, consuming less than 1 GB of memory including the VirtualBox overhead. Routine tasks can be accomplished through the MRIdb browser interface, though steps specific to dcm4chee require a visit to its separate interface. Deploying from source code was less successful: as is common with complex Linux installations, there are many platform-dependent details that can trip up the installation and configuration scripts. Perhaps due to the deviation from CentOS as the test platform (Debian and Open SUSE were available), the packages did not install automatically. This is par for the course with complex multi-package installations and most people familiar enough with Linux to attempt the source-based path would be able to resolve the incompatibilities. The final stumbles were encountered when launching the in-browser viewers, and were caused not by the application, but by the delightful Java version/security/update maze we all love to navigate.
java_warnings
MRIdb is built on a good number of solid free and open-source projects. The imaging tasks are performed by some old friends: from dcm4che.org come the dcm4chee image server, dcm4che2 toolkit and Weasis web viewer, there is the DCMTK DICOM toolkit from OFFIS, and Erik Nolf’s XMedCon for image format conversion. Other projectss provide the non image-related infrastructure: (VirtualBox virtualization, PostgreSQL database, JBoss application server, Play web framework).

MRIdb is a useful program for those managing imaging studies. As supplied, it runs with just a few clicks, and has full control for those wishing to get more involved in the technical details. The implementation as a fully-configured virtual machine makes this of particular interest for those who’ve never run their own image store. Give it a try: in five minutes you can be sending images to and from your very own PACS!

Orthanc: A different approach to a PACS

Orthanc is an interesting new program from Sébastien Jodogne, at the CHU de Liège, in Belgium.  Described as ‘An open-source, lightweight, RESTful DICOM server’, it’s a fully self-contained mini PACS that you can download and run immediately.  It’s provided in source code form, and as pre-compiled Windows and Linux (Debian and Fedora) binaries. The database for storing images (SQLite) is built in to the application and is easily configured.

There are several ways you can talk to Orthanc: as a DICOM server, as a web server, and through its API. Download it and fire it up, and you have a DICOM server capable of sending and receiving images using the standard DICOM protocol. Command line tools like those supplied by DCMTK are ideal for this, as are any of the PACS-capable graphical programs. Additionally, it has Orthanc Explorer, a built-in web server (or you can run it behind an Apache server) for administration and showing image previews. This gives a nice responsive web interface to the program, including drag-and-drop DICOM image upload. By default its HTTP server is on port 8042, while port 4242 is the DICOM server using the AE Title ‘ORTHANC’, all of which are configurable.

What really sets this program apart is its ‘RESTful API’, a means of connecting with the image server by using standard web protocols and tools.  This allows Orthanc to be accessed through Web connections from anywhere, and without regard to the platform or language used in the originating program. REST APIs are characterised in part by the use of URIs to locate and access resources, which in this case include patients, studies, and images.  Orthanc returns textual data in the form of JSON files, a widely-used lightweight file format, while images are returned in the web-standard PNG format.  These technologies are familiar to many developers, and are more approachable than tackling the full DICOM networking protocol.

Here’s an example (many more are given in the Orthanc Cookbook) of accessing studies through their URL.  I have a couple of studies for one patient stored in my Orthanc instance, and I want to locate images by running through the DICOM levels of Patient – Study – Series – Instance. Orthanc is listening on port 8042 and a full list of the patients in the database is obtained from appending ‘/patients’ to the URL:

$ curl http://10.211.55.5:8042/patients
[
    "3d4f2bf0-7dc1be38-b20cd6e4-6949a107-1f9d0e3d",
]

Appending the patient identifier returns the details for this patient:

$ curl http://10.211.55.5:8042/patients/3d4f2bf0-7dc1be38-b20cd6e4-6949a107-1f9d0e3d
{
   "ID" : "3d4f2bf0-7dc1be38-b20cd6e4-6949a107-1f9d0e3d",
   "IsStable" : true,
   "MainDicomTags" : {
      "PatientBirthDate" : "19601212",
      "PatientID" : "111111",
      "PatientName" : "TEST^ANDREW",
      "PatientSex" : "M"
   },
   "Studies" : [ "e0095cd5-4853bd92-a6fd3e4f-58e268c8-aaecda1f" ],
   "Type" : "Patient"
}

In a similar way, the studies and series details can be obtained. Each series returns a list of its instances (images), and the details of each of these can be retrieved as a JSON file:

$ curl http://10.211.55.5:8042/instances/9a9340a3-a75a602c-dd0d31cc-e31aead6-3221e5a6
{
   "FileSize" : 527066,
   "FileUuid" : "4a36faf7-ea88-41ed-818b-0bc022af3aa6",
   "ID" : "9a9340a3-a75a602c-dd0d31cc-e31aead6-3221e5a6",
   "IndexInSeries" : 133,
   "MainDicomTags" : {
      "AcquisitionNumber" : "2",
      "InstanceCreationDate" : "20090301",
      "InstanceCreationTime" : "132333.000000",
      "InstanceNumber" : "133",
      "SOPInstanceUID" : "1.3.12.2.1567.5.1.4.58467.30000009093612423759300028019"
   },
   "ParentSeries" : "10edbf63-a3212315-d923c8aa-ca95db38-684ffec9",
   "Type" : "Instance"
}

At the instance level, the image itself can be retrieved as a PNG file by appending ‘/file’ to the instance’s URL. Instance details are available as a list of tag-value pairs (‘/tags’), or just as the value of an individual tag (‘/content/0008-0060′ returns the modality).

Functions such as anonymizing or altering the instance headers can also be accessed through standard REST calls. Here are a couple of the supplied examples (the URI has been shortened for clarity). In the second example, an entire series is edited, resulting in the creation of a new series within the Orthanc store. A JSON message is returned with the location of the new series containing the edited information.

curl http://localhost:8042/instances/42b4724a/anonymize -X POST -d '{}' > Anonymized.dcm
curl http://localhost:8042/series/5254f9ce/modify -X POST -d '{"Replace":{"InstitutionName":"My own clinic"}}'

Issuing commands at the command line is useful for design, debugging and experimental work, but the real power of this approach comes from driving the commands from a scripting language. Python examples are supplied for some sample applications such as uploading and downloading images, which can be done in a few lines of code. Here’s the basics of the Python sample script to download an copy of all anonymized studies, where the ‘RestToolbox’ methods are short functions that do what they say.

URL = 'http://localhost:8042'
for patient in RestToolbox.DoGet('%s/patients' % URL):
    infos = RestToolbox.DoGet('%s/patients/%s' % (URL, patient))
    name = infos['MainDicomTags']['PatientName'].lower()
    if name.startswith('anonymized'):
        zipContent = RestToolbox.DoGet('%s/patients/%s/archive' % (URL, patient))
        f = open(os.path.join('/tmp', name + '.zip'), 'wb')
        f.write(zipContent)
        f.close()

Short and readable, and all the DICOM stuff is done by the Orthanc server, allowing you to concentrate on the functionality. There are other example programs in C++ showing how to use the library by itself or with the VTK toolkit for image display.

Orthanc lives in two worlds.  On the one hand, it supports the traditional DICOM transport protocol, and can communicate with standard networked DICOM programs. But while the DICOM standard has been around for decades, Orthanc comes from the modern and rapidly-changing era of web services, and its developers have adopted a number of web technologies to medical image transport. Maybe if DICOM transport is like email, Orthanc’s REST API is like Twitter: it’s fast and light, and gets the essentials of the message across.  It can’t do everything its heavyweight predecessor can do, but it does it more simply.

Orthanc is an interesting and novel imaging application, and is well worth the time taken to download and explore its capabilities.

Neuro Debian: An Impression

I’ve seen a lot of imaging software packaged for the Debian Linux distribution, so I decided to set up a machine to try it out.  Debian is a popular choice for scientific software, known for its stability and the massive library of pre-built packages available for easy installation through its package management system.

Neuro Debian is a six year old project to make high quality software readily available to researchers everywhere (a full description is found in this recent publication by the principal authors).  It places strong emphasis on the correctness and interoperability of the software packages, resulting in applications that install automatically and produce reproducible results.  In practice, it’s employed as a supplementary repository for specialist software packages, that integrates completely into Debian’s existing package manager. There’s the promise of entire compatible software systems to be installed in a few clicks.  Let’s see how it fares.

Downloading Debian was straightforward.  There are a variety of installation techniques – live network installation, DVD and CD images to download and burn, torrents, and live test images to try the OS from a disc or stick.  I made up a Parallels partition on my Mac for the new virtual machine, giving it 2 GB RAM and 2 cores, and installed directly from the minimal 440 MB image I’d downloaded.  Been a while since I saw an installation that small, but I’m sure the packages will be much larger.  I enjoyed the old-timey non GUI installation screen, once upon a time we called this a ‘user interface’, now it’s coming back into fashion like an 8-bit video game.

It’s also been a while since I saw an OS start and stop as quickly as a stripped-down Debian installation.  We get so used to Mac OS and Windows loading…and loading…all sorts of essential something.  Debian gets to the point, and does it in a few seconds.

I started the Software Centre to see what imaging software is available right out of the box. Cool!  Searching for ‘DICOM’ shows several alternatives.

I installed both and had to hunt through the menus to find them filed under ‘Graphics’, which is fair enough, I suppose.  Some of the other programs I later installed made it on to the ‘Science’ menu.

Configuring Debian to use the Neuro Debian repository is a simple case of copying two commands into a terminal window, adding ‘NeuroDebian’ as a source in the package manager.  The installations proceeded very quickly, and although not every package is available for each OS variant on every software repository, there’s a very wide range of software available.
For the OS I’m running (Debian 6), there were over 110 applications and libraries available in the ‘Imaging’ category alone.

The other category I was particularly interested in was Imaging Development, and as you may expect it’s pretty technical.  Lots here for the software developer.  Exploring the other categories is left as an exercise for the reader (it’s not called “I Do Psychophysics”).

Installed software has a short summary in the package manager.  Running the programs again reminded me of just how quick computers can be when you strip away the extraneous extras.  The applications jumped onto the screen and were ready within a second.  This particularly reinforced the advantage of having a dedicated system – even one running as a virtual machine, as here – over running imaging software on your regular desktop computer.  Fewer distractions, too.

Overall, I was highly impressed.  A new user could download and install an entire operating system, plus imaging applications, and be up and working within half an hour.  Some experience with Linux software is of course useful, and some of these applications would also benefit from some command line experience.  But since the software is downloaded and installed as binary executables, with all dependencies handled, there’s no chance of it not compiling correctly.  Neuro Debian bills itself as the “Ultimate platform for neuroscience” and I think they have a case.  Great packages that install themselves and work out of the box: this is free software done right.

 

 

 

New Releases: October 2012

Let’s have a quick look at some of the software projects that have recently released new versions.

Mango is a do-it-all program from the Research Imaging Institute at the University of Texas.  It’s easy to use for beginners, but offers great powers to advanced users, particularly those in the brain sciences.  It’s written in Java so it runs on any OS, and comes with platform-specific installers.  It has developer tools available, and a range of useful plugin modules. And let’s not forget the variant that displays DICOM images on a browser (webMango) and the iPad app, iMango (though it’s not free software).

For introductory users, it can quickly let you view images in DICOM or a half-dozen other formats.  But there’s a lot more functionality built in to the program, and with its  plugin architecture, it can be expanded to perform a very wide range of tasks.  While suitable for general purpose image viewing and analysis, there’s an emphasis on neuro imaging including support for file formats specific for that field: AFNI, NIFTI (use the Search page of this site and you’ll find 9 programs that support the former and 20 for the latter), also FSL and BrainVisa (which we’ve not yet got around to categorizing, ahem).

Advanced users will find useful features including a comprehensive package of ROI operations, image co-registration and overlays, statistical analysis, and image processing.  Plugins providing advanced neuro analysis tools and support for additional file formats are installed as needed from a library modules offered from the Mango site: adding and running these is straight-forward.  For programmers, there’s good support.  A package of developer tools can be downloaded and the API for developing plugins is well-documented.

Mango is a thriving project with much to offer everyone from the casual user to neuroscientist.

Nanodicom is one for the programmers.  It’s a PHP toolkit for reading and manipulating DICOM files (no flashy screen caps here sorry).    It’s one of very few (n=1) DICOM projects written entirely in PHP and is optimised for speed and a small memory footprint.  There’s a core class providing functions to read and modify the file header, as well as operations upon the pixel data.  Several ready-made sample applications are useful in their own right as well as providing reference implementations: there are programs provided for dumping, modifying or anonymizing the file header.

The package is well-supported, with extensive documentation, example programs, sample data, and a comprehensive test suite provided.  Since it’s hosted on GitHub, it’s available for developers to download, modify, and contribute to.

While Nanodicom does not handle DICOM networking, there is an existing class (not yet added to I Do Imaging) called DICOM PHP Class, which does just that.  It differs from NanoDicom in that it does its heavy DICOM work with the DCMTK toolkit.

Nanodicom is developed by Nano Documet, and the current release is version 1.3.

On the subject of DICOM libraries for interpreted languages, Ruby Dicom is well worth a look.  It supports reading, editing and writing file headers as well as network operations: querying, retrieving and sending files.  In conjunction with other Ruby packages, image data operations are also possible.

It’s written by Christoffer Lervåg who’s put out a steady stream of updates since the project’s inception in 2008.  The package is distributed in source form and as a Ruby gem  through RubyForge, allowing one-line installation.  The program is of course backed by a comprehensive site including tutorials, one of which walks you through creating a DICOM viewer with GUI controls in a few pages of code, using the Qt cross-platform toolkit.  Another tutorial uses the Rails framework to quickly build a web app to display DICOM header information on a browser.  Ruby Dicom is a cool application of a popular language with a devoted following.

Amide has been a major force in imaging software for a long time.  Developed and actively maintained  by Andreas Loening, it is by its own description a “Medical Imaging Data Examiner”.  As such, it’s strong on technical features and low-level operations on a broad range of file formats.  It’s written using the GTK+ cross-platform GUI toolkit which, together with good software design and a lot of hard work, means it will run on Windows and Windows computers as well as Linux.  There are too many features to go into here, but they include co-registering and fusing multiple data sets, volumetric rendering, 3-D ROIs, persistent storage of studies, and more.

Amide’s a good example of the collaborative nature of the open source imaging community.  The author uses (and contributes to) a variety of software packages, some specific to medical imaging (Medcon for conversions, DCMTK for DICOM support) and some more general (VolPack, FFMPEG, GSL).

Amide is notable in its support of the nuclear medicine formats ECAT and Interfile – strangers to those outside the field (just about everyone) but critical to those of us whose day jobs make possible the (admittedly spotty) maintenance of I Do Imaging.    Check it out, especially if you’re of a technical nature.

Medcon, together with its X Windows GUI xmedcon, is a medical image powerhouse for power users.  A product of Erik Nolf at Ghent University, it’s a format conversion program that supports a very wide range of file formats, with particular strengths in nuclear medicine but supporting all the widely-used formats.  It can work down to the voxel level to reslice image volumes along any axis and resample at varying resolutions.  Medcon can convert individual image slices to and from an image volume, convert the image value encoding, change colour maps, normalise values, and perform a number of other low-level operations.

Medcon has been in steady development for over 10 years, issuing dozens of releases, all well-documented and with careful attribution of fixes and feature requests.  It is particularly powerful when used from the command line or called from scripts, allowing full automation of complex repetitive actions.  There are distributions available for numerous Linux variants as well as the Macintosh and Windows platforms, and full source code (together with cross-platform make files) is provided under the (L)GPL license.  There’s not much he’s left out here!  (X)Medcon is a nice example of a defined problem (conversion of nuclear medicine file formats) being executed really well.