SphericalDetector

class odl.applications.tomo.geometry.detector.SphericalDetector(partition, axes, radius, check_bounds=True)[source]

Bases: Detector

A 2D detector on a spherical surface in 3D space.

The spherical surface that corresponds to the partition is rotated to be aligned with given axes and shifted to cross the origin. Note, the partition angles increase in the direction of -y (clockwise) and z axis, by analogy to flat detectors.

__init__(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 in two directions.

axessequence of array-like’s

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 sphere.

check_boundsbool, optional

If True, methods computing vectors check input arguments. Checks are vectorized and add only a small overhead.

Examples

Initialize a detector with radius 2 extending to 90 degrees in both directions along the equator and 45 degrees in both directions towards the poles.

>>> part = odl.uniform_partition([-np.pi / 2, -np.pi / 3],
...                              [ np.pi / 2,  np.pi / 3], [20, 10])
>>> det = SphericalDetector(
...     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