httomolibgpu.recon.rotation#

Modules for finding the axis of rotation for 180 and 360 degrees scans

httomolibgpu.recon.rotation.find_center_360(data: <cp.ndarray>, ind: typing.Optional[int] = None, win_width: int = 10, side: typing.Optional[typing.Literal[0, 1]] = None, denoise: bool = True, norm: bool = False, use_overlap: bool = False) Tuple[float, float, Optional[Literal[0, 1]], float][source]#

Find the center-of-rotation (COR) in a 360-degree scan and also an offset to perform data transformation from 360 to 180 degrees scan. See [10].

Parameters
  • data (cp.ndarray) – 3D tomographic data as a Cupy array.

  • ind (int, optional) – Index of the slice to be used for estimate the CoR and the overlap.

  • win_width (int, optional) – Window width used for finding the overlap area.

  • side ({None, 0, 1}, optional) – Overlap size. Only there options: None, 0, or 1. “None” corresponds to fully automated determination. “0” corresponds to the left side. “1” corresponds to the right side.

  • denoise (bool, optional) – Apply the Gaussian filter if True.

  • norm (bool, optional) – Apply the normalisation if True.

  • use_overlap (bool, optional) – Use the combination of images in the overlap area for calculating correlation coefficients if True.

Returns

  • cor (float) – Center-of-rotation.

  • overlap (float) – Width of the overlap area between two halves of the sinogram.

  • side (int) – Overlap side between two halves of the sinogram.

  • overlap_position (float) – Position of the window in the first image giving the best correlation metric.

httomolibgpu.recon.rotation.find_center_pc(proj1: <cp.ndarray>, proj2: <cp.ndarray>, tol: float = 0.5, rotc_guess: typing.Optional[typing.Union[float, str]] = None) float[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 phase_cross_correlation function uses cross-correlation in Fourier space, optionally employing an upsampled matrix-multiplication DFT to achieve arbitrary subpixel precision. See [2].

Parameters
  • proj1 (cp.ndarray) – Projection from the 0th degree angle.

  • proj2 (cp.ndarray) – Projection from the 180th degree angle.

  • tol (float, optional) – Subpixel accuracy. Defaults to 0.5.

  • rotc_guess (float, optional) – Initial guess value for the rotation center. Defaults to None.

Returns

Rotation axis location.

Return type

float

httomolibgpu.recon.rotation.find_center_vo(data: <cp.ndarray>, ind: typing.Optional[int] = None, smin: int = -50, smax: int = 50, srad: float = 6.0, step: float = 0.25, ratio: float = 0.5, drop: int = 20) float[source]#

Find rotation axis location (aka CoR) using Nghia Vo’s method. See the paper [11].

Parameters
  • data (cp.ndarray) – 3D tomographic data or a 2D sinogram as a CuPy array.

  • ind (int, optional) – Index of the slice to be used to estimate the CoR.

  • smin (int, optional) – Coarse search radius. Reference to the horizontal center of the sinogram.

  • 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.

Returns

Rotation axis location.

Return type

float