Flat1dDetector¶
-
class
odl.tomo.geometry.detector.
Flat1dDetector
(partition, axis, check_bounds=True)[source]¶ Bases:
odl.tomo.geometry.detector.Detector
A 1d line detector aligned with a given axis in 2D space.
- Attributes
axis
Fixed axis along which this 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.
shape
Number of subsets (pixels) of the detector per axis.
size
Total number of pixels.
space_ndim
Number of dimensions of the embedding space.
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, axis, check_bounds=True)[source]¶ Initialize a new instance.
- Parameters
- partition1-dim.
RectPartition
Partition of the parameter interval, corresponding to the line elements.
- axis
array-like
, shape(2,)
Fixed axis along which this detector is aligned.
- check_boundsbool, optional
If
True
, methods computing vectors check input arguments. Checks are vectorized and add only a small overhead.
- partition1-dim.
Examples
>>> part = odl.uniform_partition(0, 1, 10) >>> det = Flat1dDetector(part, axis=[1, 0]) >>> det.axis array([ 1., 0.]) >>> np.allclose(det.surface_normal(0), [0, -1]) True