Magni is a Python package which provides functionality for increasing the speed of image acquisition using Atomic Force Microscopy (AFM). The image acquisition algorithms of Magni are based on the Compressed Sensing (CS) signal acquisition paradigm and include both sensing and reconstruction. The sensing part of the acquisition generates sensed data from regular images possibly acquired using AFM. This is done by AFM hardware simulation. The reconstruction part of the acquisition reconstructs images from sensed data. This is done by CS reconstruction using well-known CS reconstruction algorithms modified for the purpose. The Python implementation of the above functionality uses the standard library, a number of third-party libraries, and additional utility functionality designed and implemented specifically for Magni. The functionality provided by Magni can thus be divided into five groups: - **Atomic Force Microscopy**: AFM specific functionality including AFM image acquisition, AFM hardware simulation, and AFM data file handling. - **Compressed Sensing**: General CS functionality including signal reconstruction and phase transition determination. - **Imaging**: General imaging functionality including measurement matrix and dictionary construction in addition to visualisation and evaluation. - **Reproducibility**: Tools that may aid in increasing the reproducibility of results obtained using Magni. - **Utilities**: General Python utilities including multiprocessing, tracing, and validation.


Project Slug


Last Built

3 years, 1 month ago passed


Home Page



python, compressed-sensing, afm, image-reconstruction, sparsity

Short URLs

Default Version


'latest' Version