Free Software for PET Imaging

In recent years, there has been a large influx of image analysis software made freely available to the public. Free software or libre software is any software that can be used, studied, modified, copied and redistributed in modified or unmodified form either without or with minimal restrictions (see Stallman (2002) and Free Software Foundation (2011) for licenses, copylefts and further details). In practice, and in particular for the software reviewed here, straightforward availability at no cost as well as open code source are also granted. Multiplatform availability is also very common, i.e. the product is available for different operating systems and architectures. Additionally, free software users –be them clinicians or software engineers– can take advantage of other nice features such as on-line documentation, user forums and email lists that are also provided with some applications.


Introduction
In recent years, there has been a large influx of image analysis software made freely available to the public.Free software or libre software is any software that can be used, studied, modified, copied and redistributed in modified or unmodified form either without or with minimal restrictions (see Stallman (2002) and Free Software Foundation (2011) for licenses, copylefts and further details).In practice, and in particular for the software reviewed here, straightforward availability at no cost as well as open code source are also granted.Multiplatform availability is also very common, i.e. the product is available for different operating systems and architectures.Additionally, free software users -be them clinicians or software engineers-can take advantage of other nice features such as on-line documentation, user forums and email lists that are also provided with some applications.
Free software is advantageous to the community in several ways.First, by providing a platform on which to perform analysis without having to re-implement and re-program the details of the algorithms themselves.Second, it also promotes open research, the dissemination of source code, data, and publication, with the goals of research reproducibility, method validation and advancement (see OpenScience Project (2011)).Thus, in this spirit, free software is the main focus of this chapter's software compilation.
It is worth saying that although any imaging processing software makes the analytical technicalities less complicated, a free software user must ensure that the implementation of the method is sufficiently understood in order to interpret the results accurately.It is the user's responsibility to verify that the software be well documented, validated, and kept up to date in order to ensure that the quality requirements of the particular task are met.Likewise, another caveat of free software is that any specific license restrictions for software use (i.e.some free software packages are restricted to academic research and not available for commercial applications) are left to the user.Due to the above mentioned advantageous features, free software has become an appealing choice for many technical and non technical applications.Specifically, PET imaging practitioners -researchers and eventually clinicians-may benefit from a number of advantages by incorporating some pieces of free software to their set of tools.The main focus of this chapter is a practical one.It is intended as a, possibly incomplete, free software guide to available packages that help to accomplish daily or less usual tasks related to this medical imaging field.We will review a variety of free packages ranging from plain image viewers, to the more complex or demanding system modeling and image reconstruction applications.
• Arbitrary orientation, thickness, and time period slice viewing of a data set • Multiple data sets can be loaded and viewed at once, with either linked or fused views.
Each data set can be viewed from any orientation.Fusing can be done by blending or overlay • Nearest neighbor and trilinear interpolation functions • Zooming • The following color maps are supported: Black/White,White/Black,Red/Green/Blue Temperature, Hot Metal/Blue/Green, Spectrum, NIH/UCLA • Threshold: data sets are thresholded independently.Data sets can be thresholded over the entire data set or over each slice.• Three-dimensional regions of interest (ROIs) can be drawn directly on the images and statistics can be generated for these ROIs.Currently supported ROIs are ellipsoids, elliptic cylinder's, boxes, and isocontours • Imports raw data files (8bit,16bit,32bit,float,etc).Also imports Acr/Nema 2.0, Analyze (SPM), DICOM 3.0, InterFile3.3,ECAT 6/7, and Gif87a/89a (using the (X)medcon/libmdc) • Imports most clinical DICOM files (using the DCMTK library) • Allows cropping and clearing regions of data sets • Anisotropic filtering wizard.Current filters: Gaussian, 1D Median, and 3D Median • Saves studies (ROI and Data Set data) as XML data • Series of slices can be viewed 86 Positron Emission Tomography -Current Clinical and Research Aspects www.intechopen.com • Fly through movies can be generated as MPEG1 files • True volume rendering support with the capability of rendering multiple data sets at a time.Series of renderings can be saved as MPEG1 movies.Data sets can also be rendered as stereoscopic image pairs • Alignment of data sets is supported using fiducial markers.This is done by placing fiducial reference points on the data sets to be aligned, and then running an alignment wizard to perform a rigid body transformation (Procrustes method) • A profile tool is included that can calculate Gaussian fits and FWHM's of the generated line profiles.Profiles can also be saved for external use.

AMIDE MRIcro OsiriX GpetView
Programming language C language ?Objective C/Various C language

Image reconstruction
Because the process of data acquisition is random in nature there always exists an unavoidable resolution/noise (or equivalently, bias/variance) trade-off in all the nuclear medicine imaging modalities.Any reconstruction algorithm is somehow intended to solve this compromise in some optimal way.Before going into the software package specific features, we will take a bird's-eye view of some important issues concerning PET reconstruction.

Algorithms
Algorithms for image reconstruction from projections (in particular, PET and SPECT image reconstruction) fall into two broad categories: direct and indirect methods.

