SCM

GDCM

From Forge Wiki

Jump to: navigation, search

Whenever medical data, especially medical image data, is generated in a clinical environment, that data must be stored such that it can be retrieved by the same hospital either immediately, or after several years to determine the effectiveness of a course of treatment and to allow comparisons of multiple images for the same patient.

Digital Imaging and Communications in Medicine (DICOM) is a standard that governs this capability by specifying handling, storing, printing, and transmitting information in medical imaging.

Grassroots DICOM (GDCM) is an implementation of the DICOM standard designed to be open source so that researchers may access clinical data directly. GDCM includes a file format definition and a network communications protocol, both of which should be extended to provide a full set of tools for a researcher or small medical imaging vendor to interface with an existing medical database.

GDCM is an open source implementation of the DICOM standard. It offers some compatibility with ACR-NEMA 1.0 & 2.0 files (raw files). It is written in C++ and offers wrapping to the following target languages (via the use of swig):

Python (supported), C# (supported), Java (supported), PHP (experimental), Perl (experimental).

It attempts to support all possible DICOM image encodings, namely:

RAW, JPEG lossy 8 & 12 bits (ITU-T T.81, ISO/IEC IS 10918-1), JPEG lossless 8-16 bits (ITU-T T.81, ISO/IEC IS 10918-1), JPEG 2000 reversible & irreversible (ITU-T T.800, ISO/IEC IS 15444-1), RLE, Deflated (compression at DICOM Dataset level), JPEG-LS (ITU-T T.87, ISO/IEC IS 14495-1), JPEG 2000 Multi-component reversible & irreversible (ISO/IEC IS 15444-2) (not supported for now), MPEG-2 (not supported for now).

GDCM is designed under the XP definition and has a nightly dashboard (CMake/CTest/Dart).

Contents

Version supported

The supported version depends on the VTK needed by you CamiTK version. Old versions of CamiTK (3.x) requires gdcm 2.4. Current version (4.x) requires gdcm 2.6

For any questions about the versions supported, check out our external libraries policy.

Windows

Visual Studio

To install GDCM on Windows, we'll need to recompile it from the sources.

  • Download the latest version of the source code.
    Good install tree
  • Extract the folder content in a intelligent path (no space characters ...) for instance : C:\dev\gdcm\2.2.3\src
  • Create a build and install directories at the same level. You should obtain directories tree like this :
  • Configure GDCM using CMake from the src to the build directories and do the following:
    • Check the GDCM_USE_VTK option.
    • Check the GDCM_BUILD_SHARED_LIBS option
    • Fill the GDCM_DEBUG_POSTFIX variable to "-debug"
    • Fill the CMAKE_INSTALL_PREFIX variable to your install directory (that you have just created)
  • Open the GDCM.sln Visual Studio file that you just created.
  • Compile the whole solution in Release
  • install it in Release by building the INSTALL project.
  • Compile your project in Debug:

The project vtkgdcm uses VTK, thus at link stage, it links vtkgdcm-debug.dll against some vtk***.dll files. Unfortunately, it doesn't take the input debug version of that VTK dlls. You will have then to provide the good version of the VTK input dll files.

To do so, change the vtkgdcm input link libraries properties in order to take the VTK Debug libraries and not the Release one.

  1. Right click on the VS project vtkgdcm and select properties
  2. Under Configuration properties, select Linker > Input
  3. Edit the Additional Dependencies list
  4. Look for the VTK input libraries (.lib files) and add the -debug suffix, then you may build your whole solution in Debug

Here's an example of the libraries to change for a VTK 5.10.1 installation in C:\dev\VTK\5.10.1

  • C:\dev\VTK\5.10.1\lib\vtk-5.10\vtkCommon-debug.lib
  • C:\dev\VTK\5.10.1\lib\vtk-5.10\vtkIO-debug.lib
  • C:\dev\VTK\5.10.1\lib\vtk-5.10\vtkImaging-debug.lib
  • C:\dev\VTK\5.10.1\lib\vtk-5.10\vtkRendering-debug.lib
  • C:\dev\VTK\5.10.1\lib\vtk-5.10\vtkGraphics-debug.lib
  • C:\dev\VTK\5.10.1\lib\vtk-5.10\vtkFiltering-debug.lib
  • C:\dev\VTK\5.10.1\lib\vtk-5.10\vtksys-debug.lib
  • install your solution in Debug by building the INSTALL project.
  • Update your environment variables:
    • Create a GDCM_DIR variables that points onto your install directory
    • Add the following value into your PATH system variables
      •  %GDCM_DIR%\bin
  • You may remove the build subfolder to free some hard disk space (nearly 1GB)

MinGW

To install GDCM on Windows, we'll need to recompile it from the sources.

  • Download the latest version of the source code.
    Good install tree
  • Extract the folder content in a intelligent path (no space characters ...) for instance : C:\dev\gdcm\2.2.3\src
  • Create a build and install directories at the same level. You should obtain directories tree like this :
  • Configure GDCM from the src to the build directories and do the following:
    • Check the GDCM_USE_VTK option.
    • Check the GDCM_BUILD_SHARED_LIBS option
    • Fill the CMAKE_BUILD_TYPE variable to "Release"
    • Fill the CMAKE_INSTALL_PREFIX variable to your install directory.
  • Open a Windows console (cmd) into your build directory.
  • Type make install
  • Update your environment variables:
    • Create a GDCM_DIR variables that points onto your install directory
    • Add the following value into your PATH system variables
      •  %GDCM_DIR%\bin
  • You may remove the build subfolder to free some hard disk space.

Done ! GDCM is now installed on your computer and may be used for developing purposes.

You might need to edit some header files (.h) of this library in order to compile with specific version of MinGW. For instance, if mingw32-make failed to compile a C++ class pointing out some WIN32 API declaration are missing, simply add

#include <windows.h>

at the top of the class's declaration (in the header file)

Linux

Run this command line in a terminal:

sudo apt-get install libgdcm2-dev libvtkgdcm2-dev



If you encounter any bug using this library, please fire a bug on the official source forge bugs report

Powered By FusionForge