F = fanbeam(I,D)
F = fanbeam(..., param1, val1, param1, val2,...)
[F, fan_sensor_positions, fan_rotation_angles] = fanbeam(...)
F = fanbeam(I,D) computes
the fan-beam projection data (sinogram)
D is the distance in pixels from the fan-beam
vertex to the center of rotation. The center of rotation is the center
pixel of the image, defined as
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
The following figure illustrates D in relation to the fan-beam vertex
for one fan-beam geometry. See the
for more information.
Each column of
F contains the fan-beam sensor
samples at one rotation angle. The number of columns in
determined by the fan rotation increment. By default, the fan rotation
increment is 1 degree so
F has 360 columns.
The number of rows in
F is determined by
the number of sensors.
fanbeam determines the number
of sensors by calculating how many beams are required to cover the
entire image for any rotation angle.
For information about how to specify the rotation increment
and sensor spacing, see the documentation for the
F = fanbeam(..., param1, val1, param1,
val2,...) specifies parameters, listed below, that control
various aspects of the fan-beam projections. Parameter names can be
abbreviated, and case does not matter.
'FanRotationIncrement' -- Positive real scalar
specifying the increment of the rotation angle of the fan-beam projections.
Measured in degrees. Default value is 1.
'FanSensorGeometry' -- Positioning of sensors,
specified as the value
'arc' geometry, sensors are spaced equally
along a circular arc, as shown below. This is the default value.
'line' geometry, sensors are spaced equally
along a line, as shown below.
'FanSensorSpacing' -- Positive real scalar
specifying the spacing of the fan-beam sensors. Interpretation of
the value depends on the setting of
'FanSensorGeometry' is set to
default), the value defines the angular spacing in degrees. Default
value is 1. If
the value specifies the linear spacing. Default value is 1
This linear spacing is measured on the x' axis.
The x' axis for each column,
F is oriented at fan_rotation_angles
counterclockwise from the x-axis. The origin of both axes is the center
pixel of the image.
[F, fan_sensor_positions, fan_rotation_angles]
= fanbeam(...) returns the location of fan-beam sensors
in fan_sensor_positions and the rotation angles where the fan-beam
projections are calculated in fan_rotation_angles.
default), fan_sensor_positions contains the fan-beam spread angles.
fan_sensor_positions contains the fan-beam sensor positions along
the x' axis. See
I can be
logical or numeric.
All other numeric inputs and outputs can be
None of the inputs can be sparse.
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 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')
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 larger,
D is larger,
and for points closer to the middle of the image, away from the edges.
 Kak, A.C., & Slaney, M., Principles of Computerized Tomographic Imaging, IEEE Press, NY, 1988, pp. 92-93.