# API documentation¶

This document contains the documentation contained within the docstrings of all available functions and classes.

## Back projection¶

axitom.backprojection.map_object_to_detector_coords(object_xs, object_ys, object_zs, config)

Map the object coordinates to detector pixel coordinates accounting for cone beam divergence.

Parameters: object_xs (np.ndarray) – The x-coordinate array of the object to be reconstructed object_ys (np.ndarray) – The y-coordinate array of the object to be reconstructed object_zs (np.ndarray) – The z-coordinate array of the object to be reconstructed config (obj) – The config object containing all necessary settings for the reconstruction detector_cords_a – The detector coordinates along the a-axis corresponding to the given points detector_cords_b – The detector coordinates along the b-axis corresponding to the given points
axitom.backprojection.fdk(projection, config)

Filtered back projection algorithm as proposed by Feldkamp David Kress, adapted for axisymmetry.

This implementation has been adapted for axis-symmetry by using a single projection only and by only reconstructing a single R-Z slice.

This algorithm is based on: https://doi.org/10.1364/JOSAA.1.000612

Parameters: projection (np.ndarray) – The projection used in the reconstruction config (obj) – The config object containing all necessary settings for the reconstruction The reconstructed slice is a R-Z plane of a axis-symmetric tomogram where Z is the symmetry axis. ndarray

## Forward projection¶

axitom.projection.axis_sym_projection(volume, config, angles=None)

Projection of a volume onto a sensor plane using a conical beam geometry

This implementation has been adapted for axis-symmetry and returns a single projection only. The forward projection is done for several angles and the average projection is returned.

Parameters: volume (np.ndarray) – The volume which will be projected onto the sensor config (obj) – The settings object angles (list) – The angles in degrees which will be used for the forward projection The projection ndarray

## Config¶

axitom.config.config_from_xtekct(file_path)

Make config object from a Nikon X-tek CT input file

The .xtekct file is parsed and a config file containing all relevant settings is returned.

Parameters: file_path (str) – The path to the .xtekct file Config object obj
class axitom.config.Config(n_pixels_u, n_pixels_v, detector_size_u, detector_size_v, source_to_detector_dist, source_to_object_dist, angular_inc=1, center_of_rot=0, **kwargs)

Methods

 with_param(self, \*\*kwargs) Get a clone of the object with the parameter changed and all calculations repeated
__init__(self, n_pixels_u, n_pixels_v, detector_size_u, detector_size_v, source_to_detector_dist, source_to_object_dist, angular_inc=1, center_of_rot=0, **kwargs)
Configuration object which contains all settings necessary for the forward projection
and tomographic reconstruction.
Parameters: n_pixels_u (int) – Number of pixels in the u direction of the sensor n_pixels_v (int) – Number of pixels in the u direction of the sensor detector_size_u (float) – Detector size in the u direction [mm] detector_size_v (float) – Detector size in the u direction [mm] source_to_detector_dist (float) – Distance between source and detector [mm] source_to_object_dist (float) – Distance between source and object [mm] angular_inc (float) – Angular increment used in the reconstruction [deg] center_of_rot (float) – Position of the rotation axis in pixels. 0 corresponds to the center of the image NOTE (Any non valid arguments are neglected without warning) –
with_param(self, **kwargs)

Get a clone of the object with the parameter changed and all calculations repeated

Parameters: kwargs – The arguments of the config object that should be changed Config object with new arguments set obj

## Filtering¶

axitom.filtering.ramp_filter_and_weight(projection, config)

Add weights to the projection and apply a ramp-high-pass filter set to 0.5*Nyquist_frequency

Parameters: projection (np.ndarray) – The projection used in the reconstruction config (obj) – The config object containing all necessary settings for the reconstruction The projections weighted by the ray length and filtered by ramp filter ndarray

## Phantoms¶

axitom.phantoms.barrel(domain_size=128, outer_rad_fraction=0.7, center_val=None)

Barrel shaped phantom with a linear density gradient The domain size is cubic with dimension “domain_size” along each axis

Parameters: domain_size (int) – The length of the sides of the domain outer_rad_fraction (float) – The diameter of the barrel given as a the fraction of the side length center_val (float) – The density value in the center of the barrel The phantom ndarray

## Utilities¶

axitom.utilities.rotate_coordinates(xs_array, ys_array, angle_rad)

Rotate coordinate arrays by a given angle

Parameters: xs_array (ndarray) – Two dimensional coordinate array with x-coordinates ys_array (ndarray) – Two dimensional coordinate array with y-coordinates angle_rad (float) – Rotation angle in radians ndarray – The rotated x-coordinates ndarray – The rotated x-coordinates
axitom.utilities.list_files_in_folder(path, file_type='.tif')

List all files with a given extension for a given path. The output is sorted

Parameters: path (str) – Path to the folder containing the files file_type (str) – The file extension ex. “.tif” A list of sorted file names list
axitom.utilities.shading_correction(projections, flats, darks)

Perform shading correction on a a list of projections based on a list of flat images and list of dark images.

The correction is: corrected = (projections-dark)/(flat-dark)

Parameters: projections (list) – A list of projections that will be corrected flats (list) – A list of flat images darks (list) – A list of dark images A list of corrected projections list
axitom.utilities.read_image(file_path, flat_corrected=False)

Read an image specified by the file_path This function always returns a transposed float64 single channel image

Parameters: file_path (str) – Path to the file The single channel image with float64 values ndarray