Installation#
PyPI#
Install the stable version of slmsuite from PyPI using:
pip install slmsuite
GitHub#
Install the latest version of slmsuite from GitHub using:
pip install git+https://github.com/slmsuite/slmsuite
One can also clone slmsuite directly and add its directory to the Python path.
Remember to install the dependencies (next sections).
git clone https://github.com/slmsuite/slmsuite
Required Dependencies#
The following python packages are necessary to run slmsuite. These are listed as PyPI
dependencies and thus are installed automatically if PyPI (pip) is used to install.
One can also install these dependencies directly.
pip install -r requirements.txt
Hardware Dependencies#
The following python packages are optional acceleration or hardware requirements, which the user can install selectively.
- GPU
cupy, highly recommended for GPU-accelerated holography. Sometimes, installation is made complicated by a pre-installed version of CUDA. You can find the CUDA version with
nvcc --versionin a terminal, and then install an installation ofcupyspecific to CUDA versionYYwithpip install cupy-cudaYYx.
- Gradients
pytorch, required for conjugate gradient hologram optimization, either in GPU or CPU mode. Uses
cupy-torchinteroperability to pass data between modules without copying overhead, even on the GPU.
- Cameras
mvsdk (non-PyPI)
PySpin (non-PyPI)
tisgrabber (non-PyPI)
thorlabs_tsi_sdk (non-PyPI)
VmbPy (non-PyPI)
Other cameras are loaded directly via .dll.
- SLMs
Other SLMs are loaded directly via .dll.
- Image saving
For most images and videos, imageio
Many video formats additionally require pyav
For .gif optimization, pygifsicle
Jupyter#
We highly recommended using Jupyter
notebooks for interactive computing. Consider also using
IPython
magic,
features like %autoreload 2 or %matplotlib inline.
If Jupyter is not used, the default matplotlib plots will block further
execution, so the user should avoid plotting with plot=False flags on functions.
Use the following to install recommended jupyter-related packages.
pip install -r requirements_ipython.txt