Paper Title (use style: paper title)

Modeling and Simultaion of Cylindrical PET 2D
Using Direct Inversion Method
Drd. Ing. Valentin Stefanescu
Prof. Dr. Ing. Dan Alexandru Stoichescu
Department of electronics and IT (ETTI)
Polytechnics University of Bucharest
Bucharest, Romania
[email protected]
Department of electronics and IT (ETTI)
Polytechnics University of Bucharest
Bucharest, Romania
Prof. Dr. Christian Faye
Department of electronics and IT (ETTI)
Polytechnics University of Bucharest
Bucharest, Romania
Conf. Dr. Ing. Adriana Florescu
ETIS
Ecole Nationale Supérieure de l'Electronique et de ses
Applications
Abstract— Our purpose is to model the imaging process in 2D
PET imagery. More directly, considering a unit point source
located at point Mn and emitting pairs of opposite twin photons in
an isotropic way and a pair of non adjacent detectors (i, j) located
on the detector ring, our objective is to determine the proportion
of the flux emitted at point M n which jointly hits the detector pair
(i, j).
PET; Direct inversion, Tomography
I.
NEEDED NOTIONS
In order to fully understand the contents of this document
8
there are certain notions that need
to be fully understood:
Cylindrical PET 2D – is a type of tomograph that uses
positron emission in order to generate the tomograph images.
Te radioactive medium emits a number of twin photon pairs
6
that will be detected and then further interpreted by the
tomograph computer. So, the PET is a nuclear type of
tomograph that uses gamma rays (the emitted photons are
gamma rays)
4
5
3
E
2
II.
NOTATION AND GENERAL ASSUMTIONS
Ox, Oy the Cartesian coordinate frame centered on the origin.
RD
the radius of the detector ring
RM
the radius of the medium of interest ; typically RD/4 
RM  2RD/3
ND
the number of detectors on the detector ring ; ND is a
multiple of 8
4
6
Direct inversion method.[1] It is the method we suggest to
use in this document in order to realize the inversion from raw
data generated by the detector ring to an actual image that will
be displayed on the screen. This type of inversion process
replaces the Monte Carlo inversion used in actual PET 2D. The
purpose of replacing the Monte Carlo method is the fact that
this method needs less computing power in order to generate
the response. The simulations generated later will show the
efficiency of the method in an environment simulated very
close to a life-like environment (attenuation processes, natural
fluctuation and detector sensitivity are controllable as
parameters in the simulation)
7
NP
the number of potentially active detector pairs over
the ring. It depends on the ratio RM/RD;
2
F
Yn
Mn
8
A Xn
-5
1
C
B
9
16
10
15
-2

5
NS
ND
10 2


 N p  ND ND  3 
2

15
the number of discrete source points lying in the
medium of interest ; NS 

4
Nx  Ny
14
11
12
13
-4
Figure 1. Finding the detector pairs
-6
The work has been funded by the Sectoral Operational Programme
Human Resources Development 2007-2013 of the Romanian Ministry of
Labour, Family and Social Protection through the Financial
Agreement POSDRU/88/1.5/S/61178
-8
Nx, Ny the number of nodes along the x and y axis necessary
to cover the medium of interest.
NT
the total number of twin photon pairs emitted by the
whole medium towards the detector ring during the entire time
of exposure
KA
Idem for detector j
For edge 1 of detector i:
xi1  RD cos  i1
the scaling activity factor
yi1  RD sin  i1

the relative proportion of active area (or length) on
individual detector ; 0    1.

the angular offset of the detector ring, expressed in
detector step size clockwise ;  0 or 0.5
i, j
the index of the first and second element of
the pair of detectors ; 1  i and j  ND
Idem for edge 2 of detector i and for edge 1 and 2 of
detector j.
B.
Angular sectors associated with
detectors relative to the source point Mn
For edge 1 of detector i:
xn, yn
the Cartesian coordinates of the discrete
source point Mn
xi1  xn
cos
xi1, yi1
the Cartesian coordinates of first edge of the
detector i ; idem for detector j
 xi1  xn  +  yi1  yn 
