PRwSC - A Toolbox for Phase Retrieval with Sparsity Constraints

PRwSC is a toolbox for two-dimensional phase retrieval problems from simulated data to experimental data with a focus on sparsity constraints using shearlets. There is a Matlab version as well as a Python variant (pyPRwSC).


The toolbox needs the following Python packages in order to work properly:

pyPRwSC has been developed and tested with Python 3.6 using the Anaconda package on Linux (Ubuntu 16.04.2 LTS), Windows 10 and Mac OS X (10.11-10.12).

A Matlab variant is also available (PRwSC, see download section). PRwSC needs ShearLab3D to function properly. See the installation instruction included in the ZIP archive for further information.

A schematic drawing of the structure of the toolbox can be seen here (Matlab version).


Python: pyPRwSC (Version 1.0)
Matlab: PRwSC (Version 1.0)


You can simply download, unzip and use pyPRwSC. Depending on your specific Python development environment, you may want to add the pyPRwSC folder to your Python environment (Python Path). The dependencies can be installed using pip. If you use Anaconda, they are already installed. A working copy of pyShearLab is also included in the download.


In order to use pyPRwSC you need to import it as a module, see as an example. This example of the reconstruction of a phase object provides all neccessary steps to understand how to use the toolbox. A more detailed description of the Matlab version of the toolbox is given in the documentation for the Matlab variant.


pyPRwSC was written by Stefan Loock who acknowledges funding by the SFB 755 Nanoscale Photonic Imaging.

Some functions like MagProj and calculateKLDistance were originally written for Matlab by Russell Luke and are part of the ProxToolbox.

The implementation of the Fresnel transform is based on prop_fresnel.m written by Martin Krenkel. For details see his PhD thesis:

  • M. Krenkel. Cone-beam x-ray phase-contrast tomography for the observation of single cells in whole organs. PhD thesis, Georg-August-Universität Göttingen, 2015.

The synthetic image of a cell is from Klaus Giewekemeyer, for information please see

  • K. Giewekemeyer. A study on new approaches in coherent x-ray microscopy of biological specimens. PhD thesis, Georg-August-Universität Göttingen, 2011.
  • K. Giewekemeyer, S. P. Krüger, S. Kalbfleisch, M. Bartels, C. Beta, and T. Salditt. X-ray propagation microscopy of biological cells using waveguides as a quasi point source. Physical Review A, 83(2): 023804, 2011.