The Direct Fourier Reconstruction (DFR) implementation previously published (Part II: [Link]) works correctly. However, the polar to cartesian conversion is not very efficient because there are missing pixels in the 2D Fourier space. Modifying the source code can easily fixed this problem...
The basic implementation is not perfect because when the 2D Fourier space is filled by the 1D-FT of each sinogram row, some pixels are not filled as shown in Fig. 1 displaying the coverage of the 2D Fourier space.
Fig.1: Fill of the 2D Fourier space. As shown in the red zoomed area (B), missing pixels (displayed in black) are never filled by the values of the 1D-FTs during the polar to cartesian conversion. |
<< Figure >>
The synopsis written in pseudo-code now becomes...
for x=0 to 2DFT_space.height
for y=0 to 2DFT_space.width
{radius,theta} = compute_polar_coordinates_from(x,y)
value = getInterpolatedPixel(radius,theta,FT_sinogram)
2DFT_space.setPixel(x,y,value)
end for
end for
The conversion of the cartesian coordinate (x,y) to polar (ρ,θ) is defined by the following formula:
ρ = √(x2+y2) with ρ ∈ [0; +maxRadius]Finally, we have to check that the polar coordinates (ρ,θ) are comprised in the range [0;width[ and [0,height[ of the sinogram, respectively.
θ = atan2(y,x) with θ ∈ ]-π; π]
The corresponding lines of code are ...
var theta = -Math.atan2(yc,xc) * DEG;
var rad = Math.sqrt(xc * xc + yc * yc);
if (theta < 0 ) {
rad = -rad;
theta=Math.min(theta+180.0,180.0);
}
Finally, the new JavaScript implementation is ...
+++ IJ JavaScript snippet: FourierRec.js +++
+++ End of IJ JavaScript snippet +++
Thanks to this new implementation, it is now possible to improve the type of interpolation scheme.
To be continued...
<< Previous: Zero padding
Next:Better interpolation scheme >>
No comments:
Post a Comment