In order to build all components of the dcm4che2 toolkit you will need to download and install:

In addition, you will have to download the dcm4che2 source code from the dcm4che project at SourceForge, or get it directly from SVN:

svn co https://dcm4che.svn.sourceforge.net/svnroot/dcm4che/dcm4che2/trunk dcm4che2

There are two pieces to building dcm4che2: building the DICOM dictionary, and building the software itself. Building the dictionary is purely optional, as the standard dictionary is included in the application already. However, if you want to customize the dictionary, or add items to it that have not yet been included in the standard yet, then knowing how to build the dictionary is a good thing.

Building and Packaging

Building dcm4che2 is relatively easy, as Maven manages the dependencies for you. Assuming that you have the Maven executable scripts on your path... Simply navigate to the root of the dcm4che2 source directory structure, and type:

mvn install assembly:assembly

or (to avoid test failure in DicomImageWriterTest in versions prior to 2.0.20)

mvn install assembly:assembly -P nojiio

This will build distributions of the dcm4che2 toolkit. That's it! You may then find the zip distribution file in the target directory and copy/extract it to wherever you wish.

The DICOM Data Dictionary

/dcm4che2/dcm4che2-core is the project that contains the base dictionary files and the build script that generates the serialized file which gets included in the distribution. The DICOM standard is contained in an OpenOffice format. These documents are parsed using the appropriate DTD, and transformed (with XSL) into XML documents. These XML documents are then used as input to another XSL process which will generate org.dcm4che2.data.Tag.java, org.dcm4che2.data.UID.java, dictionary.xml, and uids.xml. The two Java files are compiled later as part of the dcm4che-core build process. The two XML files are used to generate serialized data dictionaries which are accessed at run time. These data dictionaries are ElementDictionary.ser, UIDDictionary.ser, and VRMap.ser.

Currently the movement of the generated Java and XML files over to the /dcm4che2/dcm4che-core directory structure is manual, as well as the generation of the serialized data dictionaries.

Within this directory, you'll see the following structure:


The main directory contains the content subdirectories and the Ant build script. The content subdirectories can be described as follows: