para2fan
Convert parallel-beam projections to fan-beam
Description
converts the parallel-beam data F
= para2fan(P
,D
)P
to the fan-beam data
F
. Each column of P
contains the parallel-beam
sensor samples at one rotation angle. D
is the distance from the
fan-beam vertex to the center of rotation.
The parallel-beam sensors are assumed to have a one-pixel spacing. The parallel-beam rotation angles are spaced equally to cover [0, 180] degrees. The calculated fan-beam rotation angles have the same spacing as the parallel-beam rotation angles, and cover [0,360) degrees. The calculated fan-beam angles are equally spaced with the spacing set to the smallest angle implied by the sensor spacing.
uses name-value arguments to control aspects of the data conversion.F
= para2fan(P
,D
,Name,Value
)
[
returns the fan-beam sensor locations in F
,fanSensorPos
,fanRotAngles
]
= para2fan(___)fanSensorPos
and rotation
angles in fanRotAngles
.
Examples
Convert Parallel-beam Projections to Fan-beam Projections
Generate parallel-beam projections
ph = phantom(128); theta = 0:180; [P,xp] = radon(ph,theta); imshow(P,[],'XData',theta,'YData',xp,'InitialMagnification','fit') axis normal title('Parallel-Beam Projections') xlabel('\theta (degrees)') ylabel('x''') colormap(gca,hot), colorbar
Convert to fan-beam projections
[F,Fpos,Fangles] = para2fan(P,100); figure imshow(F,[],'XData',Fangles,'YData',Fpos,'InitialMagnification','fit') axis normal title('Fan-Beam Projections') xlabel('\theta (degrees)') ylabel('Sensor Locations (degrees)') colormap(gca,hot), colorbar
Input Arguments
P
— Parallel-beam projection data
numeric matrix
Parallel-beam projection data, specified as a numeric matrix. Each column of
P
contains the parallel-beam data at one rotation angle. The
number of columns indicates the number of parallel-beam rotation angles and the number
of rows indicates the number of parallel-beam sensors.
Data Types: double
| single
D
— Distance from fan beam vertex to center of rotation
positive number
Distance in pixels from the fan beam vertex to the center of rotation, specified as
a positive number. para2fan
assumes that the center of rotation is
the center point of the projections, which is defined as
ceil(size(F,1)/2)
. The value of D
must be
greater than or equal to
. The figure illustrates ParallelSensorSpacing
*(size(P,1)-1)/2D
in relation to the
fan-beam vertex for one fan-beam projection.
Data Types: double
| single
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
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.
Example: F = para2fan(P,D,FanRotationIncrement=5)
specifies a fan
rotation increment of 5 degrees.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: F = para2fan(P,D,"FanRotationIncrement",5)
specifies a fan
rotation increment of 5 degrees.
FanCoverage
— Range of fan-beam rotation
"cycle"
(default) | "minimal"
Range of fan-beam rotation, specified as "cycle"
or
"minimal"
.
"cycle"
— Rotate through the full range [0, 360) degrees."minimal"
— Rotate through the minimum range necessary to represent the object.
FanRotationIncrement
— Fan-beam rotation angle increment
positive scalar
Fan-beam rotation angle increment in degrees, specified as a positive scalar.
If
FanCoverage
is"cycle"
, then360/FanRotationIncrement
must be an integer.If you do not specify
FanRotationIncrement
, then the default value is equal to the parallel-beam rotation angle.
Data Types: double
FanSensorGeometry
— Fan-beam sensor positioning
"arc"
(default) | "line"
Fan-beam sensor positioning, specified as "arc"
or
"line"
.
Value | Meaning | Diagram |
---|---|---|
| Sensors are spaced at equal angles along a circular arc. The center of the arc is the fan-beam vertex.
|
|
| Sensors are spaced at equal distances along a line that is
parallel to the x' axis. The closest sensor
is distance
|
|
FanSensorSpacing
— Fan-beam sensor spacing
positive scalar
Fan-beam sensor spacing, specified as a positive scalar.
If
FanSensorGeometry
is"arc"
, thenFanSensorSpacing
defines the angular spacing in degrees.If
FanSensorGeometry
is"line"
, thenFanSensorSpacing
defines the linear distance between fan-beams, in pixels. Linear spacing is measured on the x' axis.
If you do not specify FanSensorGeometry
, then the default
value of FanSensorSpacing
is the smallest value implied by
ParallelSensorSpacing
such that:
If
FanSensorGeometry
is"arc"
, thenFanSensorSpacing
is180/pi*asin(
ParallelSensorSpacing
/D
)If
FanSensorGeometry
is"line"
, thenFanSensorSpacing
isD
*asin(ParallelSensorSpacing
/D
)
Data Types: double
Interpolation
— Type of interpolation
"Linear"
(default) | "nearest"
| "spline"
| "pchip"
Type of interpolation used between the parallel-beam and fan-beam data, specified as one of these values.
"nearest"
— Nearest-neighbor
"linear"
— Linear (the default)
"spline"
— Piecewise cubic spline
"pchip"
— Piecewise cubic Hermite (PCHIP)
ParallelCoverage
— Range of parallel-beam rotation
"halfcycle"
(default) | "cycle"
Range of parallel-beam rotation, specified as "halfcycle"
or
"cycle"
.
"cycle"
— Parallel data covers the full range of [0, 360) degrees."halfcycle"
— Parallel data covers [0, 180) degrees.
ParallelSensorSpacing
— Parallel-beam sensor spacing
1
| positive scalar
Parallel-beam sensor spacing in pixels, specified as a positive scalar.
Data Types: double
Output Arguments
F
— Fan-beam projection data
numeric matrix
Fan-beam projection data, returned as a numeric matrix. Each column of
F
contains the fan-beam sensor samples at one rotation
angle.
Parallel-beam projection data, returned as a numeric matrix. Each column of
F
contains the fan-beam data at one rotation angle. The number of
columns indicates the total number of fan-beam rotation angles and is equal to the
length of fanRotAngles
. The number of rows indicates the total
number of parallel-beam sensors and is equal to the length of
fanSensorPos
.
Data Types: double
fanSensorPos
— Fan-beam sensor locations
numeric column vector
Fan-beam sensor locations, returned as a numeric column vector.
If
FanSensorGeometry
is"arc"
(the default), thenfanSensorPos
contains the fan-beam sensor measurement angles.If
FanSensorGeometry
is"line"
, thenfanSensorPos
contains the fan-beam sensor positions along the line of sensors.
Data Types: double
fanRotAngles
— Fan-beam rotation angles
numeric row vector
Fan-beam rotation angles, returned as a numeric row vector.
Data Types: double
Version History
Introduced before R2006a
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
Select a Web Site
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: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)