For AI agents: see the complete TomoJAX documentation index at llms.txt. This page is also available as Markdown at https://tomojax.dev/api/interactive.md or by sending Accept: text/markdown.

tomojax.interactive

Registered slices, center sweeps, detector bands and region overlays for interactive clients.

NameSummary
CorrectionBandThe input rows, the corrected binned rows and the views kept, for a row band.
RegionOverlayEstimated reconstruction grid, its voxel-edge bounds and registered central images.
center_sweepReconstruct ordered planes at signed horizontal offsets in input detector pixels.
correction_previewCorrect complete native blocks for a half-open interval in the binned output.
reconstruct_sliceReturn the indexed plane of the requested public reconstruction on its original grid.
reconstruct_slicesReconstruct several planes, sharing one full solve when any of them needs one.
region_previewReturn the estimator's grid and its central FBP overlays in physical space.

CorrectionBand

class CorrectionBand(
    before: np.ndarray,
    after: np.ndarray,
    views: np.ndarray,
    detector: Detector,
    domain: Literal['counts', 'line_integrals'] = 'counts',
)
Defined in src/tomojax/interactive.py:283

The input rows, the corrected binned rows and the views kept, for a row band.

Parameters

  • before (numpy.ndarray): The input across the requested complete blocks: counts of raw frames, or the line integrals of a scan.
  • after (numpy.ndarray): Line integrals on the selected binned rows.
  • views (numpy.ndarray): Indices of retained views in the input acquisition.
  • detector (Detector): Full binned detector used to register the output rows.
  • domain ({"counts", "line_integrals"}, optional): What before holds.

RegionOverlay

class RegionOverlay(
    estimate: RegionEstimate,
    bounds: tuple[tuple[float, float], tuple[float, float], tuple[float, float]],
    images: dict[str, progress.Sample],
)
Defined in src/tomojax/interactive.py:237

Estimated reconstruction grid, its voxel-edge bounds and registered central images.

Parameters

  • estimate (RegionEstimate): The estimator's result, usable in a subsequent reconstruction.
  • bounds (tuple): Lower and upper voxel edges in physical x, y and z order.
  • images (dict): Registered central planes indexed by their fixed axis.

center_sweep

center_sweep(
    scan: Scan,
    axis: Axis,
    index: int,
    centers: Sequence[float],
    *,
    method: Method = 'auto',
    **options: Any,
) -> Any
Defined in src/tomojax/interactive.py:150

Reconstruct ordered planes at signed horizontal offsets in input detector pixels.

Resolve the requested region once on the input scan. Every offset uses that fixed grid, support and plane index. A full reconstruction oracle shifts the detector and passes this resolved grid explicitly at each center. Repeated offsets retain their order.

Parameters

  • scan (Scan): Input projections and calibrated geometry.
  • axis ({"z", "y", "x"}): Dimension held fixed in the returned plane.
  • index (int): Zero-based plane index on the resolved grid.
  • centers (sequence of float): Signed detector offsets relative to the central column, in input pixels.
  • method (str, optional): Public reconstruction method.
  • **options (dict): Keyword arguments to the reconstruction resolver, including grid, region and solver options.

Returns

  • numpy.ndarray or jax.Array: Float32 attenuation with a leading center coordinate, in the supplied order.

correction_preview

correction_preview(
    source: Frames | Scan,
    rows: tuple[int, int],
    *steps: Step,
    binning: int = 1,
    epsilon: float = 1e-06,
    flat_weights: FlatWeighting = FLAT_WEIGHTS,
    views_per_batch: int | None = None,
) -> CorrectionBand
Defined in src/tomojax/interactive.py:309

Correct complete native blocks for a half-open interval in the binned output.

The rows equal the same rows of a full correction followed by binning: rows the band does not hold are read when a step needs them (Paganin's propagation, view rejection's statistics).

Parameters

  • source (Frames or Scan): Raw acquisition with calibration and exposure metadata, or a scan of line integrals for the steps that act on them.
  • rows (tuple of int): First binned row and exclusive stop.
  • *steps (Step): Ordered corrections, as for the full acquisition.
  • binning (int, optional): Width and height of a native detector block.
  • epsilon (float, optional): Lower bound for flat and transmission values (raw frames).
  • flat_weights ({'views', 'position'}, optional): How a view between two flat sets blends them (raw frames), as for tomojax.Frames.corrected.
  • views_per_batch (int or None, optional): Maximum number of views in a correction batch.

Returns

  • CorrectionBand: The input rows, binned line integrals and original input view indices.

reconstruct_slice

reconstruct_slice(
    scan: Scan,
    axis: Axis,
    index: int,
    *,
    method: Method = 'auto',
    **options: Any,
) -> Any
Defined in src/tomojax/interactive.py:123

Return the indexed plane of the requested public reconstruction on its original grid.

Parameters

  • scan (Scan): Input projections and calibrated geometry.
  • axis ({"z", "y", "x"}): Dimension held fixed in the returned plane.
  • index (int): Zero-based plane index on the resolved grid.
  • method (str, optional): Public reconstruction method.
  • **options (dict): Keyword arguments to the reconstruction resolver, including grid, region and solver options.

Returns

  • numpy.ndarray or jax.Array: Float32 attenuation in the remaining public array axes.

reconstruct_slices

reconstruct_slices(
    scan: Scan,
    requests: Sequence[tuple[Axis, int]],
    *,
    method: Method = 'auto',
    **options: Any,
) -> list[Any]
Defined in src/tomojax/interactive.py:82

Reconstruct several planes, sharing one full solve when any of them needs one.

Every index is checked before anything runs. Axial FBP planes that take one detector row each are made on their own; otherwise one full reconstruction is cut into every requested plane.

Parameters

  • scan (Scan): Input projections and calibrated geometry.
  • requests (sequence of (axis, index)): Planes to make.
  • method (str, optional): Public reconstruction method.
  • **options (dict): Keyword arguments to the reconstruction resolver.

Returns

  • list of array: Float32 attenuation planes, one per request, in order.

region_preview

region_preview(scan: Scan) -> RegionOverlay
Defined in src/tomojax/interactive.py:256

Return the estimator's grid and its central FBP overlays in physical space.

Parameters

  • scan (Scan): Calibrated laminography projections supplied to the region estimator.

Returns

  • RegionOverlay: Estimate, physical XYZ bounds and registered central planes.

On this page

TomoJAX