Monday, November 5, 2012

Learning Tomography: ART (Part II)



 After introducing the principle of ART according to Kaczmarz method in the last post [Link], it's time to implement it in ImageJ with JavaScript language...


1- Implementation

In ImageJ, the ART implementation is really simple as the projection computation is done by the Plot Profile function. The algorithm is schematically:

for each iteration
  for each row of sinogram
    p ← row;
    a ← calc_projection(rec, angle);
    err ← (p - a)* λ;
    rec  ← rec + err;
  end for
end for

There is something new compared to the previous post: the relaxation factor λ (lambda) whose value is comprised between 0.0 and 1.0. This parameter allows to modify the convergence speed. A small value yields a more precise solution with a slow convergence. However, a value close to 1.0 allows a higher speed at the expense of quality

+++ IJ JavaScript snippet: ART_simple.js +++ +++ End of JavaScript snippet +++

2-Results

To try the previous script, I use the sinogram of Fig. 1 that you can download [Link] as a TIFF 32-bit image without any compression.

Fig.1: Sinogram used to try the ART script.
Open the sinogram and the ART_simple.js script and run it with Macros > Run Macros ... The image of Fig.2 is then created.
Fig.2: Resulting 2D ART reconstruction

Note: If you want to see this script in action uncomment line #27 // rec.show();

It's also possible to see the result of the reconstruction after each iteration  since they are stored in the stack 'Rec2D_Cycles' as shown in Fig.3.
Fig.3: Results of the reconstruction along the five cycles.

In this kind of iterative techniques, the low frequencies appear in the first cycles and then the high frequencies (details and noise) are represented. In the gallery of Fig. 3, Lena appears blurred (mainly composed of low frequencies) and then, the details (high frequencies) are appearing.

Playing with ART parameters

By default, the ART is calculated for 5 cycles and a relaxation factor  of 0.33. However, you can easily modify the iterations number (line #6: var nbCycles=5;) and the relaxation factor  (line #7: var relax=0.33;)


Other crazybiocomputing posts

Further readings are available in ...
  • Learning Tomography Series  [Link]
  • Image Processing TOC [Link]

No comments:

Post a Comment