CircularDetector¶
- class odl.tomo.geometry.detector.CircularDetector(partition, axis, radius, check_bounds=True)[source]¶
Bases:
DetectorA 1D detector on a circle section in 2D space.
The circular section that corresponds to the angular partition is rotated to be aligned with a given axis and shifted to cross the origin. Note, the partition angle increases in the clockwise direction, by analogy to flat detectors.
- Attributes:
axisFixed axis along which this detector is aligned.
check_boundsIf
True, methods computing vectors check input arguments.gridSampling grid of the parameters.
ndimNumber of dimensions of the parameters (= surface dimension).
paramsSurface parameter set of this detector.
partitionPartition of the detector parameter set into subsets.
radiusCurvature radius of the detector.
rotation_matrixRotation matrix that is used to align the detector with a given axis.
shapeNumber of subsets (pixels) of the detector per axis.
sizeTotal number of pixels.
space_ndimNumber of dimensions of the embedding space.
translationA vector used to shift the detector towards the origin.
Methods
surface(param)Return the detector surface point corresponding to
param.surface_deriv(param)Return the surface derivative at
param.surface_measure(param)Return the arc length measure at
param.surface_normal(param)Unit vector perpendicular to the detector surface at
param.- __init__(partition, axis, radius, check_bounds=True)[source]¶
Initialize a new instance.
- Parameters:
- partition1-dim.
RectPartition Partition of the parameter interval, corresponding to the angular sections along the line.
- axis
array-like, shape(2,) Fixed axis along which this detector is aligned.
- radiusnonnegative float
Radius of the circle.
- check_boundsbool, optional
If
True, methods computing vectors check input arguments. Checks are vectorized and add only a small overhead.
- partition1-dim.
Examples
Initialize a detector with circle radius 2 and extending to 90 degrees on both sides of the origin (a half circle).
>>> part = odl.uniform_partition(-np.pi / 2, np.pi / 2, 10) >>> det = CircularDetector(part, axis=[1, 0], radius=2) >>> det.axis array([ 1., 0.]) >>> det.radius 2.0 >>> np.allclose(det.surface_normal(0), [0, -1]) True