www.gusucode.com > images 案例代码 matlab源码程序 > images/RecoverParallelbeamDataFromFanbeamDataExample.m
%% Recover Parallel-beam Data from Fan-beam Data % %% % Create synthetic parallel-beam data. ph = phantom(128); %% % Calculate the parallel beam transform and display it. theta = 0:179; [Psynthetic,xp] = radon(ph,theta); imshow(Psynthetic,[],... 'XData',theta,'YData',xp,'InitialMagnification','fit') axis normal title('Synthetic Parallel-Beam Data') xlabel('\theta (degrees)') ylabel('x''') colormap(gca,hot), colorbar %% % Convert the parallel-beam data to fan-beam. Fsynthetic = para2fan(Psynthetic,100,'FanSensorSpacing',1); %% % Recover original parallel-beam data. [Precovered,Ploc,Pangles] = fan2para(Fsynthetic,100,... 'FanSensorSpacing',1,... 'ParallelSensorSpacing',1); figure imshow(Precovered,[],... 'XData',Pangles,'YData',Ploc,'InitialMagnification','fit') axis normal title('Recovered Parallel-Beam Data') xlabel('Rotation Angles (degrees)') ylabel('Parallel Sensor Locations (pixels)') colormap(gca,hot), colorbar