radon

acstools.utils_findsat_mrt.radon(image, theta=None, circle=False, *, preserve_range=False, fill_value=nan, median=True, processes=1, return_length=False, print_calc_times=False)

Calculates the (median) radon transform of an image.

This routine basically skimage.transform.radon() but with extra options and multiprocessing. For further information see [1] and [2].

Parameters:
  • image (array-like) – Input image. The rotation axis will be located in the pixel with indices (image.shape[0] // 2, image.shape[1] // 2).

  • theta (array-like, optional) – Projection angles (in degrees). If None, the value is set to np.arange(180).

  • circle (bool, optional) – Assume image is zero outside the inscribed circle, making the width of each projection (the first dimension of the sinogram) equal to min(image.shape).

  • preserve_range (bool, optional) – Whether to keep the original range of values. Otherwise, the input image is converted according to the conventions of img_as_float. Also see https://scikit-image.org/docs/dev/user_guide/data_types.html

  • fill_value (float, optional) – Value to use for regions where the transform could not be calculated. Default is 0.

  • median (bool, optional) – Flag to turn on Median Radon Transform instead of standard Radon Transform. Default is True.

  • processes (int, optional) – Number of processes to use when calculating the transform. Default is 1 (no multi-processing).

  • return_length (bool, optional) – Option to return an array giving the length of the data array used to calculate the transform at every location. Default is False.

  • print_calc_times (bool, optional) – Log the run time.

Returns:

  • radon_image (ndarray) – Radon transform (sinogram). The tomography rotation axis will lie at the pixel index radon_image.shape[0] // 2 along the 0th dimension of radon_image.

  • length (ndarray, optional) – Length of data array. This is only returned if return_length is True.

Raises:

ValueError – Input image is not 2-D or padded image is not square.

References

Notes

Based on code of Justin K. Romberg (https://www.clear.rice.edu/elec431/projects96/DSP/bpanalysis.html)