2
(xi2, yi2)
the Cartesian coordinates of second edge of
the detector i ; idem for detector j
yi1  yn
sin
 xi1  xn 
6
2
+  yi1  yn 
GENERAL ASSUMPTIONS AND REQUIREMENTS
7
The medium of interest is a disc centered on the origin
O, whose radius cannot exceed 0.9 RD.
IV.
A.


COMPUTING DETECTOR RESPONSE
Polar azimuth  and Cartesian
coordinates (x, y) of active detector edges
For edge 1 and 2 of detector i:
 i1  
2i  1    2

,...i  1,...N D
ND

i 2  
2i  1    2
,...i  1,...N D 
ND

2
Mn
Yn
8
1
A Xn
-5
N
B
9
5
16
10
15
-2
14
11
12
The number of detectors on the detection ring is a
multiple of 8.

3
2
The discretizing grid is parallel with the x and y axis.
The x and y axis as well as the first and second
bisectors (  /4 or 3/4) are symmetry axis for the detector
ring and for the discretizing grid ; i.e. the origin O is a center of
symmetry.

4
6
The discretization
steps are constant
and identical
-15
-10
along the x and y directions.
2
4
The model is based on the following general assumptions
and/or requirements:
-

Idem for edge 2 of detector i and for edges 1 and 2 of
detector j.
5
III.

8
( i1, i2)
the azimuth of the first and second edges of
the detector i, as seen from the origin O with respect to the x
axis ; idem for detector j
(i1,  i2)
the azimuth of the first and second edges of
the detector i, as seen from the source point Mn with respect to
the x axis ; idem for detector j.
2
13
-4
Figure 2. Angular sectors for a given point
To determine the  angular sector common to detectors i
-6 less in opposite positions with
and j –which are located more or
respect to the source point Mn–, we have to “invert” one the
two sectors, which means taking its symmetrical template with
respect to point Mn. Doing this however, one must pay
attention to the discontinuity of-8 the function atan2 which will
be used to express the angle  from its sine and cosine
The atan2 (y, x) is the double argument function yielding
the angle over the range [0, 2] or [, ], when given its
sine y and cosine x defined over [1, 1]. It is most important
to know (and check !) where the used atan2 function shows its
discontinuity, either at   0 or at   . In most cases, it is 
 this varies between programming languages)
C.
Inverting the detector closest to the
 discontinuity point
