tomopy.recon.rotation

Module for functions related to finding axis of rotation.

Functions:

find_center(tomo, theta[, ind, init, tol, ...]) Find rotation axis location.
find_center_vo(tomo[, ind, smin, smax, ...]) Find rotation axis location using Nghia Vo’s method.
find_center_pc(proj1, proj2[, tol]) Find rotation axis location by finding the offset between the first projection and a mirrored projection 180 degrees apart using phase correlation in Fourier space.
write_center(tomo, theta[, dpath, ...]) Save images reconstructed with a range of rotation centers.
tomopy.recon.rotation.find_center(tomo, theta, ind=None, init=None, tol=0.5, mask=True, ratio=1.0, sinogram_order=False)[source]

Find rotation axis location.

The function exploits systematic artifacts in reconstructed images due to shifts in the rotation center. It uses image entropy as the error metric and ‘’Nelder-Mead’’ routine (of the scipy optimization module) as the optimizer [C7].

Parameters:
  • tomo (ndarray) – 3D tomographic data.
  • theta (array) – Projection angles in radian.
  • ind (int, optional) – Index of the slice to be used for reconstruction.
  • init (float) – Initial guess for the center.
  • tol (scalar) – Desired sub-pixel accuracy.
  • mask (bool, optional) – If True, apply a circular mask to the reconstructed image to limit the analysis into a circular region.
  • ratio (float, optional) – The ratio of the radius of the circular mask to the edge of the reconstructed image.
  • sinogram_order (bool, optional) – Determins whether data is a stack of sinograms (True, y-axis first axis) or a stack of radiographs (False, theta first axis).
Returns:

float – Rotation axis location.

tomopy.recon.rotation.find_center_vo(tomo, ind=None, smin=-40, smax=40, srad=10, step=1, ratio=2.0, drop=20)[source]

Find rotation axis location using Nghia Vo’s method. [C18].

Parameters:
  • tomo (ndarray) – 3D tomographic data.
  • ind (int, optional) – Index of the slice to be used for reconstruction.
  • smin, smax (int, optional) – Reference to the horizontal center of the sinogram.
  • srad (float, optional) – Fine search radius.
  • step (float, optional) – Step of fine searching.
  • ratio (float, optional) – The ratio between the FOV of the camera and the size of object. It’s used to generate the mask.
  • drop (int, optional) – Drop lines around vertical center of the mask.
Returns:

float – Rotation axis location.

tomopy.recon.rotation.find_center_pc(proj1, proj2, tol=0.5)[source]

Find rotation axis location by finding the offset between the first projection and a mirrored projection 180 degrees apart using phase correlation in Fourier space. The register_translation function uses cross-correlation in Fourier space, optionally employing an upsampled matrix-multiplication DFT to achieve arbitrary subpixel precision. [C11].

Parameters:
  • proj1 (ndarray) – 2D projection data.
  • proj2 (ndarray) – 2D projection data.
  • tol (scalar, optional) – Subpixel accuracy
Returns:

float – Rotation axis location.

tomopy.recon.rotation.write_center(tomo, theta, dpath=u'tmp/center', cen_range=None, ind=None, mask=False, ratio=1.0, sinogram_order=False)[source]

Save images reconstructed with a range of rotation centers.

Helps finding the rotation center manually by visual inspection of images reconstructed with a set of different centers.The output images are put into a specified folder and are named by the center position corresponding to the image.

Parameters:
  • tomo (ndarray) – 3D tomographic data.
  • theta (array) – Projection angles in radian.
  • dpath (str, optional) – Folder name to save output images.
  • cen_range (list, optional) – [start, end, step] Range of center values.
  • ind (int, optional) – Index of the slice to be used for reconstruction.
  • mask (bool, optional) – If True, apply a circular mask to the reconstructed image to limit the analysis into a circular region.
  • ratio (float, optional) – The ratio of the radius of the circular mask to the edge of the reconstructed image.
  • sinogram_order (bool, optional) – Determins whether data is a stack of sinograms (True, y-axis first axis) or a stack of radiographs (False, theta first axis).