Repository navigation
Changelog
v0.5.0 (October 2026)
Summary: v0.5.0 is a large release focused on GPU-first SLMs, a reworked camera geometry model (windowing, binning, color), a new Aperture/ZernikeBasis framework, package-wide logging, and a live viewer. The examples have been reworked, with new tutorials on simulated hardware and pixel calibration. It contains many breaking changes and correctness fixes, so please read Breaking Changes before upgrading. Fourier calibrations taken with 0.4 should be redone.
New Features
- GPU-First SLMs (
slm.py): SLM data stays on the GPU when cupy is installed (gpu=to control).set_gamma(),plot_gamma(), andget_realized_phase()model a measured, nonlinear phase response.SegmentedSLMandSLM.segment()split one SLM into independently addressable regions.set_phase(settle=)accepts a time in seconds as well asTrue/False.
- Enhanced Calibration (
cameraslms/):wavefront_calibrate_zernike_get()interpolates wavefront calibrations across the field of view.- Pixel calibration measures the pixel phase response (phase shift vs. display/control value) and saves it as the SLM's gamma.
- Fourier calibration survives changes to the camera's window, binning, and orientation.
ApertureandZernikeBasis(toolbox): oneApertureclass describes the SLM's illuminated region, set withSLM.set_aperture()or measured withSLM.fit_aperture().ZernikeBasiscaches mode images so Zernike sums and fits are a single matrix product, andimage_zernike_fit(gradient=True)fits wrapped phase in #195.- Camera Windowing and Binning (
camera.py):set_woi()andset_binning()work on every camera, falling back to software where the hardware can't. New properties (sensor_shape,origin,center) locate the image on the sensor, andOrientationTransformhandles flips and rotations in #192. - Simulation (
simulated.py): simulated SLMs and cameras now run on the GPU when cupy is installed, significantly accelerating simulated hardware.FourierSLM.simulate()carries over all calibrations and brightness, so simulations match the real setup. Saved setups reload as simulations, andSimulatedCameragains a noise model fit from a dark frame. - Live Viewer (
_viewer.py,_pyglet.py):.live()now works on SLMs, exports.png/.h5, and supports zoom and pan in #195. A newpygletbackend opens a standalone window for use outside Jupyter. - Performance: batched FFTs for like-sized planes in
MultiplaneHologram(#195), cached Zernike bases, GPU-resident camera feedback, faster viewer zoom and pan, and direct GPU-to-display writes inScreenMirroredvia pinned memory and cupy-OpenGL interop. - Holography and Analysis:
- Camera feedback can be restricted to a sub-image with
FeedbackHologram.set_target(roi=). - Holograms can be named, logged, and saved with
save(). - New analysis functions
image_aperture_fit(),image_lattice_detect(), andimage_strehl(). - New phase patterns
triangle(),ince_gaussian(),mathieu_gaussian(), andairy().
- Camera feedback can be restricted to a sub-image with
- Logging (
_logging.py):slmsuitenow uses standard Pythonloggingin place ofprint()and per-driververbose=flags, with extras on top. Console output is color-coded and tagged with the object that produced it,configure_logging()sets verbosity, andget_log()returns the session's log for the package or for a single object, which is also written into that object's saved files in #190, #194. - Testing: new test coverage for simulated hardware, remote control, the viewer, logging, plotting, and pickling.
- Plotting (
_plotting.py):configure_plotting()chooses whether plots are shown, suppressed, saved to a folder, or passed to a custom handler, which is useful for headless runs in #190. - Color Cameras (
camera.py): select a channel withcolor_channel=in #191. - Multi-PLM Support (
texasinstruments.py):PLM.open_all()configures and opens every connected TI PLM in one call in #195. - Array Backend (
misc/xp.py): helpers such asas_numpy()andis_gpu_array()for moving data between numpy and cupy.
Examples
The example notebooks have been overhauled for the 0.5.0 API.
- New: Simulated Hardware ports a calibrated experiment into simulation with
.simulate(), then compares spot power and shape against the hardware to show what limits uniformity. - New: Pixel Calibration measures the phase response of a 4-bit TI PLM, compares it with the vendor LUT, and covers settle calibration.
- Multipoint Calibration is rewritten around the new Zernike tools. It fits a multipoint wavefront calibration to Zernike polynomials and interpolates the correction across the field of view.
- Zernike Holography adds sections on the SLM
Aperture, theZernikeBasis, and interpolated Zernike holography. - Wavefront Calibration adds the live viewer and scores the result on simulated hardware.
- The remaining examples are updated for the new API, with new analysis and visualizations throughout.
Breaking Changes
- GPU arrays: with cupy installed,
slm.phase,display,grid,source[...], andFeedbackHologram.img_ijare cupy arrays. Usegpu=Falseorxp.as_numpy()before passing them to matplotlib, OpenCV, or SciPy. - Fourier calibration is stored relative to the raw sensor. Redo 0.4 calibrations taken with any rotation, window, or binning in #192.
- Superpixel calibration:
r2_fitandcontrast_fitwere swapped in 0.4. - Positional arguments moved in
Camera,PLM,Webcam,Server,set_binning(),autoexpose(),pixel_calibrate(),settle_calibrate(), andimage_zernike_fit(). Pass arguments by keyword. verbose=is replaced byslmsuite.configure_logging(), and most warnings are now log messages in #190, #194.- Camera WOI and binning:
Camera.woiis now read-only (useset_woi()),default_shapeis renamedsensor_shape, and binning moved fromThorCamto the base class in #192. - Aperture:
zernike_aperture()and theSLM.get_source_*()methods are replaced byAperture. Apertures default to"cropped", and the default beam radius (SLM.source_radius) changeslaguerre_gaussian(),hermite_gaussian(),axicon(), and Zernike scaling in #195. slm.sourceno longer has the"amplitude_*"keys, andfit_source_amplitude()now forwards tofit_aperture().- Imports:
slmsuite.hardwareis now a namespace package, andslmsuite.hardware.cameraslmsno longer re-exportstoolbox,analysis,Hologram, orcv2. - New defaults: MRAF is on by default (
null_region_radius_frac=sqrt(2)).pixel_calibrate()now samples 32 levels and 2 orders, andsettle_calibrate()autoexposes before measuring. reset_phase()no longer adds random phase by default by @philip-rk in #198.- Phase functions:
laguerre_gaussian()andhermite_gaussian()were wrong in 0.4.sinusoid()is now a cosine,binary()andbahtinov()start each period ata,axicon()honors negative focal lengths, and Noll indexing is fixed. lens()with only one finite focal length returns a cylindrical lens instead of a flat pattern by @philip-rk in #197.get_spot_radius_kxy()was π too large in 0.4, so default spot sizes inSpotHologramand Fourier calibration shrink.- Analysis:
window_slice()includes the far edge,take()/imprint(clip=False)raise on overhang, andblob_array_detect()defaults to autocorrelation.image_ellipticity_angle()andimage_variances(grid=)were wrong in 0.4. - Cameras:
autoexpose()returns at the exposure limit instead of raising, andpitch_um/bitresolutionaccount for binning and orientation. - Holography: unsupported
feedback=raises, and the"WGS-Wu"/"WGS-tanh"weightings are fixed. - TI PLM:
texas_instruments.yamlis renamedtexasinstruments.yaml, and legacy LUT loading is removed. - Remote errors no longer include the server traceback.
Renamed and removed:
| 0.4 | 0.5 |
|---|---|
blob_detect(img=), blob_array_detect(img=, size=) |
image=, array_shape= |
image_zernike_fit(iterations=, unwrap=) |
leastsquares= |
zernike_sum(use_mask="return") |
Aperture.mask |
Camera.autoexposure() |
autoexpose() (alias kept) |
fourier_calibrate(autoexposure=) |
autoexpose= (alias kept) |
Camera.default_shape |
sensor_shape |
Camera.woi = ... |
set_woi() |
SLM.grid = ... |
read-only |
ThorCam.set_binning(bx=, by=) |
Camera.set_binning(binning=) |
Webcam.set_woi() |
base-class software crop |
ScreenMirrored(slm_shape=), .display_resolution |
slm_resolution=, display_shape |
FeedbackHologram.update_target() |
set_target() |
SpotHologram.set_target(plot=), ALGORITHM_INDEX |
removed |
Hologram._remove_vortices() |
remove_vortices() |
settle_calibrate(settle_time_s=) |
removed |
SLM.get_source_center(), get_source_radius(), get_source_zernike_scaling(), set_source_aperture() |
SLM.source_radius, set_aperture() |
toolbox.phase.zernike_aperture() |
toolbox.Aperture |
matheui_gaussian() |
mathieu_gaussian() |
verbose= |
slmsuite.configure_logging() |
Cheetah640.autoexpose_xenics() |
set_autoexposure() |
Bug Fixes
remove_vortices()drew a plot but never actually removed vortices by @SAY-5 in #207 (fixes #205).- Quadratic initial phase:
reset_phase(quadratic_phase=True)crashed on aHologrambuilt withoutamp(fixes #209). - Hamamatsu: added the missing
close()and fixed the mode conversion and buffer size by @philip-rk in #178. - ThorCam: SDK crash on Windows from a missing DLL path by @tpr0p in #201.
- Basler: cameras that name their exposure
ExposureTimeAbsnow work by @philip-rk in #184 (fixes #179). null_region: the mask was transposed relative to the phase pattern by @philip-rk in #185.- Autoexposure and binning: an autoexposure bug and an integer overflow when binning in #192.
- Zernike masking and beam waist are now consistent between the SLM and the phase functions (addresses #108).
- Vendor SLM install: the wheel was missing the SLM model database, and the
slmsextra was missingpyyaml. - Conjugate gradient optimization did nothing under experimental feedback, and crashed with a scalar
amp, withMultiplaneHologram, or with MRAF targets. - SDK bindings:
Cheetah640could not be constructed, and Santec boundSLM_Ctrl_ReadTMtwice. - Camera capture: failed captures raise clear errors on
ThorCam,MindVision,FLIR, andBasler. Also fixedImagingSourcetransforming twice,Instrumentalexposure units,FLIRsoftware triggering, and a Santec init hang. - Superpixel calibration skipped some superpixels when
exclude_superpixelswas set. - Analysis:
smallest_distance()gave wrong results above 400 points,lloyds_points()swapped x and y, andzernike_convert_index()now accepts every indexing. - Crashes in
plot_farfield(axs=, cbar=True),Hologram(propagation_kernel=<float>),optimize()afterload_stats(),save_stats(include_state=True),image_remove_field(),polynomial(), and higher derivatives ofzernike_sum(). - Remote: unreachable servers raise
TimeoutError, sockets no longer leak, thepicklecommand can't read arbitrary attributes, and NumPy 2 dtypes encode correctly.
All Merged Pull Requests
- Fixed the Hamamatsu SLM functionality by @philip-rk in #178
- Added test for name of the Exposure time variable by @philip-rk in #184
- Fix
null_regionmeshgrid axis order by @philip-rk in #185 - Logging & Plotting Globals in #190
- Color camera support in #191
- WOI & Binning Revamp in #192
- Refactor logging for package-level/singleton logging in #194
- Add
ZernikeBasisand aperture in #195 - Fixes condition for creating lens patterns by @philip-rk in #197
- Changed default
random_phasevalue from True to False inholo.reset_phase()by @philip-rk in #198 - Fix TLCameraSDK access violation by @tpr0p in #201
- Make
Hologram.remove_vorticesactually remove vortices without plotting by @SAY-5 in #207 - Merge
commondevelopment branch intomainin #211
New Contributors
Full Changelog: v0.4.1...v0.5.0