Analytic methods
Algorithm of this first group, a.k.a.direct methods, represent a closed formula obtained by discretization of different expressions of the inverse Radon transform.Thus, for 2D reconstruction we find the well known Filtered Backprojection (FBP) or Convolution Backprojection (CBP) algorithms (see, for instance Kak & Slaney (1988)).For 3D acquisition, the situation is more involved and many options are at hand.However, the 3D Re-Projection (3DRP) algorithm, a.k.aPROMIS (Kinahan & Rogers (1989)), has become an option of choice.
At this point, it is worth mentioning two approaches in order to enhance the performance of direct methods.First of all, the use of the standard Ram-Lak or ramp filter in the convolution or filtering step give rise to the striking artifacts characteristic of this methods.To alleviate those undesirable effects various windowing filters have been proposed in the literature (Hamming, Shepp-Logan, Parzen, etc.) in order to de-emphasize the high frequencies of the ramp filter.
Unfortunately the introduction of a window filter to reduce noise will produce an unavoidable image blurring effect.In practice, by the selection of the cut-off filter parameter the user choose the resolution/noise trade-off desired for a particular reconstruction.Secondly, another important part of the direct method is the backprojection step in which the projection profiles are smeared back to the image domain.Because of the finite sampling data, the process needs an interpolation step.In this sense, one can use nearest-neighbor, linear, bi-linear, cubic, or spline interpolation among other choices.

Rebinning methods
Approximate direct methods, a.k.a.rebinning methods, manipulate the 3D projection data in order to obtain a richer 2D set that can be reconstructed using some 2D direct method.This reduces the amount of data and speeds-up the reconstruction process.Popular rebinning algorithms include, from less to more sophisticated approaches, Single Slice Rebinning (SSRB), Multiple Slice Rebinning (MSRB), Fourier Rebinning (FORE), and variations such as FOREX and FOREJ (see Daube-Witherspoon & Muehllehner (1987); Defrise et al. (1997); Lewitt et al. (1994)).

Iterative methods
On the other hand, indirect methods, i.e. iterative algorithms take a different approach.
Starting from an initial guess for the image to reconstruct (for example a constant image or a 2D FBP reconstruction) they make successive improved guesses by projecting and

89
Free Software for PET Imaging www.intechopen.combackprojecting the data between image and sinogram spaces.Iterative methods in ET, though leading to a much higher computational burden, have shown better performance than direct methods because (i) they take into account the discrete nature of the measured data, and (ii) due to their ability to incorporate a measurement or system model.This is achieved by means of the so-called transition or system matrix (SM).Algorithms in this category include the Algebraic Reconstruction Technique (ART) (see Kak & Slaney (1988)) and variations such as SART, MART, the Least Squares (LS), and generalizations such as Weighted Least Squares fit (WLS), and the penalized version (PWLS) (see Fessler (1994); Kaufman (1993)).In addition to the above mentioned features (i) and (ii) a special class of iterative algorithms called statistical iterative algorithms are able to incorporate (iii) a statistical model for the process of data acquisition (or noise model).The well known Maximum Likelihood Expectation Maximization (ML-EM) algorithm of Shepp & Vardi (1982) and its accelerated version Ordered Subsets EM (OSEM) of Hudson & Larkin (1994)  All in all, and according to Fessler (1994) a statistical iterative reconstruction algorithm can be regarded as made of five components: (i) a finite parametrization of the positron-annihilation distribution, e.g. its representation as a discretized image, (ii) a system model that relates the unknown image to the expectation of each detector measurement, (iii) a Statistical model for how the detector measurements vary around their expectations, (iv) an objective function that is to be maximized to find the image estimate, (v) a numerical algorithm, typically iterative, for maximizing the objective function, including specification of the initial estimate and a stopping criterion.

System matrix
The quality of an iterative reconstruction algorithm heavily relies on the above-mentioned system matrix (SM) (Rafecas, Boning, Pichler, Lorenz, Schwaiger & Ziegler (2004), Qi & Huesman (2005)).The introduction of system modeling techniques (i.e.detailed descriptions of the physical phenomena underlying the data acquisition process) in the generation of the SM improves the reconstruction both in terms of resolution and quantitative accuracy.The SM may be generated from measurements taken in the real system where the reconstruction is to be performed (Frese et al. (2003), Panin et al. (2006), Tohme & Qi (2009)).This approach has been succesfully incorporated within the clinical setting.However, while this method results in demonstrated improvements in image quality, it requires extensive and very accurate point source measurements (e.g. using a positioning robot).
A widely used approach to calculate the SM is to perform a Monte Carlo simulation.Monte Carlo integration can incorporate complex but interesting effects of the physics underlying PET data acquisition (see next section).However, Monte Carlo codes are complex and often quite time consuming, and they may produce noisy results if not monitored adequately.Thus, MC based integration might be impractical if the number of tubes of response (TORs) is too big, not enough computation is available or the setup of the scanner has to be changed often.
On the other hand, a number of analytical approaches have been proposed in the literature in order to compute the system matrix since the seminal work of Shepp & Vardi (1982).There,

