LION.operators.ct.ct_geometry¶
Classes
|
Class holding a CT geometry. |
Functions
|
Check that a CT geometry is complete and consistent, and raise a ValueError listing every problem if not. |
- class LION.operators.ct.ct_geometry.Geometry(**kwargs)[source]¶
Bases:
OperatorParametersClass holding a CT geometry.
The image is given by any two of
image_shape(pixels),image_size(mm) andvoxel_size(mm), the detector by any two ofdetector_shape,detector_sizeandpixel_size: size = shape * spacing. The geometry keeps the values that were set, and computes the third one when it is read, so it is never out of date when the others change, e.g.geo = Geometry.default_parameters(); geo.image_shape = ....check_geometry()checks that a geometry is complete and consistent. It runs when an operator is built from the geometry and when the geometry is saved.__init__only checks what is given at once (three values of a triple that disagree), because a geometry can be filled in afterwards.The parameters given as keywords,
LIONParameter(n_iters=10). A dict value becomes aLIONParameter, unless it is a spec (a dict with"_target_", seeLION.utils.spec), which describes an object and stays a dict.- spec_kwargs()[source]¶
The values a spec of this geometry holds (
LION.utils.spec), aftercheck_geometry(): only the values that were set.
- serialize()[source]¶
The geometry as a dict, after
check_geometry(): only the values that were set, not the computed ones.
- property split_count¶
CT splits along the angles: one unit per angle.
- split_measurements(y, indices)[source]¶
The projections at the angles
indicesof the sinogram(s)y(the angles are its second last dimension, batched or not).
- classmethod init_from_parameter(parameter)[source]¶
The Geometry of a geometry saved as JSON and loaded as a LIONParameter.
Where a file has all three values of a triple, the spacing is computed again from the size and shape (with a warning if the stored one disagreed).
- static default_parameters()[source]¶
LION’s default CT geometry: fan beam: source to centre 575 mm, source to detector 1050 mm, a 900 x 1 mm detector, 512x512 images of 300 mm, 360 angles over 360 degrees.
- static sparse_view_parameters()[source]¶
The default geometry with 50 angles over 360 degrees (sparse view).
- static sparse_angle_parameters()[source]¶
The default geometry with 60 angles over 60 degrees (limited angle).
- static parallel_default_parameters(image_shape=None)[source]¶
A parallel beam with
image_shape(1 x 512 x 512 by default) images of 1 mm pixels and a matching detector, 360 angles over 360 degrees.
- LION.operators.ct.ct_geometry.check_geometry(geometry)[source]¶
Check that a CT geometry is complete and consistent, and raise a ValueError listing every problem if not.
Run when an operator is built from the geometry (
CTProjectionOp) and when the geometry is saved. Checks:modeis “fan” or “parallel”;image and detector: at least two of shape, size and spacing are set, and if all three are, they agree (size = shape * spacing);
shapes are positive whole numbers (3 for the image, 2 for the detector), sizes and spacings positive;
image_posis 3 finite numbers;anglesis a 1-D array of finite numbers;fan beam:
dsoanddsdare positive, withdsd >= dso.