CylindricalDetector¶
-
class
odl.tomo.geometry.detector.
CylindricalDetector
(partition, axes, radius, check_bounds=True)[source]¶ Bases:
odl.tomo.geometry.detector.Detector
A 2D detector on a cylindrical surface in 3D space.
The cylindrical surface that corresponds to the partition is rotated to be aligned with given axes and shifted to cross the origin. Note that the partition angle increases in the clockwise direction, by analogy to flat detectors.
- Attributes
axes
Fixed array of unit vectors with which the detector is aligned.
check_bounds
If
True
, methods computing vectors check input arguments.grid
Sampling grid of the parameters.
ndim
Number of dimensions of the parameters (= surface dimension).
params
Surface parameter set of this detector.
partition
Partition of the detector parameter set into subsets.
radius
Curvature radius of the detector.
rotation_matrix
Rotation matrix that is used to align the detector with a given axis.
shape
Number of subsets (pixels) of the detector per axis.
size
Total number of pixels.
space_ndim
Number of dimensions of the embedding space.
translation
A vector used to shift the detector towards the origin.
Methods
surface
(self, param)Return the detector surface point corresponding to
param
.surface_deriv
(self, param)Return the surface derivative at
param
.surface_measure
(self, param)Density function of the surface measure.
surface_normal
(self, param)Unit vector perpendicular to the detector surface at
param
.-
__init__
(self, partition, axes, radius, check_bounds=True)[source]¶ Initialize a new instance.
- Parameters
- partition2-dim.
RectPartition
Partition of the parameter interval, corresponding to the angular partition and height partition.
- axessequence of
array-like
Fixed pair of of unit vectors with which the detector is aligned. The vectors must have shape
(3,)
and be perpendicular.- radiusnonnegative float
Radius of the cylinder.
- check_boundsbool, optional
If
True
, methods computing vectors check input arguments. Checks are vectorized and add only a small overhead.
- partition2-dim.
Examples
Initialize a detector with height 8 and circle radius 2 extending to 90 degrees on both sides of the origin (a half cylinder).
>>> part = odl.uniform_partition( ... [-np.pi / 2, -4], [np.pi / 2, 4], [10, 8]) >>> det = CylindricalDetector( ... part, axes=[(1, 0, 0), (0, 0, 1)], radius=2) >>> det.axes array([[ 1., 0., 0.], [ 0., 0., 1.]]) >>> det.radius 2.0 >>> np.allclose(det.surface_normal([0, 0]), [ 0, -1, 0]) True