90
Positron Emission Tomography -Current Clinical and Research Aspects www.intechopen.comtwo-dimensional (2D) angle of view and area of intersection models were used to approximate the geometric sensitivity of a PET scanner and also a more elaborated model including positron range effects was proposed.
The length of intersection model, a.k.a.ray-tracing, has efficient implementations such as the Siddon algorithm (Siddon (1985)) that has been applied to PET in Herman & Meyer (1993) and Zhao & Reader (2003) or the orthogonal distance-based ray-tracer of Aguiar et al. (2010).
The ray-tracing technique allows for on the fly calculation of the matrix elements thus avoiding SM storage problems.However, while ray-tracing is fast, the length of intersection is not a physically meaningful quantity representing the probability of detection and it is known to yield artifacts (i.e.missmatched projector/backprojector pairs).Similarly, the 3D volume of intersection (Ollinger & Goggin (1996), Scheins et al. (2006)) should be corrected somehow if one desires a reasonably accurate model incorporating the effects of radial distance to the center of the field of view.
The natural 3D generalization of the 2D angle of view model, the solid angle of view model has also been used to compute the geometric sensitivity of a scanner, either by approximate (Terstegge et al. (1996), Qi et al. (1998), Huesman et al. (2000), Soares et al. (2003), Markiewicz et al. (2005)) or exact calculations (de la Prieta et al. ( 2006), Iriarte et al. (2009)) or by a combination of several contributions (geometry, positron range, photon non-colinearity, inter-crystal scatter and penetration) in a factorized matrix (see Mumcuoglu et al. (1996), Qi et al. (1998), Rahmim et al. (2008) and the references therein) Interesting analytic 2D models taking into account the linear attenuation of a beam of gamma-rays impinging on a crystal scintillator have been proposed in Lecomte et al. (1984), Schmitt et al. (1988), Karuta & Lecomte (1992) and Selivanov et al. (2000).These models have been further developed and adapted for multilayer small-diameter PET scanners in Strul et al. (2003).
In spite of being sparse in nature, the calculation and efficient storage of the SM remains an extremely challenging task for currently available clinical tomographs, due to the large number of matrix elements (between 10 13 in small animal PET systems to 10 16 for a standard clinical human PET scanner) and storage requirements (on the orther of TeraBytes), so it needs especial manipulation techniques in real systems (Johnson et al. (1995), de la Prieta ( 2004), Rehfeld & Alber (2007), Ortuño et al. (2010)).This is the reason why prototyping languages, such as MATLAB, have not yet offered a solution for 3D realistic sized PET reconstruction (though some freely available MATLAB add-ons for 2D PET reconstruction can be found at http://www.eecs.umich.edu/~fessler/code/and in the MATLAB Central web page) In this sense, some researchers have shown renewed interest in high performance computing solutions such as PC clusters (Jones et al. (2006), Beisel et al. (2008)) and Graphic Processing Units (GPUs) (Herraiz et al. (2009), Zhou & Qi (2011)).
Different solutions to the various problems posed by the incorporation of such a matrix in the projection/backprojection steps of the iterative reconstruction algorithm are scattered throughout the literature.In practice, scanner manufacturers implement those algorithms in proprietary software packages that come with the workstation of the scanner equipment.
Although tremendous effort has been devoted to the development of strategies and code to generate the SM and incorporate it in the reconstruction procedures -see for instance ASPIRE (Fessler (1997)), FIRST (Herraiz et al. (2006)) and PRESTO (Scheins & Herzog (2008))-, to the 91 Free Software for PET Imaging www.intechopen.combest of our knowledge, not many truly free software packages are available to this end (see also section 5.6).

Software for Tomographic Image Reconstruction (STIR)
In this section we will review the STIR library (Thielemans et al. (2006)) This library evolved from the European Union funded PARAPET project, and was later extended by Hammersmith Immanet and made into an Open Source project.The software is licensed under the GPL, LGPL and PARAPET licenses (see the STIR Sourceforge site for details, Thielemans & al. (2011)).STIR is an object oriented library for reconstruction of 2D/3D PET data written in C ++ language.Let's see some of its features and practical considerations in further detail.

Installation
The installation of STIR should be straightforward for most Unix flavors: it is well known to work in AIX, Solaris and Linux.It can also be used in Windows versions using Cygwin (Cygwin (2011)).STIR requires a version of the C ++ boost libraries (The boost libraries ( 2011))) to be downloaded and installed in the system.Once this requirement is met one can download the STIR sources in a .zipcompressed file and then use the GNU make utility to compile the program to be run.The recommended compiler is GNU gcc but the use of other ones is also possible such as the free version of the Visual C ++ Compiler.
Some extra features are possible at compile time: • Parallel code with Open MPI (Open MPI (2011)) for the most relevant iterative algorithms and preliminary threaded code for some algorithms Further details guiding the user in the process of installation in specific architectures are provided in the User's Manual.

Running STIR programs
Most STIR programs accept a single parameter in the command line, which is usually optional:

> executable_name [parameter filename]
The parameter file is a text file which uses an Interfile-like syntax.It is composed of keywords, corresponding to the names of the various parameters, with the values entered next to them.Spaces and tabs are normally irrelevant.Parameters omitted from the parameter file are assigned a default value.If a parameter file is not passed to the executable, the user is prompted for the required information.

