User API Overview#

Most functions can be accessed by importing mbirjax and creating a model or through mbirjax directly. Most commonly used functions are described below. See Demos and FAQs for examples. Navigate individual pages under User API for more details.

Geometry Models#

The first step is to create an instance with a specific geometry. This is done by initializing one of the following geometry classes:

ParallelBeamModel(sinogram_shape, angles)

A class designed for handling forward and backward projections in a parallel beam geometry, extending the Tomography Model.

ConeBeamModel(sinogram_shape, angles, ...[, ...])

A class designed for handling forward and backward projections in a cone beam geometry, extending the Tomography Model.

TranslationModel(sinogram_shape, ...)

This class implements the translation tomography geometry in which each view is a cone beam projection of a translated object.

Reconstruction and Projection#

Each geometry class is derived from Tomography Model, which includes a number of powerful methods listed below for manipulating sinograms and reconstructions. Detailed documentation for each geometry class is provided in Parallel Beam Model and Cone Beam Model.

Note that Parallel Beam Model also includes fbp_recon and Cone Beam Model includes fdk_recon for direct (non-iterative) reconstruction in the case of many views and low-noise data.

TomographyModel.recon(sinogram[, weights, ...])

Perform MBIR reconstruction using the Multi-Granular Vector Coordinate Descent algorithm.

TomographyModel.scale_recon_shape([...])

Scale the reconstruction shape by the given scale factors.

TomographyModel.prox_map(prox_input, sinogram)

Proximal Map function for use in Plug-and-Play applications.

TomographyModel.forward_project(recon)

Perform a full forward projection at all voxels in the field-of-view.

TomographyModel.back_project(sinogram)

Perform a full back projection at all voxels in the field-of-view.

Denoising#

See Denoising for details on Denoising Functions. These includes functions for computing the MAP denoiser using the qGGMRF prior and a 3D median filter.

QGGMRFDenoiser.denoise(image[, sigma_noise, ...])

Compute the MAP denoiser assuming AWGN and the 3D qGGMRF prior.

The median filter is implemented in jax using a fixed 3x3x3 neighborhood with replicated edges at the boundary.

denoising.median_filter3d(x[, max_block_gb, ...])

Apply a 27‑point (3x3x3) median filter to a 3‑D JAX array using replicated (edge) boundary conditions.

Parameter Handling#

See Primary Parameters page for a description of the primary parameters. Users can set, get, and printout parameters using the following primary methods.

ParameterHandler.set_params([no_warning, ...])

Update parameters using keyword arguments.

ParameterHandler.get_params(parameter_names)

Get the values of the listed parameter names from the internal parameter dictionary.

ParameterHandler.print_params()

Print the current parameter values in the model.

Saving and Loading#

TomographyModel.save_recon_hdf5(filepath, recon)

Save the reconstruction array and optionally the recon_dict from recon().

TomographyModel.load_recon_hdf5(filepath[, ...])

This function loads a numpy array stored in an HDF5 file created by save_recon_hdf5().

Utilities#

See Utilities for details on Utility Functions. These include variety of functions for viewing, generating weights, exporting/importing data, and generating synthetic data.

viewer.slice_viewer(*datasets[, data_dicts, ...])

Launch an interactive viewer for inspecting one or more 2D or 3D image arrays.

vcd_utils.gen_weights(sinogram, weight_type)

Compute optional weights used in MBIR reconstruction based on the noise model.

vcd_utils.gen_weights_mar(ct_model, sinogram)

Generates the weights used for reducing metal artifacts in MBIR reconstruction.

utilities.download_and_extract(download_url, ...)

Download or copy a file from a URL or local file path.

utilities.export_recon_hdf5(file_path, recon)

Export a 3D reconstruction volume to an HDF5 file with optional post-processing.

utilities.import_recon_hdf5(file_path)

Import a 3D reconstruction volume from an HDF5 file.

utilities.generate_3d_shepp_logan_low_dynamic_range(...)

Generates a 3D Shepp-Logan phantom with specified dimensions.

Preprocessing#

See Preprocessing for details on Preprocessing Functions. These functions various methods to compute and correct the sinogram data as needed. The following are functions specific to NSI scanners. See demo_nsi.py in the mbirjax_applications repo.

It also includes functions for processing cone beam and parallel beam data to remove artifacts from metal, detector defects.

It also includes functions for optimal view selection.