Examples

All the examples are available as IPython Notebooks in the magni folder under ‘/examples/’. For an introduction to getting started with IPython Notebook see the official documentation.

Starting the IPython Notebook

Starting the IPython Notebook basically boils down to running:

ipython notebook

from a shell with the working directory set to the Magni ‘/examples/’ folder. Remember to make sure that magni is available as described in Download and Installation prior to starting the IPython Notebook.

Examples overview

An overview of the available examples is given in the below table:

IPython Notebook Name Example illustrates Magni functionality used
afm-io
  • Reading data from a mi-file.
  • Handling the resulting buffers and images.
  • magni.afm.io.read_mi_file
cs-phase_transition-config
  • Using Magni configuration modules including setting and getting configuration values.
cs-phase_transition
  • Estimating phase transitions using simulations.
  • Plotting phase transitions.
  • Plotting phase transition probability colormaps.
cs-reconstruction
  • Reconstruction of compressively sampled 1D signals.
imaging-dictionaries
  • Handling compressed sensing dictionaries using Magni.
imaging-domains
  • Easy handling of an image in the three domains: image, measurement and sparse (dictionary).
imaging-measurements
  • Handling sampling/measurement patterns using Magni.
  • Sampling a surface.
  • Sampling an image.
  • Illustrating sampling patterns.
imaging-preprocessing
  • Pre-processing an image prior to sampling
  • De-tilting AFM images.
magni
  • The typical work flow in compressively sampling and reconstructing AFM images using Magni.
reporducibility-data
  • Obtaining various platform and runtime data for annotations and chases.
reporducibility-io
  • Annotating an HDF5 database to help in improving the reproducibility of the results it contains.
util-matrices
  • Using the special Magni Matrix and MatrixCollection classes.
utils-multiprocessing
  • Doing multiprocessing using Magni.
utils-plotting
  • Using the predefined plotting options in Magni to create clearer and more visually pleasing plots.
utils-validation
  • Validation of function parameters.
  • Disabling input validation to reduce computation overhead.