Skip to content

Fast and Accurate 3D PSF Computation for Fluorescence Microscopy

License

Notifications You must be signed in to change notification settings

MicroscPSF/MicroscPSF-Cpp

Repository files navigation

C++17 port of the MicroscPSF-Matlab project

Compile and test C++

Status

Currently, this work is a very early work in progress. Refer to https://github.com/MicroscPSF/MicroscPSF-Matlab for the reference implementation.

Quick start

Ubuntu/Linux

Install the compiler toolchain and the BLAS/LAPACK library:

sudo apt install build-essentials

# Use Openblas or Atlas or the original BLAS/LAPACK.
sudo apt install libopenblas-dev

Install Meson the build system:

cd MicroscPSF-Cpp/
python3 -m venv .venv/
.venv/bin/pip3 install meson ninja

Compile everything

cd MicroscPSF-Cpp/
meson setup build/
ninja -C build all

Test everything

cd MicroscPSF-Cpp/build/
ninja test

(Optional) Install the example app

ninja install
cd MicroscPSF-Cpp/build/
meson configure -Dinstall_examples=true
ninja all
sudo ninja install

Running the examples

First, follow the Quick start instructions to build the example app. Then, given the following microscope configurations in the screenshot... MicroscPSF-Matlab GUI

... program the example C++ file at examples/generate-psf.cpp

microscope_params_t params{};
params.NA = 1.4;
params.ti0 = 150.0_um;
params.ni = 1.5;
params.ni0 = 1.5;
params.pz = 2.0_um;

precision_li2017_t precision{};
precision.num_basis = 153;
precision.rho_samples = 1000;

const auto psf =
    makePSF(params, {0.1_um, 0.25_um}, {256, 128}, 0.610_um, precision);

Next, repeat the Quick start steps to re-compile the C++ app. Run ninja test to invoke the compiled example. Locate the outputs psf_xy.pgm, psf_xz.pgm, and psf.h5. The XZ cross-section of the C++-simulated PSF should match the screenshot above.

Appendix: Bessel function support

About

Fast and Accurate 3D PSF Computation for Fluorescence Microscopy

Resources

License

Stars

Watchers

Forks

Packages

No packages published