p_power#

cuqi.data.p_power(size=128, relnz=0.3, p=2, seed=1)#

p-power class phantom.

Create an image generated from a random pattern of nonzero pixels with correlation between pixels controlled by p and sparsity by relnz.

Note: image will change when varying size. To avoid this change image size using cuqi.data.imresize() after generating the image.

Parameters:
  • size (int) – Size of the image to generate. Image is square with sides of length size.

  • relnz (float) – Relative number of nonzero pixels.

  • p (int) – Power of the pattern. Structure (correlation) increases with larger p.

  • seed (int) – Seed for the random number generator.

Returns:

Image of the phantom.

Return type:

ndarray

Notes

Python translation from phantomgallery code in AIRToolsII jakobsj/AIRToolsII.

Original paper: Jorgensen, Jakob S., et al. “Empirical average-case relation between undersampling and sparsity in x-ray CT.” Inverse problems and imaging (Springfield, Mo.) 9.2 (2015): 431.