Convert fanbeam projections to parallelbeam
uses namevalue pairs to control aspects of the data conversion. Argument names can be
abbreviated, and case does not matter.P
= fan2para(F
,D
,Name,Value
)
[
returns the parallelbeam sensor locations in P
,parallel_sensor_positions
,parallel_rotation_angles
] = fan2para(___)parallel_sensor_positions
and rotation angles in parallel_rotation_angles
.
Create synthetic parallelbeam 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 ParallelBeam Data') xlabel('\theta (degrees)') ylabel('x''') colormap(gca,hot), colorbar
Convert the parallelbeam data to fanbeam.
Fsynthetic = para2fan(Psynthetic,100,'FanSensorSpacing',1);
Recover original parallelbeam data.
[Precovered,Ploc,Pangles] = fan2para(Fsynthetic,100,... 'FanSensorSpacing',1,... 'ParallelSensorSpacing',1); figure imshow(Precovered,[],... 'XData',Pangles,'YData',Ploc,'InitialMagnification','fit') axis normal title('Recovered ParallelBeam Data') xlabel('Rotation Angles (degrees)') ylabel('Parallel Sensor Locations (pixels)') colormap(gca,hot), colorbar
F
— Fanbeam projection dataFanbeam projection data, specified as a numeric matrix. Each column of
F
contains the fanbeam data at one rotation angle. The number of
columns indicates the number of fanbeam rotation angles and the number of rows
indicates the number of fanbeam sensors.
Data Types: double
 single
D
— Distance from fan beam vertex to center of rotationDistance in pixels from the fan beam vertex to the center of rotation, specified as
a positive number. fan2para
assumes that the center of rotation is
the center point of the projections, which is defined as
ceil(size(F,1)/2)
. The figure illustrates D
in
relation to the fanbeam vertex for one fanbeam projection.
Data Types: double
 single
Specify optional
commaseparated pairs of Name,Value
arguments. Name
is
the argument name and Value
is the corresponding value.
Name
must appear inside quotes. You can specify several name and value
pair arguments in any order as
Name1,Value1,...,NameN,ValueN
.
P = fan2para(F,D,'FanRotationIncrement',5)
'FanCoverage'
— Range of fanbeam rotation'cycle'
(default)  'minimal'
Range of fanbeam rotation, specified as the commaseparated pair consisting of
'FanCoverage'
and one of these values.
'cycle'
— Rotate through the full range [0, 360)
degrees.
'minimal'
— Rotate through the minimum range necessary
to represent the object.
'FanRotationIncrement'
— Fanbeam rotation angle increment1
(default)  positive scalarFanbeam rotation angle increment in degrees, specified as the commaseparated pair
consisting of 'FanRotationIncrement'
and a positive scalar.
Data Types: double
'FanSensorGeometry'
— Fanbeam sensor positioning'arc'
(default)  'line'
Fanbeam sensor positioning, specified as the commaseparated pair consisting of
'FanSensorGeometry'
and one of the following
values.
Value  Meaning  Diagram 

 Sensors are spaced at equal angles along a circular arc at
distance
 
 Sensors are spaced at equal distances along a line that is
parallel to the x' axis. The closest sensor
is distance

'FanSensorSpacing'
— Fanbean sensor spacing1
(default)  positive scalarFanbean sensor spacing, specified as the commaseparated pair consisting of
'FanSensorSpacing'
and a positive scalar.
If FanSensorGeometry
is 'arc'
,
then FanSensorSpacing
defines the angular spacing in
degrees.
If FanSensorGeometry
is 'line'
,
then FanSensorSpacing
defines the linear distance
between fanbeams, in pixels. Linear spacing is measured on the
x' axis.
Data Types: double
'Interpolation'
— Type of interpolation'Linear'
(default)  'nearest'
 'spline'
 'pchip'
Type of interpolation used between the parallelbeam and fanbeam data, specified
as the commaseparated pair consisting of 'Interpolation'
and one
of these values.
'nearest'
— Nearestneighbor
'linear'
— Linear (the default)
'spline'
— Piecewise cubic spline
'pchip'
— Piecewise cubic Hermite (PCHIP)
'ParallelCoverage'
— Range of parallelbeam rotation'halfcycle'
(default)  'cycle
Range of parallelbeam rotation, specified as the commaseparated pair consisting
of 'ParallelCoverage'
and one of these values.
'cycle'
— Parallel data covers the full range of [0, 360)
degrees.
'halfcycle'
— Parallel data covers [0, 180)
degrees.
'ParallelRotationIncrement'
— Parallelbeam rotation angle incrementParallelbeam rotation angle increment in degrees, specified as the
commaseparated pair consisting of 'ParallelRotationIncrement'
and
a positive scalar k such that
180/
k is an integer. If you do not specify
ParallelRotationIncrement
, then the default value is equal to
FanRotationIncrement
.
Data Types: double
'ParallelSensorSpacing'
— Parallelbeam sensor spacingParallelbeam sensor spacing in pixels, specified as the commaseparated pair
consisting of 'ParallelSensorSpacing'
and a positive scalar. The
range of parallelbeam sensor locations is computed from the range of fan angles,
fanangles, according to: [
.D
*sin(min(fanangles))
D*sin(max(fanangles))]
If you do not specify ParallelSensorSpacing
, then the spacing
is assumed to be uniform and is set to the minimum spacing implied by the fan angles
and sampled over the range implied by the fan angles.
Data Types: double
P
— Parallelbeam projection dataParallelbeam projection data, returned as a numeric matrix. Each column of
P
contains the parallelbeam data at one rotation angle. The number
of columns indicates the total number of parallelbeam rotation angles and is equal to
the length of parallel_rotation_angles
. The number of rows
indicates the total number of parallelbeam sensors and is equal to the length of
parallel_sensor_positions
.
Data Types: double
parallel_sensor_positions
— Parallelbeam sensor locationsParallelbeam sensor locations, returned as a numeric column vector.
Data Types: double
parallel_rotation_angles
— Parallelbeam rotation anglesParallelbeam rotation angles, returned as a numeric row vector.
Data Types: double
A modified version of this example exists on your system. Do you want to open this version instead?
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
Select web siteYou can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.