Compute Fan-beam Projections for Rotation Angles Over Entire Image
Set the IPT preference to make the axes visible.
Create a sample image and display it.
ph = phantom(128); imshow(ph)
Calculate the fanbeam projections and display them.
[F,Fpos,Fangles] = fanbeam(ph,250); figure imshow(F,,'XData',Fangles,'YData',Fpos,... 'InitialMagnification','fit') axis normal xlabel('Rotation Angles (degrees)') ylabel('Sensor Positions (degrees)') colormap(gca,hot), colorbar
Compute Radon and Fan-beam Projections and Compare Results
Compute fan-beam projections for 'arc' geometry.
I = ones(100); D = 200; dtheta = 45; [Farc,FposArcDeg,Fangles] = fanbeam(I,D,... 'FanSensorGeometry','arc',... 'FanRotationIncrement',dtheta);
Convert angular positions to linear distance along x-prime axis.
FposArc = D*tan(FposArcDeg*pi/180);
Compute fan-beam projections for 'line' geometry.
[Fline,FposLine] = fanbeam(I,D,... 'FanSensorGeometry','line',... 'FanRotationIncrement',dtheta);
Compute the corresponding Radon transform.
Display the three projections at one particular rotation angle. Note the three are very similar. Differences are due to the geometry of the sampling, and the numerical approximations used in the calculations.
figure idx = find(Fangles==45); plot(Rpos,R(:,idx),... FposArc,Farc(:,idx),... FposLine,Fline(:,idx)) legend('Radon','Arc','Line')
I — Input image
2-D numeric matrix | 2-D logical matrix
Input image, specified as a 2-D numeric matrix or 2-D logical matrix.
D — Distance from fan beam vertex to center of rotation
Distance in pixels from the fan beam vertex to the
center of rotation, specified as a positive number.
The center of rotation is the center pixel of the
image, defined as
D must be large enough to
ensure that the fan-beam vertex is outside of the
image at all rotation angles. See Tips for guidelines on specifying
Specify optional pairs of arguments as
the argument name and
Value is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name in quotes.
F — Fan-beam projection data
Fan-beam projection data, returned as a
numeric matrix. numSensors is the
number of fan-beam sensors and
numAngles is the number of
fan-beam rotation angles. Each column of
F contains the fan-beam
sensor samples at one rotation angle.
numAngles by calculating how
many rotation angles are required to span 360
degrees using an angular spacing of
numSensors by calculating how
many beams are required to cover the entire image
for any rotation angle. Fewer sensors are required
to cover the image when the distance
D between the fan-beam vertex
and the center of rotation is large.
fanSensorPos — Location of fan-beam sensors
Location of fan-beam sensors, returned as a numSensors-by-1 numeric vector.
fanRotAngles — Rotation angle of fan-beam sensors
Rotation angle of fan-beam sensors, returned as a 1-by-numAngles numeric vector.
As a guideline, try making
D a few pixels larger than
half the image diagonal dimension, calculated as follows.
sqrt(size(I,1)^2 + size(I,2)^2)
The values returned in
F are a numerical approximation of
the fan-beam projections. The algorithm depends on the Radon transform,
interpolated to the fan-beam geometry. The results vary depending on the
parameters used. You can expect more accurate results when the image is
D is larger, and for points closer to the
middle of the image, away from the edges.
. pp. 92-93.