openDICOM.NET

the DICOM library project

 

 


Table of contents
1 What is openDICOM.NET?

2 News

3 Packages
   3.1 opendicom-sharp
   3.2 opendicom-sharp-gdk
   3.3 opendicom-utils
   3.4 opendicom-navigator
   3.5 opendicom-beagle
   3.6 Gobosh.Dicom

4 Known bugs and unsupported features

5 Download
   5.1 Packages
   5.2 Subversion

6 Installation
   6.1 GNU/Linux
      6.1.1 Installation from APT repository (.deb)
      6.1.2 Installation from source packages (.tar.gz and .zip)
      6.1.3 Installation from sources (Subversion)
   6.2 Windows

7 Usage
   7.1 opendicom-sharp.dll
      7.1.1 API references
      7.1.2 Code examples
   7.2 dicom-dd-query.exe
   7.3 dicom-dd-transform.exe
   7.4 dicom-file-query.exe
   7.5 dicom-file-transform.exe
   7.6 dicom-file-navigator.exe
   7.7 FilterDicom.dll

8 Applications using openDICOM.NET

9 Contributors

10 Acknowlegement

11 Sample DICOM files

 

What is openDICOM.NET?

The openDICOM.NET project implements a new approach towards DICOM (Digital Imaging and Communications in Medicine) libraries. DICOM is a worldwide standard in Medical IT and is provided by the National Electrical Manufacturers Assocation (NEMA). This standard specifies the way medical images and meta data like study or patient related data is stored and communicated over different digital medias. Thus, DICOM is a binary protocol and data format.

The openDICOM# Class Libary, main part of the openDICOM.NET project, provides an API to DICOM in C# for Mono and the .NET Framework. It is a completely new implementation of DICOM. In contrast to other similar libraries the intention of this implementation is to provide a clean classification with support of unidirectional DICOM data streaming. Another implemented goal is the support of DICOM as XML. This is not standard conform but very use- and powerful within software development, storage and manipulation. Currently, full read support of DICOM output stream and full write support to XML is supposed to be provided. The entire DICOM content can be accessed as sequence or as tree of class instances. Latter is the default representation of DICOM content by the library.

The openDICOM.NET Utils are a collection of console tools for working with the needed data dictionaries in different data formats (binary and textual), query of ACR-NEMA (prior DICOM standard) and DICOM files and transcoding them into image formats like JPEG and XML files. These utils are written in C# for Mono and the .NET Framework and are using the openDICOM# API for processing.

The openDICOM.NET Navigator recapitulates the openDICOM.NET Utils in form of a GTK# GUI. It provides different views with focus on DICOM data sets and visualization. Connectivity to GIMP is also given for single image processing purpose as well as the possibility to run through multi-frame images like a movie.

The openDICOM.NET Beagle Filter Plugin increases the usability of ACR-NEMA and DICOM query within your desktop. It makes DICOM content overall indexable for retrieval. The Beagle search engine relies on Mono/.NET and works in the background of your system, but is able to detect content changes in realtime (depending on your configuration).

All GUI applications focus the popular GNOME desktop, but are 100% platform independent by relying on Mono.

 

News

You will find openDICOM.NET related news on my blog.

 

Packages

opendicom-sharp

Description: openDICOM.NET library (and documentation)
Current release: 0.1.1
Language: C#
Download: here

Release: 0.1.1
License: LGPL
Provides: opendicom-sharp.dll
Dependencies: Mono (>= 1.1.17.1)
Release notes: here
Download: here

 

Release: 0.1.0
License: LGPL
Provides: opendicom-sharp.dll
Dependencies: Mono (>= 1.1.8.3) - GNU/Linux, Windows and other OS
Alternatively the .NET Framework (>= 1.1) - Windows
Release notes: here
Download: here

 

opendicom-sharp-gdk

Under development.

 

opendicom-utils

Description: openDICOM.NET console tools
Current release: 0.1.1
Language: C#
Download: here

Release: 0.1.1
License: GPL
Provides: dicom-dd-query.exe
dicom-dd-transform.exe
dicom-file-query.exe
dicom-file-transform.exe
Dependencies: Mono (>= 1.1.17.1)
opendicom-sharp (>= 0.1.1)
Release notes: here
Download: here

 

Release: 0.1.0
License: GPL
Provides: dicom-dd-query.exe
dicom-dd-transform.exe
dicom-file-query.exe
dicom-file-transform.exe
Dependencies: Mono (>= 1.1.8.3) - GNU/Linux, Windows and other OS
Alternatively the .NET Framework (>= 1.1) - Windows
opendicom-sharp (= 0.1.0)
Release notes: here
Download: here

 

opendicom-navigator

Description: openDICOM.NET GTK# GUI
Current release: 0.1.5
Language: C#
Download: here

Release: 0.1.5
License: GPL
Provides: dicom-file-navigator.exe
Dependencies: Mono (>= 1.1.17.1)
opendicom-sharp (>= 0.1.1)
gtk-sharp (>= 2.10)
glade-sharp (>= 2.10)
Release notes: here
Download: here

 

