Revision as of 13:59, 23 June 2014 by J.huguet (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Image viewing in XNAT

XNAT was conceived from the beginning as a research-oriented tool. Less interested in replicating the viewing capabilities a clinical PACS environment may offer and more focused on flexibility, availability, organization and processing of the heterogeneous data archived. Thus, XNAT does not provide per se the capability of reviewing image data with a suitable visualization software. The available viewing tool is rather simple and might be insufficient depending on the requisites of the XNAT user.

Visualization alternatives within XNAT are here presented depending on the scope and requirements to be met.

Native image viewing (ImageJ)

XNAT offers a built-in viewer based on ImageJ which allows simple viewing of archived DICOM images. The viewer uses Java applet technology, meaning it can be executed embedded in any web-browser without requiring its local installation.

XNAT development team is currently working in a completely renewed image viewing module for XNAT which will be using HTML5 standard and built on XTK technology. Is expected to be released by the end of 2014, a demo is already available here.

Clinical image viewing (XNAT Gateway)

One of the more desired features for the clinical-domain XNAT users is the possibility of having enhanced tools for (re)viewing data as they regularly do in their daily basis routine. This is actually possible by locally using an additional software application called XNAT Gateway.

XNATGateway v1.png

XNAT Gateway[1] is a communication layer that translates any DICOM communications message (used by a broad number of medical imaging software applications) to XNAT languange (REST calls). Therefore, it makes XNAT compatible with all DICOM-speaking applications or services such as an standard medical image viewer.

By using the XNAT Gateway users can therefore query & retrieve all image data in DICOM format available in XNAT as long as it is accessible under their accounts (read permission) and review it locally. This feature is doubly interesting, (1) enables application-agnostic viewing interaction with XNAT while (2) preserves the data accessibility restrictions established by XNAT (and nonexistent in DICOM!)


  • A valid BMIA-XNAT account.
  • A DICOM-speaking image viewer installed and properly configured locally.
    • If none is currently available, Osirix (for MacOS) or Synedra (for WinOS) are good free choices.
  • Sun/Oracle Java version 1.6+[2]

Installation of XNAT Gateway

  1. Download the latest version (August 2012) of the XNAT Gateway tool here
  2. Unzip the file to the desired location (if required)
  3. Run the file depending on the Operative System:
    • MacOS: Run the start-mac.sh file.
    • WinOS: Double-click to the installer executable file and then follow the prompts.
    • LINUX: Open a command prompt, cd to the application directory and run the command:
 “java -jar dist/gatewayE.jar”

Configure the XNAT Gateway

Once initiated the XNAT Gateway pops up a very simple interface for administration/configuration purposes. To properly use the Gateway it should be configured accordingly. Note that the XNAT Gateway should be stopped before modifying the configuration parameters.

  • Gateway XNAT configuration: From the main interface, click XNAT Server Change/Configure button.
    Add an XNAT server entry specifying URL, username and password. Although several can be included, only one XNAT server can be used at a time.

Gateway console.png Xnat configuration.png

  • Gateway DICOM configuration: From the main interface, click AE Configuration Change/Configure button.
    • Gateway settings: Specify the DICOM settings to be used by the XNAT Gateway while interacting with other applications/services. To do so add the following parameters: AETitle and local port listening for incoming associations. Make sure these parameters will be used by the actors interacting with the Gateway.
    • Remote settings: Specify the DICOM settings to be used by the image viewer(s) that will query the XNAT Gateway. Enter the following parameters AETitle, hostname and port to let the Gateway know which DICOM entities are trusted and where should it forward the image datasets queried.

Dicom configuration.png Dicom configuration2.png

  • Viewer DICOM configuration: Specify in the image viewer application the configuration details of the Gateway as an additional DICOM server node to query for images.
    Example (Synedra image viewer):

Viewer configuration.png

Querying DICOM studies

Equivalence table of DICOM versus XNAT fields for properly querying the XNAT database:

DICOM field XNAT field
(0010,0010) Patient Name Subject label
(0010,0020) Patient ID Session label
(0008,1030) Study Description Project ID
(0008,0020) Study Date Session date
(0008,0061) Modalities In Study Session Modality
  • Querying and retrieving XNAT data via XNAT Gateway:

Synedra query.png

  • Reviewing a Diffusion Tensor Imaging (DTI) stack:

Synedra viewStack.png

  • Measuring and annotating image data:

Synedra measures.png

Additional useful information

  • Walk-though guide here.
  • If using MacOS + Osirix combination, follow these additional instructions.
  • In case of doubt or problems contact the CTMM-TraIT servicedesk here.

Side notes

  1. XNAT Gateway translates queries from one language to another which is great since adds extra functionality. But because of this translation, queries may take a bit more time to complete (i.e. parsing and converting queries, forwarding retrieved data,...) than pure DICOM (or REST) ones.
  2. Current XNAT Gateway software release is in beta phase, bear in mind that bugs and performance issues may occur.
  3. As far as has been experienced with the current version, queries at Image (Instance) or Series level don't work properly using the Gateway. Is recommended to just use Patient and Study level queries instead and retrieve specific studies or series as desired. More information about the DICOM C-FIND service and its query Levels here.

Scientific image viewing and analysis (XNATSlicer)

3D Slicer is a software platform for image visualization and analysis. Analogous to a radiology workstation but with more technically-oriented features, 3D Slicer provides a powerful clinical research tool. In addition, is designed to facilitate the development of new functionality in the form of 3D Slicer extensions. An externally developed extension called XNATSlicer allows 3D Slicer to interact with XNAT.


  • A valid BMIA-XNAT account.
  • 1GB of RAM absolute minimum, with more highly recommended.
  • Common data sets may require 4GB or more RAM for processing.
  • A fast graphics card or GPU that supports OpenGL is recommended.

Installation of XNATSlicer

  1. Download and install Slicer v4.3+
  2. Download the XNATSlicer extension from the XnatSlicer GitHub repository (click on the 'Download ZIP' button)
  3. Unzip the downloaded package to the desired location
  4. Open 3D Slicer. Go to 'Edit' -> 'Application Settings' -> 'Modules' ->'Additional Module Paths'
  5. Click on the double-chevron (<<) to the right, then click the 'Add' button.
  6. Locate the decompressed XNATSlicer source code directory and navigate to the folder where 'XnatSlicer.py' resides, click the 'Choose' button.
  7. Slicer will prompt a restart.
  8. After restarting Slicer the module would be installed, XNATSlicer can be found in the 'Modules' dropdown menu near the top left corner of the application.

Configure XNATSlicer extension

To configure Slicer to query and retrieve image data from XNAT,

  • Start 3DSlicer application
  • Load XNATSlicer module/extension selecting it from the Modules menu
  • Once loaded, a module-specific left side panel will appear
  • Click the plus (+) button to add/modify XNAT end-points to interact with

Slicer sites.png

  • Add settings for the BMIA-XNAT (XNAT URL, user authentication credentials) and save configuration changes

Slicer configuration.png

  • Login to XNAT and -if settings were properly set- Viewer panel will display a tree view with all entities (i.e. projects, subjects, experiments, scans, files) accessible for the given user
  • Browse over the tree view and select a desired image session or scan, click the left-to-right arrow (-->) to download the image(s)

Slicer viewing.png

Additional useful information

  1. Official module information here.
  2. In case of doubt or problems using it, please contact the CTMM-TraIT servicedesk here.

Side notes

Warning: XNATSlicer not only allows the retrieval and visualization/analysis of imaging resources. Moreover it enables the creation, upload and removal of experiments (image sessions) to XNAT. This tool should be used with extreme care not to delete/modify unintendedly any exiting dataset from the system archive.

-- Jordi Huguet (AMC)