Wednesday, November 7, 2012

Learning Tomography: Adding Constraints



The computation time for iterative reconstruction techniques (IRT) is typically orders of magnitude longer than for Weighted (Filtered) Back-Projection algorithm [Link], however, IRT are powerful  because during the iteration process, you are able to add constraints to enhance convergence.


1- Non-negativity and box constraints

In most cases, having negative pixel values are non-sense during ART process, thus, it is easy to constrain the ART algorithm to clamp all the negative pixel values to zero. An extension of the latter is to restrain values between a minimum and a maximum.

In our script ART_simple.js, we only add a sixth step within the inner loop.

     //6- Add constraints
    IJ.run(rec, "Macro...", codeMin);
    IJ.run(rec, "Macro...", codeMax);


where codeMin and codeMax are respectively defined as

  var codeMin="code=[v=maxOf(v,"+min+")];";
  var codeMax="code=[v=minOf(v,"+max+")];";


Other parameters

Depending of the prior knowledge of the sample, you can add what you want to speed up the convergence or yield a better solution if you have a small number of projections, for example.
Here, we know that the sample is surrounded by a mask of radius=120.0. This can be injected as a new constraint.

   IJ.run(rec, "Macro...", "code=[if (d > 120.0) v=0.0;]");

2- Script and example

Here is the updated script ART_simple_constraints.js

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

From our reference sinogram [Link], this new script calculates Lena's portrait as shown in Fig.1.

Fig.1: Reconstruction calculated with 3 cycles, a relaxation factor of 0.33 and constraints (min=0.0, max=2.0, and radius=120.0).

Other crazybiocomputing posts

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

No comments:

Post a Comment