File formats
The STIR utility and reconstruction programs frequently need to read and write files of image and projection data.Some scanners produce list mode data, which is essentially a list of events.STIR provides utilities to use the list mode files, for example to convert them to sinograms.It is also possible to reconstruct images directly from list mode data, although this has not been tested very well as of yet STIR 2.1.Currently supported list mode formats are specific to the ECAT HR+ and ECAT EXACT 3D scanners.There are some unfinished classes available on the STIR web-site to read LMF format files, in conjunction with the LMF library.However, these are obsolete as the OpenGATE project distributes scripts to enable STIR to read LMF format files.

STIR reconstruction algorithms
The library implements the following algorithm list: OSMAPOSL is an ordered subset (OS) implementation of the One Step Late (OSL) algorithm of Green (1990), with various additional refinements (i.e Metz filter) and capabilities (see Jacobson et al. (2000) for a description of many details of the implementation.OSSPS is an OS implementation of the Paraboloidal Surrogate algorithm described in Ahn & Fessler (2003).
Although the OSMAPOSL can be regarded as a generalization of ML-EM, OSEM and MRP algorithms 1 the list is of STIR available algorithms is somehow expandable (see next section) The 'situation' is summarized in Table 2.
The STIR library offers the user some (limited) choices in the projector/backprojector pairs (such as linear or B-Spline interpolation in the backprojector) and also in the image filters (separable convolution median or separable cartesian Metz filter) and statistical Priors (quadratic, median root) of the iterative algorithms.

STIR utilities
The library includes a number of valuable and independent utilities allowing to display results (X Windows, PGM, MathLink) perform operations with images and sinograms, convert between data formats, filter and compare data, precorrection or uncorrection, scatter correction, kinetic modeling, add noise and perform different tests.

STIR: future developments
The future improvements of the library will presumably pursue the following lines • Add more automatic testing programs 1 i.e. those algorithms can be obtained by adjusting the regularization parameter λ and the number HS subsets N s .In short, λ = 0, N s = 0 for ML-EM, λ = 0, N s > 0 for OSEM, and λ > 0, N s = 0 for MRP PETRUS is a library that the author of this chapter is developing and will hopefully be released soon.PETRUS is intended to be efficient, versatile and portable and features both commercial and research multi-ring multi-block scanner modeling.It also incorporates original strategies for the management of the transition matrix at three different levels: compression, symmetries (de la Prieta ( 2004) and sensitivity modeling (de la Prieta et al. ( 2006)).

System modeling and simulation
In order to obtain the best performance of an imaging system it is desirable to have an accurate description of the physical phenomena underlying the process of data acquisition.Thus in PET, relevant models include -among others-geometric sensitivity, positron range, photon pair non-colinearity, Compton scatter in tissues, detector sensitivity, inter-crystal scatter and penetration and detector dead-times.Additionally, one may have some statistical models  Interestingly, system modeling plays a very important role in ET for optimizing detector design, configuration and materials (see Levin & Zaidi (2007) and Stickel & Cherry (2005))2 and for assesing acquisition and processing protocols, for example to study differences in image quality when using radionuclides with various positron ranges (Bai et al. (2005)) or properties that are not possible to measure directly like the behavior of scattered photons (Dewaraja et al. (2000)).Likewise, it is also a valuable tool in the design and assessment of correction and reconstruction methods (Zaidi & Koral (2004), Holdsworth et al. (2002)) and in the study of an imaging system response (Alessio et al. (2006)).System modeling, may also be used in the generation of the system matrix either by means of analytical calculations (see previous section) or by Monte Carlo computations (Rafecas, Mosler, Dietz, Pogl, Stamatakis, McElroy & Ziegler (2004), Alessio et al. (2006), Vandenberghe et al. (2006), Rahmim et al. (2008)).Finally, system modeling helps data production for evaluation purposes, for instance by using a digital phantom (see section 5.1) and in the description and validation of recently issued code.
In addition to the computationally more advantageous but perhaps more heterogeneous analytical approaches, Monte Carlo (MC) simulations have become a standard tool in ET (Zaidi (1999), Buvat & Castiglioni (2002), Buvat et al. (2005)) because of their ability to simultaneously model many complex processes and phenomena by statistical methods using random numbers.In a MC analysis of PET, a computer model is created with characteristics as similar as possible to the real imaging system.In this model the photon and charged particle interactions are simulated based on known probabilities of occurrence, with sampling of the probability density functions (PDFs) using uniformly distributed random numbers.The simulation is similar to a real measurement in that the statistical uncertainty decreases as the number of events increases, and therefore the quality of the reported average behavior improves.To evaluate the trajectories and energies deposited at different locations the radiation transport is simulated by sampling the PDFs for the interactions of the charged particles or photons.
General purpose MC software such as EGS4 (Nelson et al. (1985)), ITS (Jordan (1993)), MCNP (Briesmeister & Los Alamos National Laboratory (1986)) and Geant4 (Agostinelli et al. ( 2003)) have mainly been developed for high energy physics and include a complete set of particle and cross-section data up to several GeV.On the other hand, a number of libraries for MC simulation dedicated to SPECT and PET have been released in the last decade.These packages have been designed to solve problems for a specific type of imaging system and have improved its performance by using large optimization strategies such as the variance reduction methods.The major drawbacks may be the long computing times required for some applications and the limited flexibility when simulating different types of geometries.Examples of this software packages are SIMIND (Ljungberg & Strand (1989)), PETSIM (Thompson et al. (1992)), PET-SORTEO (Reilhac et al. (2004)) and PeneloPET (España et al. (2009)).However, two packages have become very popular among the PET community: SimSET (Lewellen et al. (1998), University of Washington, Division of Nuclear Medicine ( 2006)) and in recent years GATE (Jan et al. (2004),OpenGATE Collaboration (2011)).We will briefly review the main features of them and make some comparisons.

Geant4 Application for Tomography Emission and Radiotherapy (GATE)
In 2001, a workshop was organized in Paris about the future of MC simulations in nuclear medicine.From the discussions about the disadvantages of available software, it became clear that a new dedicated toolkit for tomographic emission was needed which could handle issues such as decay kinetics, detector dead times and patient movements.An object-oriented solution was preferred.The coding began with the Lausanne PET instrumentation group with help from several other physics and signal processing groups.A workshop was organized the year after to define the development strategy.In 2002, the first OpenGATE meeting took place in Lausanne, with the first live demonstration of the first version of GATE.Since then a number of new versions has been released and a user email list with currently more than 1200 subscribers is available.
GATE is based on the Geant4 Monte Carlo code (Agostinelli et al. ( 2003)) and uses its libraries to simulate particle transport.The basic idea with GATE is that the user should not need to carry out any programming, but instead employ an extended version of Geant4 script language.The program has a layered architecture with a core layer that defines the main tools and features of GATE in C ++ , an application layer with C ++ base classes and at the top, a user layer where the simulations are set up using command based scripts.One feature of GATE is the possibility of simulating time-dependent phenomena such as source kinetics and movements of geometries, for example patient motion, respiratory and cardiac motion, changes of activity distribution over time and scanner rotation.Geant4 does however require static geometries during a simulation.Because of the relatively short duration of a single event compared to a typical movement, this problem can be solved by dividing the simulation into short time steps and updating the geometries at every step.

Simulation architecture
GATE simulations are based on the execution of scripted commands gathered in macros.A simulation is generally divided into seven steps as follows: 1.The verbosity level is set for each simulation module.This means that it is possible to decide the amount of information about the simulation returned by the program.In the first step, the visualization options are also chosen.2. The geometries are defined.In this step, the geometry, denoted 'world', in which the simulation is going to take place is initially defined.After that the scanner and phantom geometries are defined.3.This step defines the detection parameters in the so called digitizer module.Here the characteristics of the system are prescribed such as energy and timing resolution.It is also possible to include dead time and other features related to the creation of the image.4. The physical processes are chosen for the simulation.This includes the choice of interactions library, enabling or disabling interaction effects and setting cut-off energy or range for secondary particle production. 5.The radioactive source is defined.This includes particle type, activity and half-life, source geometry, emission angle and source movement.A number of different imaging systems are available in GATE: (for example 'scanner', 'SPECThead', 'cylindricalPET', 'ECAT', 'CPET' and 'OPET').A system is defined as a family of geometries compatible with different data output formats.For cylindrical PET the available output formats are: ASCII, ROOT, RAW and list-mode (LMF).Other systems have different options.The purpose of system definition is to make the particle-in-detector interaction histories be processed realistically.

Source and physics
The radioactive source in a GATE simulation is defined by the radionuclide, particle type and position, direction of emitted radiation, energy and activity.The radioactive decay is performed by the Geant4 Radioactive Decay Module.There are two packages available to simulate electromagnetic processes: the standard energy package and the low energy package.The low energy package models photon and electron interaction down to 250 eV and includes Rayleigh scatter and provides more accurate models for medical application.To speed up the simulation, it is possible to set a threshold for secondary particle production.

The digitizer module
The digitizer chain simulates the electronics response of a sensitive detector, which are used to store information about particle interaction within a volume.The digitizer chain consists of some processing modules: the 'hit adder' that calculates the energy deposited in a sensitive detector by a given photon, the 'pulse reader' that adds pulses from a group of sensitive detectors yielding a pulse containing the total energy deposited in these detectors and assigned to the position of the largest pulse.There are also some modules wherein the user can define parameters such as energy resolution (the ability to sort photons of different energies), energy window (the energy span within which the photons will be registered), spatial resolution, time resolution (the ability to separate two events with regard to time), dead time and coincidence window (the time interval within which two detected photons will cause an event).

Output formats
Different output formats are available for different systems.The ASCII format is the simplest.It gives all information about the detected photons in a large text file.Each row corresponds to one event and includes information about event number, time of annihilation, positions of annihilation, scatter, energy deposition, detecting crystals and position.This output needs to be further processed to be useful, but GATE can automatically sort out coincidence events from single photon events.The ROOT format is also a very powerful output that can be analyzed by using special software.With this output it is easy to get histograms over distributions of the angles between the two annihilation photons, the energies of the positrons, the time stamps of the decays and the ranges of the positrons.For an 'ECAT' system a sinogram output is available.This output automatically stores the events in 2D sinograms.For a 'cylindricalPET' system, the list mode format (LMF), can be used with other software for image reconstruction.However, only singles can be stored by GATE, which means that coincidence events have to be paired together afterwards.The RAW output gives access to raw images of source position for singles or coincidences.This output should be used in addition to other formats.
GATE is a software for which it is easy to create complicated models of different tomographic systems, making it possible to build a realistic model if one has the correct and detailed manufacturer specifications of a scanner.A major drawback with GATE, as with other MC packages, is that simulation times can be very long, especially for complex situations with voxelized phantoms and sources (on the order of one week on a cluster of 60 computers for realistic simulation of a SM).The other drawback is that the output data files are large, on the order of GB.Compared to other existing dedicated MC software, such as SimSET, GATE seems to be able to handle more complex situations and therefore it is possible to do more realistic simulations.Although in the latest release of GATE (version 6.0.0) a couple of variance reduction methods are available, presumably more efforts will be made be to enhance the computational speed of the simulations.Finally, when using GATE it is also interesting to make use of enhanced data output formats, such as the ROOT output, in order to save disc storage space.

Simulation System for Emission Tomography (SimSET)
The SimSET package uses MC techniques to model the physical processes and instrumentation used in ET imaging.First released in 1993, SimSET has become a primary resource for many nuclear medicine imaging research groups around the world.The University of Washington Imaging Research Laboratory is continuing to develop SimSET, adding new functionality and utilities.
SimSET consists of different modules.The Photon History Generator (PHG) tracks the photons through the tomograph FOV and creates a photon history list with information about the photons reaching the camera.An object editor is used for definition of the activity and attenuation objects for the PHG.The collimator routine in SimSET is based on the 2D PET collimator that originally was implemented in the MC program PETSIM (Thompson et al. (1992)).The detector and binning modules are used to define Gaussian blurring of energy, and the photon events are then binned by combinations of number of scatters, axial position, angles and photon energy.The data are binned during the simulation run, but they can be reprocessed afterwards by the use of the photon history list.
The main advantages of GATE compared to SimSET are that GATE in contrast to SimSET can handle system dead time, random events, block detector geometries with distances between each crystal (SimSET can only handle continuous detector rings) and dynamic studies with time dependent processes.Unlike GATE, SimSET does not allow for MC simulation of the photon transport within the collimator and only includes an analytical model of the collimator response.

100
Positron Emission Tomography -Current Clinical and Research Aspects www.intechopen.com

Additional tasks
Once the PET data has been collected and reconstructed some common postprocessing tasks or additional analysis may be necessary.On the other hand, one might need to generate simulated data in order to test or compare different reconstruction algorithms.For the sake of completeness, we have compiled here information on several areas of potential interest for the PET imaging practice.Thus, in this section we include a little background and useful links to freely available resources on digital phantoms, postprocessing tasks such as segmentation, registration and statistical analysis of data and quality assessment.

Digital phantoms
Computer simulated phantoms, a.k.a.digital phantoms (as opposed to physical phantoms) offer a convenient way to examine different imaging protocols in medical and small-animal imaging research.Used in combination with accurate system models of the data acquisition process, phantoms can yield realistic imaging data to serve as a 'ground truth' from which molecular imaging devices and techniques can be evaluated and improved.

Evolution and types of digital phantoms
Existing phantoms can be divided into two general classes: voxel-based and geometry-based phantoms.Voxel-based phantoms, such as the Hoffman phantom (Hoffman et al. (1990)) and the Zubal phantom (Zubal et al. (1994)) are generally build on patient data.They may include anatomical and functional information from different medical imaging modalities.However, they are fixed to a particular anatomy, so that study of the effects of anatomical variations is limited.Also, they are fixed to a specific resolution so the generation of the phantom at other resolutions requires interpolation.
Geometry-based phantoms, a.k.a.mathematical phantoms, such as the Shepp-Logan phantom (Shepp & Logan (1974)), the NEMA phantom (National Electrical Manufacturers Association (NEMA) ( 2007)), or the Derenzo/Jaszczak phantom (Budinger et al. (1977)) permit, on the other hand, variations and data generation at multiple resolutions (see fig. 5).Although they are based in fairly simple geometric primitives such as spheres and ellipsoids they have found a widespread use to research new instrumentation, image acquisition strategies, and image processing and reconstruction methods during more than three decades.A slightly more realistic description of anatomical details was achieved with the ellipsoid-based (four-dimensional) 4-D Mathematical Cardiac-Torso (MCAT) phantom.In order to study the effects of patient involuntary motion in ET imaging, models for the beating heart and respiration were developed for the MCAT.These models extended the phantom to a fourth dimension: time.This phantom was made reasonably realistic but was not as realistic as voxel-based phantoms.
A new generation of hybrid phantoms focused on the creation of ideal models that sought to combine the realism of a patient-based voxelized phantom with the flexibility of a mathematical or stylized phantom.The use of rational B-splines (NURBS) as a new flexible mathematical basis allowed to move far beyond simple geometrically based phantoms toward a more ideal phantom combining the advantages of voxelized and mathematical models.In recent years and following the same guidelines, i.e. the combination of segmented patient data from actual imaging studies data with state-of-the-art computer graphics techniques, more precisely NURBS and subdivision surfaces (SDs), yet more realistic phantoms such as the 4-D extended Cardiac-Torso (XCAT) phantom and the Mouse Whole-Body (MOBY) phantom (Segars et al. (2004), figure 6) have been developed providing a level of realism comparable to that of a voxelized phantom.SDs are capable of modeling smooth surfaces of arbitrary topological type more efficiently, as is the case with complex anatomical structures of the body found in the brain and the interior of the breast.NURBS surfaces can only model such structures by partitioning the model into a collection of individual NURBS surfaces, which introduces a large number of parameters to define the model.SDs, on the contrary, initially represent an object as a coarse polygon mesh.This mesh can be iteratively subdivided and smoothed using a refinement scheme to produce a smooth surface.
With the improved anatomical detail and the extension to new areas, not only torso, the XCAT (with more than nine thousands of anatomical objects modeled over the entire human body) and MOBY phantoms are suitable for other medical imaging applications using nuclear medicine or high-resolution techniques such as CT or MRI.Additionally, these phantoms have the potential to open the door to the rapid development of hundreds of realistic patient-specific 4-D computational models.Such a library of computational models will presumably have widespread use in imaging research to develop, evaluate, and improve imaging devices and techniques and to investigate the effects of anatomy and motion.They will also provide vital tools in radiation dosimetry to estimate patient-specific dose and radiation risk and optimize dose-reduction strategies.For more detailed information on the

Digital phantom resources
Some useful links to freely available digital phantom resources are the following: The MC-ET database (Castiglioni et al. (2005)) is an interactive open to the public Internet-published database of MC simulated data for ET.Data can be easily downloaded directly from the web site http://www.ibfm.cnr.it/mcet/, after registering as an MC-ET user.Data sets for PET and SPECT include simulated MC data from simple mathematical phantoms, anthropomorphic phantoms as well as some data obtained from real patients where cerebral, thoracic and abdominal regions were considered.A detailed list of some computational human phantoms created to date is available in the website http://www.virtualphantoms.org/phantoms.htm

Registration
Registration is the task of aligning or developing correspondences between data.For example, in the medical environment, a CT scan may be aligned with an MRI scan in order to combine the information contained in both.Up to now, this task has renewed importance due to the active research that is taking place in PET/CT and PET/MRI systems.

AIR: Automatic Image Registration
This package (see http://www.loni.ucla.edu/Software/AIR)was developed by Robert P. Woods at UCLA as a tool for automated registration of 3D and 2D images within and across subjects and across imaging modalities.The AIR library can easily incorporate automated image registration into site specific programs adapted to any particular need.AIR source code written in C is available to the research community free of charge.The code can be compiled for UNIX, PC or Macintosh platforms.Only source code is available at the website http://bishopw.loni.ucla.edu/AIR5/(no executables).The software features: • Linear spatial transformation models: rigid-body models, global rescaling models, affine models and perspective models.It supports within-modality, across-modality and linear inter-subject registration • Nonlinear polynomial spatial transformation models ranging from first (linear) to twelfth order It also includes utilities for re-slicing, re-orienting, re-uniting, resizing and averaging and related and similar tasks.

Segmentation
Segmentation refers to the process of partitioning a digital image into multiple sets of voxels (segments).More precisely, image segmentation is the process of assigning a label to every voxel in an image such that voxels with the same label share certain visual characteristics.In Medical Imaging, segmentation is typically used to extract organs or body structures of interest from an initial image.Relevant applications include the location of tumors and other pathologies, measuring tissue volumes, computer-guided surgery, diagnosis, treatment planning and study of anatomical structure.

Insight Segmentation and Registration Toolkit (ITK)
ITK (http://www.itk.org) is an open-source, cross-platform system that provides developers with an extensive suite of software tools for image analysis.Developed through extreme programming methodologies, ITK employs cutting-edge algorithms for registering and segmenting multidimensional data.ITK uses the CMake build environment to manage the configuration process.The software is implemented in C ++ and it is wrapped for Tcl, Python (using CableSwig) and Java.This enables developers to create software using a variety of programming languages.ITK's C ++ implementation style is referred to as generic programming (i.e., using templated code).Such C ++ templating means that the code is highly efficient, and that many software problems are discovered at compile-time, rather than at run-time during program execution.
Some technical features of the package include: • Data representation and algorithms to perform segmentation and registration.The focus is on medical applications; although the toolkit is capable of processing other data types • Data representations in general form for images and meshes • The toolkit does not address visualization or graphical user interface.These are left to other toolkits (such as VTK, VisPack, 3DViewnix, MetaImage, etc.) • The toolkit provides minimal tools for file interface.Again, this is left to other toolkits/libraries to provide • Multi-threaded (shared memory) parallel processing is supported The development of the toolkit is based on principles of extreme programming.That is, design, implementation, and testing is performed in a rapid, iterative process.

Statistical analysis
Statistical analysis on image data has been a rapidly growing field in PET and in other functional imaging modalities such as fMRI with interesting applications to kinetic modeling and activation studies.

Statistical Parametric Mapping (SPM)
Statistical Parametric Mapping refers to the construction and assessment of spatially extended statistical processes used to test hypotheses about functional imaging data.These ideas have been instantiated in software that is called SPM.The SPM software package has been designed for the analysis of brain imaging data sequences.The sequences can be a series of images from different cohorts, or time-series from the same subject.The current release is designed for the analysis of fMRI, PET, SPECT, EEG and MEG.
SPM is made freely available to the neuro-imaging community (http://www.fil.ion.ucl.ac.uk/spm), to promote collaboration and a common analysis scheme across laboratories.The software represents the implementation of the theoretical concepts of Statistical Parametric Mapping in a complete analysis package.The SPM software is a suite of MATLAB (The MathWorks, Inc) functions and subroutines with some externally compiled C routines.SPM was written to organize and interpret functional neuroimaging data.SPM is an academic software toolkit for the analysis of functional imaging data, for users familiar with the underlying statistical, mathematical and image processing concepts.It is essential to understand these underlying concepts in order to use the software effectively.

SnPM
The Statistical nonParametric Mapping toolbox, available at http://www.sph.umich.edu/ni-stat/SnPM, provides an extensible framework for voxel level non-parametric permutation/randomization tests of functional Neuroimaging experiments with independent observations.The SnPM toolbox provides an alternative to the Statistics section of SPM.SnPM uses the General Linear Model to construct pseudo t-statistic images, which are then assessed for significance using a standard non-parametric multiple comparisons 105 Free Software for PET Imaging www.intechopen.comprocedure based on randomization/permutation testing.It is most suitable for single subject PET/SPECT analysis, or designs with low degrees of freedom available for variance estimation.In these situations the freedom to use weighted locally pooled variance estimates, or variance smoothing, makes the non-parametric approach considerably more powerful than conventional parametric approaches, as are implemented in SPM.Further, the non-parametric approach is always valid, given only minimal assumptions.

Quality assessment
In the area of image reconstruction, researchers often desire to compare two or more reconstruction techniques and asses their relative merits.SNARK09 provides a uniform framework in which to implement algorithms and evaluate their performance.This software is basically a programming system for the reconstruction of 2D images from 1D projections.It is designed to help researchers interested in developing and evaluating reconstruction algorithms.SNARK09 has been designed to treat both parallel and divergent projection geometries and can create test data for use by reconstruction algorithms.A number of frequently used reconstruction algorithms are incorporated.The software can be downloaded at Gabor T. Herman website (http://www.dig.cs.gc.cuny.edu/software/)

Miscellaneous
Some very interesting pieces of free and open source code can be found in the following locations:

Conclusions
A number of relevant free software applications for PET imaging (viewing, reconstruction, system modeling and postprocessing) as well as key references have been reviewed in this chapter suggesting that free software is a highly valuable option in PET imaging clinics and research practice.We also have provided useful links to specific free software packages and data that the reader might consider useful.

94
Positron Emission Tomography -Current Clinical and Research Aspects www.intechopen.com

98
Fig. 4. Screenshots of some PET systems modeled in GATE Fig. 5. Examples of geometry-based or mathematical phantoms: (a) Trans-axial slices trough a 3D version of the Shepp-Logan phantom (b) Bar phantom with added Poisson noisemanually segmented and co-registered and 3-D NURBS surfaces were fit to each segmented structure using NURBS modeling software to generate an anatomical atlas.Each surface shape can be altered easily via affine and other transformations.The shape is defined by a set of control points which form a convex hull around the surface.To alter the surface, one only has to apply transformations to these control points.With this flexibility, NURBS have the same ability to model anatomical variations and patient motion as a phantom.Since it was based on actual imaging data, the anatomy of the NCAT is much more realistic than that of the MCAT.

102
Positron Emission Tomography -Current Clinical and Research Aspects www.intechopen.com

Fig. 6 .
Fig. 6.The 4D MOBY hybrid phantom: (Left) Anterior view of the 4D MOBY phantom.(Middle) Cardiac and respiratory motions of the MOBY phantom.(Right) MicroCT and MicroSPECT images simulated using the phantom MCAT, NCAT, XCAT and MOBY phantoms the reader may consult Segars & Tsui (2009) and the references therein.

Table 1 .
Comparison of viewers features 88 Positron Emission Tomography -Current Clinical and Research Aspects www.intechopen.com Files formats are encountered in which data and header information 92 Positron Emission Tomography -Current Clinical and Research Aspects www.intechopen.comare maintained in separate files (e.g.interfile).In other formats, data files carry header information (e.g. the native GE Advance sinogram format).

Table 2 .
Reconstruction algorithms implemented by STIR • Add more algorithms: potentially ART, FORE and OSCB (the latter, based on the conjugate barrier method of Ben-Tal & Nemirovski (1999)) • Add more projectors/backprojector pairs and more priors • Extend the parallelization of OSMAPOSL and OSSPS to FBP3DRP, or use Open MPI (Open MPI (2011)) • Add compatibility of the interpolating backprojector with recent data processors of the library • Add more kinetic models: Spectral Analysis, Logan Plot

Table 3 .
Commercial PET systems modeled in GATE 4.1.2Imaging systems in GATE The NCAT, XCAT and MOBY phantoms are distributed free-of-charge to academic institutions by emailing the authors.Companies are also welcome to use them, but authors do charge a small licensing fee.Visit the Division of Medical Imaging at Johns Hopkins Medical Institutions web page http://dmip1.rad.jhmi.edu/xcat/for more information on how to obtain the phantoms.
Different versions (CT-based torso, CT-based head, MRI-based high-resolution head phantom) of the Zubal phantom data sets can be downloaded at http://noodle.med.yale.edu/zubal/.