Skip to content

Latest commit

 

History

History
64 lines (50 loc) · 3.46 KB

README.md

File metadata and controls

64 lines (50 loc) · 3.46 KB

UMPA++

This repository contains an improved, faster implementation of the "Unified Modulated Pattern Analysis" (UMPA) model, which is achieved through the use of C++ and Cython. A publication describing and explaining this work can be found at

F. De Marco, S. Savatović, R. Smith, V. Di Trapani, M. Margini, G. Lautizi, and P. Thibault, "High-speed processing of X-ray wavefront marking data with the Unified Modulated Pattern Analysis (UMPA) model," Opt. Express 31, 635-650 (2023).

Please cite this work when using this version of UMPA!

Related work

Installation instructions

In the current state, this repository is only compatible with Linux, and has only been tested with the gcc / g++ compiler.

Error with latest Cython version

The latest release of Cython seems to be causing some issues with the install process which we are investigating. In the meantime, reverting to an older version seems to help:

pip install Cython==0.29.37 --force-reinstall

Linux

Installation via

python setup.py install

or

pip install UMPA/

should be possible.

Windows

Compilation with Microsoft Visual Studio under Windows is possible, but requires the modification of setup.py.

  • Download "Visual Studio 2022, community version", select "Desktop development with C++" under "Workloads" when starting Visual Studio.
  • In setup.py, modify
ext_1 = Extension(SRC_DIR + ".model",
                  [SRC_DIR + "/model.pyx"],
                  language="c++",
                  libraries=["m"],
                  extra_compile_args=["-std=c++17", "-O3", "-ffast-math", "-march=native", "-fopenmp" ],
                  extra_link_args=['-fopenmp'],
                  include_dirs=[np.get_include()])

to

ext_1 = Extension(SRC_DIR + ".model",
                  [SRC_DIR + "/model.pyx"],
                  language="c++",
                  extra_compile_args=["/std:c++17", "/O2", "/fp:fast", "/favor:INTEL64", "/openmp" ],
                  include_dirs=[np.get_include()])

This should work, it was tested on a Windows 11 laptop, multithreading works too. I'll modify setup.py to do this change automatically depending on architecture...

Mac

Installation on Mac currently fails due to unknown reasons.