# Introduction

## Overview

Bonsu, the interactive phase retrieval suite, is the first phase retrieval software package for phase retrieval with real-time visualisation in both two and three dimensions. It is complete with an inventory of algorithms and routines for data manipulation and reconstruction.

Bonsu is open-source, is designed around the python language (with c bindings) and is largely platform independent. It is also able to handle data in formats such as:

1. SPE

2. HDF5

3. VTK

4. Numpy

5. Image formats including PNG, JPG, TIFF, PPM

## Arrays

Bonsu uses NumPy array format (http://numpy.org) internally for manipulating and outputting raw data. Double-precision complex NumPy arrays are used for phase retrieval. NumPy is part of the ‘Scientific Computing Tools For Python’ or SciPy package (http://scipy.org) available in Python. There are a number of standard tools made available for array conversion, manipulation and viewing. Tools for cropping, padding, binning, support array creation and mask array creation are provided. Arrays can be exported in both NumPy array and VTK format.

For further details see Array Creation and Storage.

## Algorithms

Bonsu comes complete with a number of algorithms for phase retrieval. They include Fienup’s hybrid input-output (HIO) (Fienup, 1982), HIO with positivity constraint, phase-constrained HIO (Harder et al., 2010), hybrid projection reflection (Bauschke et al., 2003), relaxed average alternating reflection (Luke, 2005) and the error reduction algorithm (Gerchberg & Saxton, 1972). In addition, a shrink-wrap algorithm that is able to make use of either of the above algorithms is also provided (Marchesini et al., 2003; Newton et al., 2010). Phase retrieval algorithms are implemented in the c language for fast execution and seamlessly integrated into the application.

For a complete list see Library Reference – Phasing Algorithms.