function [ct] = backProject(rays,phis,dim,fltr) sz = size(rays) ct = []; for i = 1:dim(1) for j = 1:dim(2) superpositive = 0; for phi = 1:sz(1) dimensions = [length(rays{phi}) length(rays{phi})]; ray = rays{phi}; if(fltr==1) ray = conv(ray,RamLak(15)); ray = crop1D(ray,dimensions(2)); elseif(fltr==2) ray = conv(ray,SheppLogan(9)); ray = crop1D(ray,dimensions(2)); else ray = ray; end Po = [-dimensions(2)/2; -dimensions(1)/2]; Pt = [dimensions(2)/2; -dimensions(1)/2]; index = footDist([(j-1)-(dim(2)/2),(dim(1)-(i-1))-(dim(1)/2)],Po,Pt,phis(phi)); %subIndex = floor(index); subIndex = max(1,min(dimensions(2),double(floor(index)))); superIndex = min(dimensions(2),subIndex+1); %superIndex = subIndex+1; subDiff = norm(index-subIndex); superDiff = norm(index-superIndex); if(subDiff < superDiff) newValue = ray(subIndex); else newValue = ray(superIndex); end superpositive = superpositive + newValue; end ct(i,j)=superpositive; end i end