To avoid possible problem with the discontinuity in 
modulo 2, among the detectors i and j we will choose to
“invert” the one which is the closest to the point of
discontinuity, either   0 or . This operation is more securely
done using the Cartesian coordinates.
Case 1 : the atan2 function shows its discontinuity at   
if (cos j1 cosj2)  (cos i1 cosi2) then multiply all
sines and cosines relative to j by 1 ; else multiply all sines and
cosines relative to i by 1.
Case 2 : the atan2 function shows its discontinuity at   0
if (cos j1 cosj2)  (cos i1 cosi2) then multiply all
sines and cosines relative to j by 1 ; else multiply all sines
and cosines relative to i by 1.
Then, whatever the location of the discontinuity in the
atan2 function, we take:
i1  atan2 (sin i1, cos i1)
Idem for edge 2 of detector i, and for edges 1 and 2 of
detector j.
ijn represents the response of the detector pair (i, j) to an
isotropic unit source point located at Mn.
E.
Optimizing the selection of
potentially active detector pairs
To reduce the computation time of the ijn response over
the (i, j) pairs, we will, for a given position of the source point
Mn and detector i, predetermine the domain [jmin, jmax] where
the j detector(s) forming a potentially active pair with detector i
rest(s).
jmin is the index of the detector in which rests the
intersection of the detector circle with the straight line joining
the source point Mn to the first edge (edge 1) of detector i. Idem
for jmax considering the second edge (edge 2) of detector i.
Following is the procedure for determining jmin.
Let us call  the straight line joining Mn to edge 1 of
detector i.
Case 1 (1 non // y axis): if xi1 xn  0, then
The equation of 1 in the Cartesian frame (Ox, Oy) is: y 
px  q
with: p 
D.
yi1  yn
and q  yn  p xn
xi1  xn
Determination of the detector
response
We can now express the proportion ijn of flux emitted at
Mn jointly hitting the i and j detectors.
The two intersections of the line 1 with the detector circle
are given by the resolution of the system:
For clarity sake, we will locally make use of the following
simplified notation:

- for detector i: a1  i1 and b1  i2
- for detector j: a2  j1 and b2  j2
The determination takes for granted two simple
assumptions regarding the ordering of the two edges on each
detector. Expressed in the above simplified notation, it is stated
like this: on each detector, a must precede b. That is: a1  b1
and a2  b2.
Normally, these two conditions are « automatically »
fulfilled. If they are not, the faulty pair(s) must be reordered so
as to match the above condition. In that case however, an indepth investigation will be carried out to determine the origin
of the mismatch.
Five cases are then distinguished to provide the ijn value:
if a2  a1 and a2  b1 and b2  b1, then ijn  (b1 – a2) / 
if a2  a1 and a2  b1 and b2  b1, then ijn  (b2 – a2) / 
if a1  a2 and a1  b2 and b1  b2, then ijn  (b2 – a1) / 
if a1  a2 and a1  b2 and b1 b2, then ijn  (b1 – a1) / 
else ijn  0.
 y  px  q  0 
 2
2
2
 x  y  RD  0

which leads to the second degree equation: x2 (p2 1) 2
pq x  q2  RD2  0, whose solutions are: x1,2 
 pq   
,
p2  1
where   p2 q2  (p2 1) (RD2 q2),
with the correponding y1,2 p x1,2  q.
The wanted (xmin, ymin) point is the one which differs from
the (xi1, yi1) associated with detector i.
if abs (x1  xi1) < .001 RD and abs (y1  yi1) < .001 RD,
then xmin  x2 and ymin  y2 ;
else xmin  x1 and ymin  y1.
The corresponding  azimuth being given by: min  atan2
(ymin, xmin).
Case 2 (1 // y axis): if xi1 xn  0, then min  atan2 (yi1,
xi1).
To cover the case of the atan2 function having its
discontinuity at    , the following final adjustement is
necessary:
if min  0, then min  min  2.
The same procedure applies to the determination of max by
simply using edge 2 instead of edge 1 of detector i, i.e.: xi1 
xi2 and yi1  yi2.
Finally, the j interval matching the i detector is defined by:
jmin  int (
1

 min
ND  ) 1 and jmax  int ( max ND  )
2
2
For a given detector i, only the detectors j belonging to the
interval [jmin, jmax] will be considered. This will provide a
significant reduction in the number of (i, j) pairs to be
evaluated, bringing it down from a priori NS ND (ND 3) to a
few NS ND.
F.
Taking into account the detector
width. The 2.5D correction
The previous modeling does 8not consider the situation in
the direction perpendicular to the detector ring. Hence the
detector width (perpendicular to the ring plane) is an irrelevant
data, which is not satisfactory from
the physical point of view.
6
To take into account the detector width, we have to introduce a
correction to the response given by equation 3.4.1. This new
model including width correction will
be called 2.5D.
4
V.
VECTOR FORMULATION
A.
Notations
s
the column vector representing the absolute medium
activity ; dim s  NS1
s
the column vector representing of the relative medium
activity ; dim s  NS1
u
the column vector representing the measurement
yielded by the detector ring. This vector is restricted to the set
of potentially active detector pairs ; dim u  NP 1 (see Note 4)
NS the number of discrete source points in the medium of
interest
NP the number of potentially active pairs over the
detector ring, i.e. the number of pairs (i, j) for which there is at
least one non zero response over the set of NS source points
lying in the medium of interest ;
NP  card {(i, j) such as  ijn  0 (strictly positive)}
n
NT the total number of twin photons pairs emitted by the
whole medium towards the detector ring during the time of
exposure ; typically ranging from 106 to 107
KA the activity scaling factor used to pass from the
relative activity s to the absolute activity s ;
KA  NT /  sn
2
n
Real rays
-10
Ideal line - perfectly flat detector
-5
n 10 the 1D index over
the set of discrete source points or
15
activity vector s (or s) ; n  1, … NS
5
Detector width
m the 1D index over the set of detector pairs or
observation vector u ; m  1, … NP (see Note 4)
-2
B.
-4
Figure 3. The 2.5D correction
Let us call Di and Dj the mean-6 distance between the source
point Mn and the detector i and j respectively, and Dmax the
maximum of those two.
It comes for detector i:
Formulation
The relation between relative and absolute activity is
simply: s KA s
Knowing the absolute activity vector s, the observation
process reduces to the tensor product:
-8
um  uij 

s
ijn n
(eq. 4.2.1)
n

Di 
1
2
xi1  xi 2  2 xn 2   yi1  yi 2  2 yn 2


idem for detector j
The 2.5D correction simply consists in multiplying the ijn
R
given by equation by the factor D ;
Dmax
 ijn 
u  H s,
where H is the observation matrix of dimension NPNS
defined by:
Dmax max (Di , Dj)

or in the vector form:
RD
  ijn 
Dmax

H(m, n)  mn   ijn
VI.
INVERSION AND RECONSTRUCTION PROCESS
The ultimate purpose of the study is to invert the
observation process by using direct inversion methods such as
least mean squares (LMS) in order to reconstruct an estimation
x of the activity s.
In its simplest form, this can be done by means of the LMS
inversion formula:
 max k  
 ;
N cond  abs


min

k 

 ... ...  
1
eigen values of the matrix HTH
x  (HTH)1HT u  R u
where HT denotes the transpose of the matrix H and
R(HTH)1HT is the reconstruction matrix.
For the problem to be solvable with no a priori, the number
NP of potentially active detector pairs must be greater than or at
least equal to the number of source points to be estimated, i.e.
NP  NS. In case of perturbations affecting the observation (see
§ 7), it is preferable than the dimension of u exceeds that of s
significantly (5 to 30 % seems realistic). The resolution leads to
the numerical inversion of the symmetrical square matrix HTH
of size NSNS.
k
Ns
set of
(eq. 5.1)
The closer Ncond is to the unity, the better the inversion. A
too large Ncond indicates a trend to non observability. In case of
effective non observability, Ncond is infinite because min (k) 
0.
In our inversion problem, the condition number only
depends on the observation matrix H, of which it is a major
characteristic and probably one of the best criterion to
appreciate its pertinence. It is of prime interest to track the
evolution of Ncond when modifying the model assumptions or
main parameters.
IX.
VII. APPLYING LOCAL AVERAGING TO THE DETECTOR
TESTS AND RESULTS
RESPONSE
The previous detector response was calculated for the
discrete node Mn, but it is actually supposed to represent the
response for the whole pixel (or voxel) centered on node M n.
To get a more realistic response applicable to the whole
pixel/voxel, we suggest to average in some way the response
ijn computed for the central node Mn, with the value obtained
for its four nearest neighbors in the x and y directions.
Let us denote by ij0 the “central” valueofij for node Mn
(ij0  ijn) and by ij1, ij2, ij3, ij4 the ij value for the four
nearest nodes surrounding Mn, along the x (1, 2) and y (3, 4)
axis.
The following averaging formula will be used:

 ijn
The first test is done on a test image source size 32x32
pixels which is reconstructed assuming that the medium
attenuation is not uniform (we assume that we have water in
the middle and bone on the sides of the 32x32 square)
Original Image
Reconstructed Image
2
2
4
4
6
6
8
8
10
10
12
12
14
14
5
10
15
5
Original Image Histogram
2
1
  ij 0   ij 0   ij1   ij 2   ij 3  
3
12

This process will be called the “pixel averaged” response
15
10
10
5
5
0
100
VIII. QUALITY OF THE RECONSTRUCTION PROCESS.
CONDITIONING OF THE PROBLEM
200
15
Reconstructed image histogram
15
0
10
0
300
0
100
200
300
Figure 4. First test
4
12
To assess quantitatively the quality of the reconstruction
process we will use as a criterion the mean quadratic error
between the reconstructed activity map x and the original one s,
that is:
x 10
10
8
6

1

NS
4
 (xn  sn )
2


2
n
0
0
The quality of inversion of any linear problem depends
almost entirely on its condition number Ncond , which is equal
to the absolute value of the ratio of its greatest over its lowest
eigen values.
10
20
30
40
50
Figure 5. Detector hit count for first test
60
Figure 7. Detector hit count – second test
We notice that the reconstruction is done quite well even
though the attenuation map was not close to what we had as a
source.
In order to have a proper measure of quality, we computed
the PSNR for the reconstructed image and also an error
expressed in percentage. The ideea was to compute for each
pixel the distance between the original pixel and the
reconstructed one based on a grayscale map of 256 levels.
In this case, the results were:
MSE = 0.87%
PSNR = 92,4329
These results are rather promising as far as the process
goes.
On the technical aspect of thing, several test were ran on a
multi-core platform and we can clearly see that this method
benefits from having massive parallel power. This kind of
algorithm is known as “embarrassingly parallel”
The results were:
MSE (mean square eror)= 1,0506%
PSNR = 58,5339db
Time/computing power
This goes to suggest that the attenuation map has little
influence over the reconstruction process. Weather this is true
or not, it can only be established by testing on real life data.
Original Image
nr of cores
The second test is run on the same image source but this
time we assume we have uniform attenuation all over the
attenuation map. The reconstruction is done exactly the same
as above:
00:39,0
4 Core
00:49,0
3 Core
2 Core
01:05,0
1 Core
02:00,0
Reconstructed Image
00:00,0
00:17,3
00:34,6
00:51,8
01:09,1
01:26,4
01:43,7
02:01,0
02:18,2
time elapsed
5
5
10
10
15
15
5
10
15
5
Original Image Histogram
15
10
10
5
5
0
100
200
10
15
Reconstructed image histogram
15
0
Figure 8. Execution time / nr of CPU cores
0
300
0
100
200
300
Figure 6. Reconstruction process – second test
4
12
x 10
The slowest part of the process is the computation of the
inverse matrix needed to reconstruct the image. In order to
overcome such a weak spot in the algorithm we have to either
improve the actual inversion process (standard matlab
functions were used for the inversion in the simulation) or to
skip doing the entire inversion. A possibility to do so would be
to use a Penrose-Moore[2] pseudo inverse matrix instead of the
true inverted matrix. Preliminary tests should this could be a
viable solution but no conclusive results could be presented (it
required working with larger images to be able to see any
decent results distributed computing systems and so, much
code optimizing was necessary)
REFERENCES
10
[1]
[2]
8
6
4
2
0
0
10
20
30
40
50
60
Prof. Dr. C. Faye – “Modeling 2D Cylindrical PET” (unpublished work)
Enrico Boasso - Moore-Penrose inverse and doubly commuting
elements in C*-algebras - REVISTA DE LA UNI´ON MATEM´ATICA
ARGENTINA Volumen 46, N´umero 2, 2005, P´aginas 35–44.