Last update : February 28, 2018
I started the edition of this contribution in June 2015 when I did my first trials with the Orthanc server. In the meantime I created OrthancPi, a mini headless PACS server which is used to host the DICOM teaching files for RadioLogic, an educational tool for radiologists which is currently in alpha test state. It’s now time to update and finalize my post about the installation of the Orthanc server on my MacBookAir computer. The goal is the development of OrthancMac, a midi PACS server for RadioLogic which is more powerful and user-friendly than OrthancPi. Some figures included in the present post refer to earlier versions of Orthanc and to OS X Yosemite because it would be waste time to replace them all with current screenshots.
Some informations provided in the present post are trivial and redundant with my other posts about DICOM and Orthanc. I assembled them for my own needs to get familiar with Orthanc and OS X developments.
Orthanc is a open-source, lightweight DICOM server for healthcare and medical research. It’s now also called a VNA (Vendor Neutral Archive). Orthanc can turn any computer running Windows, Linux or OS X into a PACS (picture archiving and communication system) system. Orthanc provides a RESTful API and is built on the top of DCMTK (collection of libraries and applications implementing large parts of the DICOM standard). Orthanc is standalone because all the dependencies can be statically linked.
The developer of Orthanc is Sébastian Jodogne, a belgian medical imaging engineer (2011) of the CHU of Liège (University Hospital) who holds a PhD in computer science (2006) from the University of Liège (ULG).
Orthanc source code
The Orthanc source code is available at Bitbucket. The latest stable Orthanc version is 1.3.1 released on November 2, 2017. Some changes have been done since that date. I downloaded the default (mainline) zip file from the Bitbucket project page and saved the unzipped orthanc folder into a directory named orthancmac located at the Mac OSX (El Capitan) desktop. My configuration is slightly different than the assumed structure in the Darwin compilation instructions, but I prefer this development setup.
The following folders and files are included in the orthanc folder :
- .travis.yml (to trigger automated builds)
- README, AUTHORS, COPYING, INSTALL, NEWS, THANKS
- LinuxCompilation.txt and DarwinCompilation.txt
The build infrastructure of Orthanc is based upon CMake. The build scripts are designed to embed all the third-party dependencies directly inside the Orthanc executable. Cmake uses the concept Out of source Build where the build directory is separated from the source directory.
I created a folder build inside the orthanc directory and opened a terminal window inside this build folder.
To prepare the build process (configuration) on Mac OS X El Capitan, I entered the following command in the terminal window :
cmake .. -GXcode -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 -DSTATIC_BUILD=ON -DSTANDALONE_BUILD=ON -DALLOW_DOWNLOAD=ON ~/desktop/orthancmac/build
The cmake options are :
The cmake cache entries are :
CMAKE_OSX_DEPLOYMENT_TARGET : 10.11
STATIC_BUILD : ON
STANDALONE_BUILD : ON
ALLOW_DOWNLOAD : ON
The following figure shows the configuration process when using the CMake-GUI :
During the configuration process, the following files have been downloaded from the website http://www.montefiore.ulg.ac.be/~jodogne/Orthanc/ThirdPartyDownloads/ :
- boost-_1_60_0_bcpdigest-1.0.1.tar.gz : (boost C++ librairies)
- curl-7.50.3.tar.gz : (curl tool and library for transferring data with URL syntax)
- dcmtk-3.6.0.zip : (DICOM librairies and applications)
- gtest–1.7.0.zip : (C++ Google framework to write tests)
- jsoncpp-0.10.5.tar.gz : (C++ library that allows manipulating JSON values)
- jpegsrc.v9a.tar.gz : (library for JPEG image compression from the IJG)
- libpng-1.5.12.tar.gz : (official PNG reference C89 library)
- lua-5.1.5.tar.gz : (powerful, fast, lightweight, embeddable scripting language)
- mongoose-3.8.tgz : (easy to use web server)
- openssl–1.0.2d.zip : (toolkit implementing SSL v2/v3 andTLS protocols)
- pugixml–1.4.tar.gz : (C++ light-weight XML processing library)
- zlib-1.2.7.tar.gz : (Unobtrusive Compression Library)
All the files have been saved in a new folder orthancmac/orthanc/ThirdPartyDownloads. The programs SQlite3 and Python 2.7.10 have been found installed.
Configuration messages, warnings and errors
During the configuration process, the following messages, warnings and errors have been stated :
Files not found
The following files and definitions have not been found during the processing of DCMTK : fstream, malloc, ieeefp, iomanip, iostream, io, png, ndir, new, sstream, stat, strstream, strstrea, sync, sys/ndir, sys/utime, thread, unix, cuserid, _doprnt, itoa, sysinfo, _findfirst, isinf, isnan, uchar, ulong, longlong, ulonglong
The following files have been patched :
– policy CMP0042 not set
– policy CMP0054 not set
To avoid the cmake_policy warning, I added the following command to the CmakeLists.txt file at the beginning :
if(POLICY CMP0042) cmake_policy(SET CMP0042 NEW) endif() if(POLICY CMP0054) cmake_policy(SET CMP0054 NEW) endif()
DCMTK’s builtin private dictionary support will be disabled
Thread support will be disabled
OS X Path not specified for the following targets:
Doxygen not found. The documentation will not be built.
Orthanc Xcode Building
The Build directory contains the following folders and files after the configuration and generation process :
To build the project, I entered the following command in the terminal window inside the build folder :
xcodebuild -configuration Release
The build was successful, the following warnings have been issued :
- 3 -> curl
- 1 -> lua
- 4 -> monggose
- 5 -> zlib
- 3 -> openssl
- > 100 -> DCMTK
- 1 -> Orthanc
The following figure shows the building process when using the Xcode GUI.
The eight targets are show at the left in red. To build the Release version, I modified the scheme in the Xcode-GUI. Building with the command line is much easier.
After the succesfull build, the following folders and files were added to the Build folder :
The Release folder contains the executables Orthanc, UnitTest and OrthancRecoverCompression, the libraries libCoreLibrary.a, libOpenSSL.a, libServerLibrary.a, libServeFolders.mainline.dylib and libModalityWorklists.mainline.dylib. These files are the targets of the Xcode building process.
Running the Orthanc server
The Orthanc configuration file Configuration.json is located in the folder orthanc-default/Resources. I copied this file into the Release folder and started the DICOM server with the command
inside the Release folder.
At the first start of the server, a new folder OrthancStorage is created inside the Release directory. The OrthancStorage folder contains the SQLite files index, index-shm and index-wal.
Entering the url localhost:8024 in the Safari address field opens the main window (explorer) of the Orthanc server.
Clicking the upload button opens an new window in the Orthanc server where I added some DICOM files from CD’s (drag and drop).
The DICOM files are saved in sub-folders in the OrthancStorage directory in a flat structure.
I modified the configuration.json file to allow the remote access to the server from another computer located in the same local network.
/** * Security-related options for the HTTP server **/ // Whether remote hosts can connect to the HTTP server "RemoteAccessAllowed" : true,
The remote anonymous access is now possible. When the remote access is not allowed, the server requests a user-id and password when entering the URL in the browser address bar :
Orthanc allows the following actions :
|send to remote modality||x||x||x||x|
|download DICOM file||–||–||–||x|
|download JSON file||–||–||–||x|
Because of its focus on low-end computers, Orthanc implements disk space recycling: the oldest series of images can be automatically deleted when the available disk space drops below a threshold, or when the number of stored series grows above a threshold. This enables the automated control of the disk space. Recycling is controlled by the MaximumStorageSize and the MaximumPatientCount options in the Orthanc configuration file. It is possible to prevent patient data from being automatically recycled by using the Unprotected/Protected switch that is available in Orthanc Explorer.
Testing the server
When the UnitTests executable is launched from the terminal window in the Release folder, 163 tests from 43 test cases were run. All these 163 tests passed. Two tests were disabled.
Two new folders were created in the Release folder by the testing process : UnitTestsResults and UnitTestsStorage.
The following list shows the main RESTful commands (links work only in my local network):
- Patients : http://localhost:8042/patients
- Studies : http://localhost:8042/studies
- Series : http://localhost:8042/series
- Instances : http://localhost:8042/instances
- Patient Name : http://localhost:8042/patients/ba1682fb-3fc01dc1-acaf1294-c0d61888-69ba054b
- Study CT Colonne cervicale : http://localhost:8042/studies/d4c42ef2-91794610-dfda2fe3-89fff37f-6d38b159
- Series Col. Cervicale Mou 2.0 MPR spine multi : http://localhost:8042/series/e7f7f651-aeacf5d4-a3832d08-3c7a3efa-2eff3c3a
- Instance 4 : http://localhost:8042/instances/8d5edbe5-073a70b9-c46dcaa7-9d54a495-6dc5ed32
- Download instance.dcm : http://localhost:8042/instances/8d5edbe5-073a70b9-c46dcaa7-9d54a495-6dc5ed32/file
- Simplified tags : http://localhost:8042/instances/8d5edbe5-073a70b9-c46dcaa7-9d54a495-6dc5ed32/simplified-tags
- Tags : http://localhost:8042/instances/8d5edbe5-073a70b9-c46dcaa7-9d54a495-6dc5ed32/tags
- Content : http://localhost:8042/instances/8d5edbe5-073a70b9-c46dcaa7-9d54a495-6dc5ed32/content
- Preview : http://localhost:8042/instances/8d5edbe5-073a70b9-c46dcaa7-9d54a495-6dc5ed32/preview
A complete grid of the Orthanc RESTful API is available as Google Spreadsheet.
Google groups discussions :
Other contributions :
- Orthanc : a different approach to a PACS, by Andrew I Do Imaging
- Why I cannot link the Mac framework file with CMake?, Stack Overflow
- gdcm xcode project error (mac os x), Grassroots DICOM