Release: 0.1.1
License: GPL
Provides: dicom-file-navigator.exe
Dependencies: Mono (>= 1.1.17.1)
opendicom-sharp (>= 0.1.1)
gtk-sharp (>= 2.10)
glade-sharp (>= 2.10)
Release notes: here
Download: here

 

Release: 0.1.0
License: GPL
Provides: dicom-file-navigator.exe
Dependencies: Mono >= 1.1.8.3 (GNU/Linux, Windows and other OS) or alternatively the .NET Framework >= 1.1 (Windows only)
opendicom-sharp = 0.1.0
GTK# and Glade# >= 2.4 in combination with Mono or the GTK# Windows SDK or runtime package in combination with .NET.
Release notes: here
Download: here

 

opendicom-beagle

Description: openDICOM.NET Beagle Filter Plugin
Current release: 0.1.1
Language: C#
Download: here

Release: 0.1.1
License: GPL
Provides: FilterDicom.dll
Dependencies: Beagle (>= 0.2.9)
opendicom-sharp (>= 0.1.1)
Release notes: here
Download: here

 

Release: 0.1.0
License: GPL
Provides: FilterDicom.dll
Dependencies: Beagle >= 0.2.9 (requires Mono or .NET Framework)
opendicom-sharp = 0.1.0
Release notes: here
Download: here

 

Gobosh.Dicom

Description: Alternative DICOM library project for .NET/Mono
Current release: 0.1
Language: C#
Download: here

 

Release: 0.1
License: GPL
Provides: DICOM Library, Anonymizer, dicom2xml, xml2dicom, GtkDicomViewer, MobileDicomViewer, TestDicomViewer
(see release notes for further description)
Release notes: here
Download: here

 

 

Known bugs and unsupported features

 

Download

Packages

The entire project (binaries and sources) is available for download at SourceForge. Please take care of dependencies that come with different package releases. Take a look at packages and the installation section for further informations.

 

Subversion

Project currently is under development. Checked out source code might not build or run.

Another possibility is to download the entire project source code and helper scripts from the SourceForge Subversion server. More details are provided at the installation section.

   svn co https://opendicom.svn.sourceforge.net/svnroot/opendicom

 

Installation

GNU/Linux

Installation from APT repository (.deb)

An APT repository for Debian based distributions is available. Packages have been successfully tested with Ubuntu 6.10. Please add this line to /etc/apt/sources.list on your system.

   deb http://ubuntu.mi.hs-heilbronn.de/other/opendicom ./

Bring your repository index up-to-date.

   sudo apt-get update

Install the packages you are looking for.

   sudo apt-get install opendicom-navigator opendicom-utils

 

Installation from source packages (.tar.gz and .zip)

Extract the opendicom-* packages to a temporary directory. Use the provided Makefiles for compilation and installation. Take a look at INSTALL for more detailed informations. Please take care of dependencies that come with different package releases. openDICOM.NET Utils (opendicom-utils), openDICOM.NET Navigator (opendicom-navigator) and openDICOM.NET Beagle (opendicom-beagle) need the opendicom-sharp.dll from openDICOM# package (opendicom-sharp) for proper work.

 

Installation from sources (Subversion)

Project currently is under development. Checked out source code might not build or run.

Download the project source code from the SourceForge Subversion server.

   svn co https://svn.sourceforge.net/svnroot/opendicom

This is always the newest implementation. Make sure, you did not already install any openDICOM.NET subproject. So, you prevent conflicts! There are two possibilities to build and install subprojects to your system. Following is the easiest way for build and installation.

   bash build.sh
   usage: sh build.sh {beagle|lib|utils|navi}

This shell script cleans, compiles and replaces the specified openDICOM.NET subproject system-wide. A possibility of more control is to change to a subproject directory and use the provided Makefile in the common way.

   make clean
   make
   sudo make install

Uninstallation is also done as usual.

   sudo make uninstall

 

Windows

A Windows installer is not provided yet. openDICOM.NET Utils (opendicom-utils), openDICOM.NET Navigator (opendicom-navigator) and openDICOM.NET Beagle (opendicom-beagle) need the opendicom-sharp.dll from openDICOM# package (opendicom-sharp) for proper work. Just copy all binaries (.dll, .exe and .dic files) together to the same directory. Then, everything is supposed to work fine. Please take care of further dependencies that come with different package releases.

 

Usage

opendicom-sharp.dll

API references

The online openDICOM.NET API Reference or openDICOM# Class Library documentation is available here or can be downloaded at SourceForge.

Fast mirror (Germany):

 

Code examples

Open a DICOM file:

using System;
using System.IO;
using openDicom.Registry;
using openDicom.File;

[...]

DataElementDictionary dataElementDictionary = new DataElementDictionary();
UidDictionary uidDictionary = new UidDictionary();
try
{
    dataElementDictionary.LoadFrom("dicom-elements-2004.dic", DictionaryFileFormat.BinaryFile);
    uidDictionary.LoadFrom("dicom-uids-2004.dic", DictionaryFileFormat.BinaryFile);
}
catch (Exception dictionaryException) {
    Console.Error.WriteLine("Problems processing dictionaries:\n" + dictionaryException);
    return;
}
AcrNemaFile file = null;
try
{
    if (DicomFile.IsDicomFile(fileName))
        file = new DicomFile(fileName, false);
    else if (AcrNemaFile.IsAcrNemaFile(fileName))
        file = new AcrNemaFile(fileName, false);
    else
        Console.Error.WriteLine("Selected file is wether a " +
            "DICOM nor an ACR-NEMA file.");
}
catch (Exception dicomFileException)
{
    Console.Error.WriteLine("Problems processing DICOM file:\n" + dicomFileException);
    return;
}

[...]


Print out all tags with corresponding description:


using System;
using System.IO;
using openDicom.Registry;
using openDicom.File;
using openDicom.DataStructure;
using openDicom.DataStructure.DataSet;

[...]

Sequence sq = file.GetJointDataSets().GetJointSubsequences();
string tag = string.Empty;
string description = string.Empty;
foreach (DataElement element in sq)
{
    tag = element.Tag.ToString();
    description = element.VR.Tag.GetDictionaryEntry().Description;
    Console.WriteLine(tag + " " + description);
}

[...]

 

dicom-dd-query.exe

Queries a data dictionary for user specified informations.

dicom-dd-query dict:<type> [<format>:<src>] <key>:<pattern>

type      specified dictionary type
          data-element - data element dictionary
          uid          - unique identifier dictionary
format    specified file format
          b - binary
          p - property
          x - xml
          c - csv
src       local dictionary file
key       specified query key
          - data element dictionary:
             tag         - tag
             description - description
             vr          - value representation
             vm          - value multiplicity
             any         - look for matches overall keys
         - UID dictionary:
             uid  - unique identifier
             name - description
             type - type
             any  - look for matches overall keys
pattern   query pattern corresponding to key
          - wildcards (*) represent any substring
          - question marks (?) represent any character
          - matching is not case sensitive

 

dicom-dd-transform.exe

Transforms data dictionary files between different formats.

dicom-dd-transform dict:<type> [src:<format>:<source>] dest:<format>:<dest>

type      specified dictionary type
          data-element - data element dictionary
          uid          - unique identifier dictionary
format    specified file format
          b - binary
          p - property
          x - xml
          c - csv
source    local source file
dest      local destination file

 

dicom-file-query.exe

Queries a DICOM file for user specified informations.

dicom-file-query [element-dic:<format>:<src>] [uid-dic:<format>:<src>] <dcm-file> <key>:<pattern> [decode:<mode>]

format    specified file format
          b - binary
          p - property
          x - xml
          c - csv
src       local dictionary file
dcm-file  DICOM file
key       specified query key
          tag         - tag
          description - description
          vr          - value representation
          vm          - value multiplicity
          length      - length
          value       - value as string
          any         - look for matches overall keys
pattern   query pattern corresponding to key
          - wildcards (*) represent any substring
          - question marks (?) represent any character
          - matching is not case sensitive
mode      decoding mode of DICOM content
          strict - proper decoding (default)
          lax    - improper decoding

 

dicom-file-transform.exe

Transforms DICOM file content to XML, raw and image data file(s).

dicom-file-transform [element-dic:<format>:<src>] [uid-dic:<format>:<src>] <dcm-file> target:<target>[:<dest-file>] [decode:<mode>]

format    specified file format
          b - binary
          p - property
          x - xml
          c - csv
src       local dictionary file
dcm-file  DICOM file
target    specified targets of transcoding
          xml    - XML file
          xml-pd - XML file without pixel data
          raw    - Raw pixel data file(s)
          img    - determines image file format for pixel data if possible
dest-file specified destination file name
mode      decoding mode of DICOM content
          strict - proper decoding (default)
          lax    - improper decoding

 

dicom-file-navigator.exe

Simple GTK# ACR-NEMA and DICOM viewer.


DICOM File Navigator on Nokia 770 (Maemo) -- Thanks to Shara Kalthoff!


DICOM File Navigator 0.1.5 (newest release)

  
DICOM File Navigator 0.1.0 on Ubuntu GNU/Linux and Windows XP

There is no special console usage specified. You can easily link ACR-NEMA or DICOM file types with this application by registering those files as first application parameter. Try always to use file extensions like ".dcm", because ACR-NEMA files do not contain any file header that can be used for classification.

 

FilterDicom.dll

Filter plugin for Beagle desktop search.

This filter plugin for Beagle makes ACR-NEMA and DICOM content indexable for retrieval. So, looking for DICOM files by a corresponding combination of patient name, gender, birthday and/or id is made easy, for example.

Testing the filter in a shell:

beagle-extract-content <dicom-file> | less

 

Applications using openDICOM.NET

 

Contributors

 

Acknowledgement

I would like to take the chance to thank following persons for their past, current and future endeavours supporting it.

 

Sample DICOM files

 

Albert Gnandt, 2007-09-18 SourceForge.net Logo