tomopy.misc.phantom

Module for generating synthetic phantoms.

Functions:

baboon([size, dtype]) Load test baboon image array.
barbara([size, dtype]) Load test Barbara image array.
cameraman([size, dtype]) Load test cameraman image array.
checkerboard([size, dtype]) Load test checkerboard image array.
lena([size, dtype]) Load test Lena image array.
peppers([size, dtype]) Load test peppers image array.
phantom(size, params[, dtype]) Generate a cube of given size using a list of ellipsoid parameters.
shepp2d([size, dtype]) Load test Shepp-Logan image array.
shepp3d([size, dtype]) Load 3D Shepp-Logan image array.
tomopy.misc.phantom.baboon(size=512, dtype='float32')[source]

Load test baboon image array.

Parameters:
  • size (int or tuple of int, optional) – Size of the output image.
  • dtype (str, optional) – The desired data-type for the array.
Returns:

ndarray – Output 3D test image.

tomopy.misc.phantom.barbara(size=512, dtype='float32')[source]

Load test Barbara image array.

Parameters:
  • size (int or tuple of int, optional) – Size of the output image.
  • dtype (str, optional) – The desired data-type for the array.
Returns:

ndarray – Output 3D test image.

tomopy.misc.phantom.cameraman(size=512, dtype='float32')[source]

Load test cameraman image array.

Parameters:
  • size (int or tuple of int, optional) – Size of the output image.
  • dtype (str, optional) – The desired data-type for the array.
Returns:

ndarray – Output 3D test image.

tomopy.misc.phantom.checkerboard(size=512, dtype='float32')[source]

Load test checkerboard image array.

Parameters:
  • size (int or tuple of int, optional) – Size of the output image.
  • dtype (str, optional) – The desired data-type for the array.
Returns:

ndarray – Output 3D test image.

tomopy.misc.phantom.lena(size=512, dtype='float32')[source]

Load test Lena image array.

Parameters:
  • size (int or tuple of int, optional) – Size of the output image.
  • dtype (str, optional) – The desired data-type for the array.
Returns:

ndarray – Output 3D test image.

tomopy.misc.phantom.peppers(size=512, dtype='float32')[source]

Load test peppers image array.

Parameters:
  • size (int or tuple of int, optional) – Size of the output image.
  • dtype (str, optional) – The desired data-type for the array.
Returns:

ndarray – Output 3D test image.

tomopy.misc.phantom.shepp2d(size=512, dtype='float32')[source]

Load test Shepp-Logan image array.

Parameters:
  • size (int or tuple of int, optional) – Size of the output image.
  • dtype (str, optional) – The desired data-type for the array.
Returns:

ndarray – Output 3D test image.

tomopy.misc.phantom.shepp3d(size=128, dtype='float32')[source]

Load 3D Shepp-Logan image array.

Parameters:
  • size (int or tuple, optional) – Size of the 3D data.
  • dtype (str, optional) – The desired data-type for the array.
Returns:

ndarray – Output 3D test image.

tomopy.misc.phantom.phantom(size, params, dtype='float32')[source]

Generate a cube of given size using a list of ellipsoid parameters.

Parameters:
  • size (tuple of int) – Size of the output cube.
  • params (list of dict) – List of dictionaries with the parameters defining the ellipsoids to include in the cube.
  • dtype (str, optional) – Data type of the output ndarray.
Returns:

ndarray – 3D object filled with the specified ellipsoids.