Borrar filtros
Borrar filtros

Hi all! I have a question regarding matlab CT reconstruction package.

1 visualización (últimos 30 días)
I have downloaded CT reconstruction package but don't know how to use it with my code? i want to use myBackprojection.m file in it. i have copied the whole package to my project's folder. but now i don't know how to use it. plz help me out. here is the code of myBackprojection.m file
function BPI = myBackprojection(sinogram,thetas) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % unfiltered back projection -> schlegel & bille 9.1.2 % modified by: Mark Bangert % m.bangert@dkfz.de 2011
% figure out how big our picture is going to be. numOfParallelProjections = size(sinogram,1); numOfAngularProjections = length(thetas);
% convert thetas to radians thetas = (pi/180)*thetas;
% set up the backprojected image BPI = zeros(numOfParallelProjections,numOfParallelProjections);
% find the middle index of the projections midindex = floor(numOfParallelProjections/2) + 1;
% set up the coords of the image [xCoords,yCoords] = meshgrid(ceil(-numOfParallelProjections/2):ceil(numOfParallelProjections/2-1));
% loop over each projection for i = 1:numOfAngularProjections
% figure out which projections to add to which spots
rotCoords = round(midindex + xCoords*sin(thetas(i)) + yCoords*cos(thetas(i)));
% check which coords are in bounds
indices = find((rotCoords > 0) & (rotCoords <= numOfParallelProjections));
newCoords = rotCoords(indices);
% summation
BPI(indices) = BPI(indices) + sinogram(newCoords,i)./numOfAngularProjections;
% visualization on the fly
imagesc(BPI)
drawnow
end

Respuestas (0)

Categorías

Más información sobre File Operations en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by