Friday, March 8, 2013

Learning Tomograhy: New version of back projection



In this series Learning Tomography, I mentioned a backProjImproved.js script in several posts to compute a 2D reconstruction according to the backprojection technique.... Unfortunately, I have never published it. Here it  is...


1- Script

This is exactly the same algorithm as those described [here].

The differences are:
  • Pre-computation of the angles (lines #20-24).
  • In the main loop, the methods of ImageJ API are used rather than the equivalent plugins...
    • Extraction of the row by ImageProcessor.crop().
    • Use of the methods ImageProcessor.resize(...) and ImageProcessor.rotate(...) instead of the plugins Image>Adjust>Size... and Image>Transform>Rotate...

Now the script looks like...

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

Note: This script is the core of the script used for 3D reconstruction [Link].

2- Result

The procedure is exactly the same and is divided in four steps.
  • First, download our test image − the sinogram of Lena [Link] (or [Link] and choose in Tomography section, the image entitled "32-bit sinogram in TIFF" ) − and open it in ImageJ.
  • Second, create  a 32-bit 256x256 image entitled "rampFilter" with a black background and in Process>Math>Macro..., type the following formula:
  • if (d > 120.0) v=0.0; else v=d;
  • Third, apply this ramp filter to the sinogram with Process > FFT > Custom Filter and choose "rampFilter".
  • Fourth, run the script from the filtered sinogram and Lena is reconstructed (Fig. 1).

Fig.1: Pipeline of 2D reconstruction. From the sinogram, 
Note: If you experience some trouble with the custom filter, try to pad the 256x180 sinogram in a larger canvas (for example, 512x180 with Image > Adjust> Canvas Size...) and then, apply the ramp filter and finally, run the script.


Thank you for reading this post and feel free to add any comment or suggestion below.

Other crazybiocomputing posts

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

No comments:

Post a Comment