tomosipo.odl module
- tomosipo.odl.discretized_space_2d_to_3d(space, z_shape=1, z_span=None)[source]
Convert 2D odl.discr.DiscretizedSpace to 3D by adding a 0-th axis.
- Parameters:
space (odl.discr.DiscretizedSpace) – 2D space to be converted.
z_shape (int, optional) – Number of points in the 0-th axis.
z_span (float, optional) – Minimum and maximum point of the 0-th axis (like passed to uniform_partition). If a single float is passed,
(-z_span/2., z_span/2.)is used. If None (the default),(-z_shape/2., z_shape/2.)is used, resulting in a partition with cell side1..
- Returns:
space3d – The 3D space that contains the given 2D space as a single 0-th-axis-slice.
- Return type:
odl.discr.DiscretizedSpace
- tomosipo.odl.fan_to_cone_beam_geometry(fb_geometry, det_z_span=1.0)[source]
Convert 2D odl.tomo.FanBeamGeometry to 3D odl.tomo.ConeBeamGeometry, by adding a trivial 0-th axis.
For odl<=’0.7.0’ the classes are odl.tomo.FanFlatGeometry and odl.tomo.ConeFlatGeometry.
- Parameters:
fb_geometry (odl.tomo.FanBeamGeometry) – The fan beam geometry to be converted.
det_z_span (float, optional) – Size of the detector in the trivial 0-th dimension. The default is
1..
- Returns:
cb_geometry – The cone beam geometry that coincides with the given fan beam geometry at the central slice (0-th coordinate equals zero).
- Return type:
odl.tomo.ConeBeamGeometry
- tomosipo.odl.from_odl(geom_or_op)[source]
- tomosipo.odl.parallel_2d_to_3d_geometry(pb2d_geometry, det_z_shape=1, det_z_span=None)[source]
Convert odl.tomo.Parallel2dGeometry to odl.tomo.Parallel3dAxisGeometry, by adding a trivial 0-th axis.
- Parameters:
pb2d_geometry (odl.tomo.Parallel2dGeometry) – The 2d parallel beam geometry to be converted.
det_z_shape (int, optional) – Number of detector pixels in the 0-th dimension. Can be used to batch multiple 2d projections into one 3d projection.
det_z_span (float or 2-tuple of float, optional) – Minimum and maximum point of the 0-th axis (like passed to uniform_partition). If a single float is passed,
(-det_z_span/2., det_z_span/2.)is used. If None (the default),(-det_z_shape/2., det_z_shape/2.)is used, resulting in a partition with cell side1..
- Returns:
pb3d_geometry – A 3d parallel beam geometry that coincides with the given 2d geometry in every slice (0-th coordinate fixed).
- Return type:
odl.tomo.Parallel3dAxisGeometry