RTK: The Reconstruction ToolkitPosted in Open Source, Medical Imaging. Viewed 2791 times.
Authored by: Julien Jomier, Simon Rit, Marc Vila Oliva
Tomographic reconstruction is at the core of medical imaging and has been an active field of research of the past fifty years. It aims at solving an inverse problem that requires the efficient implementation of algorithms based on mathematical solutions. A large part of the research is done by companies that not only protect their source code, but also the access to projection data. The cone-beam CT scanners installed in radiotherapy rooms are notable exceptions since access to raw X-ray transmission data is granted to the customers. This has triggered many developments in the past decade but, to our knowledge, there was no open-source software platform that would allow sharing of developments. The purpose of the Reconstruction Toolkit (RTK) is to answer this need.
The RTK consortium aims at developing a community-supported open-source and cross-platform toolkit, RTK (http://www.openrtk.org), for fast tomographic reconstruction based on the Insight Toolkit (ITK). RTK is developed under the same Apache 2.0 license as ITK v4, approved by the Open Source Initiative. The RTK consortium is composed of CREATIS , the Massachusetts General Hospital , the Université Catholique de Louvain\footnote , and IBA .
3D Circular Geometry: RTK has been developed for circular geometries, i.e., a source and a flat panel rotating along a circle. Deviations from this strict geometry can be described for each projection image by means of nine degrees of freedom: 3 coordinates for the point source position, 3 coordinates for the flat panel position, and 3 angles for the flat panel orientation. RTK provides classes to write and read the geometry in its own XML file format as well as readers for the geometry of commercial scanners, e.g., Elekta Synergy  and Varian OBI .
Input-Output: RTK uses the ITK factories for the input/output of projection images. As for the geometry, we also provide new readers for Elekta Synergy and Varian OBI raw data (Figure 1). Simple conversion from raw data to linear attenuation is provided, and we aim to improve it in the future with calibration, beam hardening correction and scatter correction to reach quantitative CT, i.e., pixel values in Hounsfield units.
Forward- and Back-Projectors: At the core of tomographic reconstruction are forward- and back-projectors. They have been designed in a typical object-oriented fashion to allow testing of various implementations. GPU versions are also provided for faster reconstruction.
Figure 1: Axial slice of cone-beam CT images of the CTP 528 resolution module of the Catphan phantom, reconstructed with FDK from raw data acquired on an Elekta Synergy at the Léon Bérard center in Lyon, France (left), on a Varian OBI at the MGH in Boston, USA (middle), and on an IBA cone-beam CT mounted on a test bench (right). Raw datasets are publicly-available on the MIDAS instance for the RTK community http://midas.openrtk.org.
Reconstruction Algorithms: The main reconstruction algorithm currently implemented is the Feldkamp-David-Kress (FDK) algorithm . Preprocessing of the projection images is available to handle short scans  and displaced detectors for the reconstruction of larger field-of-views , two possible scanning modes of existing scanners. There is also an implementation of the Simultaneous Algebraic Reconstruction Technique (SART) , and other iterative algorithms should follow.
Numerical Phantoms: RTK can simulate projection images and reference CT images of geometric numerical phantoms such as the Shepp-Logan phantom (Figure 2). These phantoms are the most commonly used to validate tomographic reconstruction algorithms. They are also used in RTK functional tests that are nightly run on the dashboard .
Figure 2: Generated sinogram (left) and reconstructed CT image (right) of the Shepp-Logan phantom obtained with RTK using the following script. The file SheppLogan.txt is available on the MIDAS RTK community.
# Command lines used to generate these two images:
rtksimulatedgeometry --output geometry --nproj 720
rtkprojectgeometricphantom --geometry geometry \
--output proj.mha --phantomfile SheppLogan.txt
rtkfdk --path . --regexp proj.mha
--geometry geometry \
--output fdk.mha --dimension 512 --spacing 0.5
RTK is developed in collaboration with Kitware and uses the software process suite: CMake, CDash, CTest, and CPack. The source repository is hosted on GitHub. The user's documentation is available on the main wiki and developer's documentation via Doxygen. Test and example data are hosted on MIDAS. The links to these tools are available on the RTK website.
Insight Toolkit (ITK): RTK is based on ITK  v3.20 or v4.3, which is its only mandatory dependency. Many ITK features are essential to the functioning of RTK: input-output factories, filters pipelining, streaming, mini-pipelines, multi-threading, smart pointers, FFTW wrapping, etc. Every RTK filter is meant to be ITK compliant and RTK can be thought of as an ITK module.
Table 1: Multi-threaded CPU vs. CUDA GPU timing of several RTK filters. The measurement excludes hard drive input/output but includes the required transfers between the RAM and the graphics card. The tests have been performed with 48 threads on a cluster node equipped with two Intel Xeon E5-2630L CPUs and one Nvidia Tesla M2090 GPU.
Gengetopt: RTK also provides a set of command-line applications that use Gengetopt to define their options (Figure 2). Gengetopt  is a tool for writing command line options for parsing code for C programs. The code is generated from a configuration file, named with a .ggo extension in RTK. We have developed the CMake module file FindGengetopt.cmake to automatically create the gengetopt compilation rules. Note that Gengetopt source code is distributed along with RTK, without modification, to automatically compile it if the Gengetopt binary is not available in the system path.
GPU: CUDA and Open CL: RTK proposes the use of a CUDA  implementation of a few filters that are essential to fast tomographic reconstruction: forward- and back-projection and ramp filtering. Part of the code has been taken and adapted from Plastimatch  and NiftyRec , two other open-source tomographic packages. It is worth noting that ITK is not compatible with the CUDA compiler, nvcc so the CUDA code is in separate functions defined in .cu file, which are not members of itk::ImageToImageFilter daughters. RTK also proposes the use of an OpenCL  implementation of one filter, but so far less effort has been put into using OpenCL. Table 1 compares the processing of filters that exist in multi-threaded CPU and CUDA/GPU versions.
New Developments: At this time, RTK still has a limited number of capabilities compared to the numerous algorithms available in the literature. We will be complementing it with new forward- and back-projectors, iterative reconstruction algorithms, etc. Other geometries could also be added, including the handling of parallel beams, which is currently being developed. Other modalities could also be considered, such as nuclear imaging.
External Use: RTK is a software toolkit that is meant to be used in other medical computing and imaging platforms. We have already developed a proton CT reconstruction algorithm that uses RTK . We will also use RTK in Gate  to enhance its X-ray simulation capabilities.
IBA Cone-Beam CT Scanner: RTK has been supported by the IBA company, a part of the consortium, which is currently developing the first cone-beam CT scanner developed for proton therapy rooms, in partnership with the Université Catholique de Louvain. RTK will be used in the scanner software for the reconstruction and the 2D/3D registration.
We have developed a cone-beam CT reconstruction platform based on ITK. We aim at extending the current set of features with new preprocessing and reconstruction algorithms to improve image quality. We also want to handle other geometries and modalities. RTK is open to new users and developers and those who have made a significant contribution to the platform can join the RTK consortium. You can join the project by visiting http://openrtk.org.
Simon Rit received his PhD from the Lumière University (Lyon, France) in 2007 on respiratory motion correction in cone-beam CT for image-guided radiotherapy. His 2-year postdoctoral fellowship on the same topic at the Netherlands Cancer Institute (Amsterdam) led to the clinical use of motion-compensated cone-beam CT. Since 2010, he is a CNRS research associate at CREATIS (CNRS 5220, INSERM U1044, INSA Lyon, Université de Lyon) and the Léon Bérard cancer center.
Marc Vila Oliva received his Master's degree on image/signal processing from the Universitat Politecnica de Catalunya (Barcelona, Spain) in 2011. Since 2012, he is a research engineer at CREATIS (CNRS 5220, INSERM U1044, INSA Lyon, Université de Lyon) and the Léon Bérard cancer center.
Julien Jomier is currently directing Kitware’s European subsidiary in Lyon, France where he focuses on European business development. He holds a Master’s degree in electrical engineering and information processing from the ESCPE-Lyon in France, and another in computer science from the University of North Carolina at Chapel Hill.
 L.A. Feldkamp, L.C. Davis, and J.W. Kress. Practical cone-beam algorithm. J Opt Soc Am A, 1(6):612--619, 1984.
 D.L. Parker. Optimal short scan convolution reconstruction for fanbeam CT. Med Phys, 9(2):254--257, 1982.
 G. Wang. X-ray micro-CT with a displaced detector array. Med Phys, 29(7):1634--1636, Jul 2002.
 A.H. Andersen and A.C. Kak. Simultaneous algebraic reconstruction technique (SART): a superior implementation of the art algorithm. Ultrason Imaging, 6(1):81--94, Jan 1984.
 http:// sourceforge.net/projects/niftyrec/
 S. Rit, G. Dedes, N. Freud, D. Sarrut, and J.M. Létang. Filtered ely paths. Med Phys, 40(3):031103, 2013.
 S. Jan, D. Benoit, E. Becheva, T. Carlier, F. Cassol, P. Descourt, T. Frisson, L. Grevillot, L. Guigues, L. Maigne, C. Morel, Y. Perrot, N. Rehfeld, D. Sarrut, D.R. Schaart, S. Stute, U. Pietrzyk, D. Visvikis, N. Zahra, and I. Buvat. GATE V6: a major enhancement of the GATE simulation platform enabling modelling of CT and radiotherapy. Phys Med Biol, 56(4):881--901, Feb 2011.