nabu.reconstruction.reconstructor_cuda module

class nabu.reconstruction.reconstructor_cuda.CudaReconstructor(shape, indices, axis='z', vol_type='sinograms', slices_roi=None, **backprojector_options)[source]

Bases: Reconstructor

Initialize a reconstructor.

Parameters:
  • shape (tuple) – Shape of the stack of sinograms or projections.

  • indices_range (tuple) – Range of indices to reconstruct, in the form (start, end). As the standard Python behavior, the upper bound is not included. For example, to reconstruct 100 slices (numbered from 0 to 99), then you can provide (0, 100) or (0, None). Providing (0, 99) or (0, -1) will omit the last slice.

  • axis (str) – Axis along which the slices are reconstructed. This axis is orthogonal to the slices planes. This parameter can be either “x”, “y”, or “z”. Default is “z” (reconstruct slices perpendicular to the rotation axis).

  • vol_type (str, optional) – Whether the parameter shape describes a volume of sinograms or projections. The two are the same except that axes 0 and 1 are swapped. Can be “sinograms” (default) or “projections”.

  • slices_roi (tuple, optional) – Define a Region Of Interest to reconstruct a part of each slice. By default, the whole slice is reconstructed for each slice index. This parameter is in the form (start_u, end_u, start_v, end_v), where u and v are horizontal and vertical axes on the reconstructed slice respectively, regardless of its orientation. If one of the values is set to None, it will be replaced by the corresponding default value.

Examples

To reconstruct the first two horizontal slices, i.e along z:

R = Reconstructor(vol_shape, [0, 1])

To reconstruct vertical slices 0-100 along the y axis:

R = Reconstructor(vol_shape, (0, 100), axis=”y”)

reconstruct(data, output=None)[source]

Reconstruct from sinograms or projections.