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, rotc_guess]) 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 [Donath:06].

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). float – Rotation axis location.
tomopy.recon.rotation.find_center_vo(tomo, ind=None, smin=-50, smax=50, srad=6, step=0.25, ratio=0.5, drop=20)[source]

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

Parameters: tomo (ndarray) – 3D tomographic data. ind (int, optional) – Index of the slice to be used for reconstruction. smin, smax (int, optional) – Coarse search radius. 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. float – Rotation axis location.
tomopy.recon.rotation.find_center_pc(proj1, proj2, tol=0.5, rotc_guess=None)[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. [Guizar:08].

Parameters: proj1 (ndarray) – 2D projection data. proj2 (ndarray) – 2D projection data. tol (scalar, optional) – Subpixel accuracy rotc_guess (float, optional) – Initual guess value for the rotation center float – Rotation axis location.
tomopy.recon.rotation.write_center(tomo, theta, dpath='tmp/center', cen_range=None, ind=None, mask=False, ratio=1.0, sinogram_order=False, algorithm='gridrec', filter_name='parzen')[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.

filter_name : str, optional

Name of the filter for analytic reconstruction.

‘none’
No filter.
‘shepp’
Shepp-Logan filter (default).
‘cosine’
Cosine filter.
‘hann’
Cosine filter.
‘hamming’
Hamming filter.
‘ramlak’
Ram-Lak filter.
‘parzen’
Parzen filter.
‘butterworth’
Butterworth filter.
‘custom’
A numpy array of size next_power_of_2(num_detector_columns)/2 specifying a custom filter in Fourier domain. The first element of the filter should be the zero-frequency component.
‘custom2d’
A numpy array of size num_projections*next_power_of_2(num_detector_columns)/2 specifying a custom angle-dependent filter in Fourier domain. The first element of each filter should be the zero-frequency component.