Professional Documents
Culture Documents
Actividad. Teorema Del Corte Central
Actividad. Teorema Del Corte Central
Campus Monterrey
08 / 04 / 2024
Open the Matlab simulation called “Fourier_slice_theorem”
1. Create the sinogram of the object.
a. Establish a range of angles (0 to 179) in variable angs.
b. Your object Will be the phantom from the previous activity, save it in initIm
c. With initIm and angs create the sinogram using the command radon, save in sino.
2. Take a single row of the sinogram (sino), be careful to take it in the row position, use the
iterator rowIndex and save it in curRow.
3. Calculate the 1D FT of the single projection.
a. Before applying the FT, change the phase using the ifftshift command
b. Applied the FT in one dimensión.
c. After applying the FT, change the phase again, now with the command fftshift
4. Place the FT in the center of the image.
a. Your image is settled in the variable imContrib, you need to identify the row in the
middle (hint: the size of the image is saved in diagDim, don’t forget to round), take
all the columns with :, and assign the FT to that row.
5. Accumulate the contributions in a single image.
a. Each iteration you’ll be accumulating each contribution (imContrib) in the variable
fimg
Matlab Code:
% Reconstructing a tomogram through the Fourier slice theorem
% rather than filtered back projection
clear; close all
figure('units','pixels','position',[0 0 1920 1080],'ToolBar','none');
set(0,'defaultfigurecolor',[1 1 1]);
xyR = 9/16;
pos1 = [0.15*xyR 0.8 0.4*xyR 0.2]; % Subplot position for incident x-rays
pos2 = [0.15*xyR 0.4 0.4*xyR 0.4]; % Subplot position for rotating phantom
pos3 = [0.15*xyR 0.36 0.4*xyR 0.03]; % Subplot position for sinogram row
pos4 = [0.15*xyR 0.29 0.4*xyR 0.06]; % Subplot position for FT arrow
pos5 = [0.15*xyR 0.0 0.4*xyR 0.28]; % Subplot position for FT plot
pos6 = [0.64*xyR 0.05 0.9*xyR 0.9]; % Subplot position for polar FT plot
myGold = [0.9 0.77 0];
myBlue = [0.4 0.44 0.73];
xRayArrowX = [-1 1 1 0 -1 -1];
xRayArrowY = [1 1 0.5 0 0.5 1];
% Rotation angles 0, 1, 2... 179
angs = 0:179;
initIm = phantom(256); % Initial phantom
sino = radon(initIm,angs); % Create a sinogram using radon transform
% This step is necessary, so that frequency information is preserved: pad
% the sinogram with zeros so that this is ensured
sino = padarray(sino,floor(size(sino,1)/2),'both');
% Rotate the sinogram 90 degrees to be compatible with code's definition of
% view angle and radial positions
% dimension 1 -> view angle
% dimension 2 -> radial position
sino = sino';
% diagDim = length of an individual row of the sinogram
diagDim = size(sino,2);
ftTot = zeros(180,3,diagDim); % For each angle, the x, y, and intensity
% values in Fourier space. Initially zeros
c = colormap(jet(diagDim));
% Initialize 2D Fourier transform of our final image as a matrix of zeros
fimg = zeros(diagDim);
% 1D V-shaped ramp filter with zero value at zero frequency. This
% suppresses low-frequency components and passes high-frequency components,
% thus reducing blurring due to the overlapping of the Fourier-transformed
% images in the low frequency region
rampFilter_1d = abs(linspace(-1, 1, diagDim))';
rowIndex = 1;
for nn = angs
% ******* Maths part *********
imContrib = zeros(diagDim);
% Take the 1D-FT of the current row - be careful; one needs to perform
% first ifftshift and fftshift, as Matlab tends to place zero-frequency
% components of a spectrum at the edges
fourierCurRow = fftshift(fft(ifftshift(curRow)));
% Top left: draw rotating original object being irradiated from above
subplot('position',pos2);
newplot
hold on
rotIm = imrotate(initIm,-nn,'crop');
imshow(rotIm,[]);
axis equal
hold on
caxis([min(min(log(abs(fimg)))),max(max(log(abs(fimg))))]);
axis off
axis equal
view(0,90);
Screenshot:
Se realizan animaciones para mostrar la acumulación de componentes de Fourier y la reconstrucción
gradual de la imagen final. Las imágenes generadas muestran el proceso completo de reconstrucción
de una imagen médica a partir de datos de proyección utilizando tomografía computarizada,
incluyendo la adquisición de datos, la transformación de Fourier y la reconstrucción de la imagen
final.