### Install All Optional Dependencies Source: https://slmsuite.readthedocs.io/en/latest/installation.html Install all optional dependencies at once, including GPU, SLMs, cameras, images, and Jupyter support, using the 'dev' extra. ```bash pip install -e ".[dev]" ``` -------------------------------- ### Install SLMSUITE from PyPI Source: https://slmsuite.readthedocs.io/en/latest/_sources/installation.rst.txt Install the stable version of SLMSUITE from the Python Package Index (PyPI). This is the recommended method for most users. ```console pip install slmsuite ``` -------------------------------- ### Install SLMSUITE from GitHub Source: https://slmsuite.readthedocs.io/en/latest/installation.html Install the latest development version of slmsuite directly from its GitHub repository. ```bash pip install git+https://github.com/holodyne/slmsuite ``` -------------------------------- ### Install SLMSUITE from PyPI Source: https://slmsuite.readthedocs.io/en/latest/installation.html Install the stable version of slmsuite from the Python Package Index. ```bash pip install slmsuite ``` -------------------------------- ### Simulate SLM and Camera Setup Source: https://slmsuite.readthedocs.io/en/latest/_examples/computational_holography.html Creates virtual SLM and camera objects for simulation purposes. Initializes a FourierSLM setup to hold both devices. ```python # Create a virtual SLM and camera from slmsuite.hardware.slms.simulated import SimulatedSLM from slmsuite.hardware.cameras.simulated import SimulatedCamera from slmsuite.hardware.cameraslms import FourierSLM # Assume a 532 nm laser wav_um = 0.532 slm = SimulatedSLM((slm_size[1], slm_size[0]), pitch_um=(10, 10), wav_um=wav_um) camera = SimulatedCamera(slm) # The setup (a FourierSLM setup with a camera placed in the Fourier plane of an SLM) holds the camera and SLM. setup = FourierSLM(camera, slm) hologram.cameraslm = setup ``` -------------------------------- ### Install All Optional Dependencies (Development) Source: https://slmsuite.readthedocs.io/en/latest/_sources/installation.rst.txt Install all optional dependencies at once using the 'dev' extra. This includes GPU, SLMs, cameras, images, Jupyter, docs, and testing dependencies for a full development environment. ```console pip install -e ".[dev]" ``` -------------------------------- ### Install Image Saving Dependencies Source: https://slmsuite.readthedocs.io/en/latest/installation.html Install optional dependencies for saving images and videos, such as imageio and pyav for various formats. ```bash pip install -e ".[images]" ``` -------------------------------- ### Install Camera Dependencies Source: https://slmsuite.readthedocs.io/en/latest/installation.html Install optional dependencies required for interfacing with various camera hardware. This includes libraries like instrumental-lib and pylablib. ```bash pip install -e ".[cameras]" ``` -------------------------------- ### setup Source: https://slmsuite.readthedocs.io/en/latest/_autosummary/slmsuite.hardware.cameras.xenics.Cheetah640.html Sets up sample pre-configured imaging profiles. This is likely to be reconfigured by the end-user for various imaging tasks. ```APIDOC ## setup ### Description Sample pre-configured imaging profiles. Likely to be reconfigured by end-user for various imaging tasks. ### Parameters * **profile** - Required - See `profile`. * **fpt** (int) - Optional - Frames per trigger for input trigger. Defaults to 1. ``` -------------------------------- ### Install SLMSUITE from GitHub Source: https://slmsuite.readthedocs.io/en/latest/_sources/installation.rst.txt Install the latest development version of SLMSUITE directly from its GitHub repository. This is useful for accessing the newest features or contributing to the project. ```console pip install git+https://github.com/holodyne/slmsuite ``` -------------------------------- ### Install PyTorch for Gradients Source: https://slmsuite.readthedocs.io/en/latest/installation.html Install optional dependencies for gradient-based hologram optimization using PyTorch. This can utilize cupy for GPU acceleration. ```bash pip install -e ".[torch]" ``` -------------------------------- ### Install Dependencies from Local Clone Source: https://slmsuite.readthedocs.io/en/latest/_sources/installation.rst.txt Install all necessary dependencies for SLMSUITE when working from a local clone of the repository. This command should be run from within the cloned package directory. ```console pip install -e . ``` -------------------------------- ### Install Image Saving Dependencies Source: https://slmsuite.readthedocs.io/en/latest/_sources/installation.rst.txt Install optional dependencies for image and video saving, including imageio, pyav for video formats, and pygifsicle for GIF optimization. ```console pip install -e ".[images]" ``` -------------------------------- ### Install Jupyter Support Packages Source: https://slmsuite.readthedocs.io/en/latest/installation.html Install optional packages recommended for using Jupyter notebooks with SLMSUITE, enhancing interactive computing capabilities. ```bash pip install -e ".[jupyter]" ``` -------------------------------- ### Install SLM Dependencies Source: https://slmsuite.readthedocs.io/en/latest/_sources/installation.rst.txt Install optional dependencies for controlling Spatial Light Modulators (SLMs), primarily pyglet. Other SLMs can be loaded via .dll files. ```console pip install -e ".[slms]" ``` -------------------------------- ### Server Setup for Remote Hardware Control Source: https://slmsuite.readthedocs.io/en/latest/_autosummary/slmsuite.hardware.remote.html Sets up a server to host simulated SLM and camera hardware for remote access. This code should be run in the server environment. ```python from slmsuite.hardware.slms.simulated import SimulatedSLM from slmsuite.hardware.cameras.simulated import SimulatedCamera from slmsuite.hardware.remote import Server slm = SimulatedSLM((1600, 1200), pitch_um=(8,8), name="remote_slm") cam = SimulatedCamera(slm, (1440, 1100), pitch_um=(4,4), gain=50, name="remote_camera") server = Server( hardware=[slm, cam], port=5025, ) ``` -------------------------------- ### Initialize Instrumental Camera Source: https://slmsuite.readthedocs.io/en/latest/_autosummary/slmsuite.hardware.cameras.instrumental.Instrumental.html Demonstrates how to initialize and wrap an instrumental camera using the Instrumental class. This example shows loading a legacy Thorlabs camera and then wrapping it. ```python from instrumental.drivers.cameras.uc480 import UC480Camera i_cam = UC480Camera() from slmsuite.hardware.cameras.instrumental import Instrumental cam = Instrumental(i_cam) ``` -------------------------------- ### Get Hardware Info Source: https://slmsuite.readthedocs.io/en/latest/_examples/experimental_holography.html Use the `.info()` static method to list available hardware. This is useful for identifying connected devices before initialization. ```python PLM.info(); ``` ```text Display Positions: #, Position 0, x=0, y=0, width=1920, height=1080 (main) 1, x=1920, y=0, width=2716, height=1600 (has ScreenMirrored) ``` ```python from slmsuite.hardware.cameras.flir import FLIR FLIR.info(); ``` ```text 0: 22562470 (Blackfly S BFS-U3-161S7M) ``` -------------------------------- ### Install Required Dependencies Locally Source: https://slmsuite.readthedocs.io/en/latest/installation.html Install core Python dependencies for slmsuite when working from a local clone. This command is run from within the package directory. ```bash pip install -e . ``` -------------------------------- ### Install Jupyter Dependencies Source: https://slmsuite.readthedocs.io/en/latest/_sources/installation.rst.txt Install recommended Jupyter-related packages for interactive computing. This enables the use of Jupyter notebooks with SLMSUITE. ```console pip install -e ".[jupyter]" ``` -------------------------------- ### Initialize Physical or Virtual Hardware Source: https://slmsuite.readthedocs.io/en/latest/_examples/zernike_holography.html This snippet demonstrates loading physical SLM and camera hardware, with a fallback to simulated hardware if physical loading fails. It includes camera region-of-interest cropping and SLM calibration. ```python # Try to load physical hardware. try: from slmsuite.hardware.slms.texasinstruments import PLM from slmsuite.hardware.cameras.flir import FLIR # Load the hardware. slm = PLM('p67', 1, wav_um=0.488, settle_time_s=0.05, configure_usb=True); print() cam = FLIR(serial="22562470", pitch_um=2.74) # For this camera, we also want to crop the WOI to the center 1024x1024 area. h_max, w_max = cam.default_shape cam.set_woi(((w_max - 1024) // 2, 1024, (h_max - 1024) // 2, 1024)) # Load the composite CameraSLM. fs = FourierSLM(cam, slm) fs.load_calibration("wavefront_superpixel"); fs.wavefront_calibration_superpixel_process(plot=True, r2_threshold=.8) # Fallback to virtual hardware. except Exception as e: print(f"Loading physical hardware failed; loading virtual hardware. Error:\n{str(e)}") from slmsuite.hardware.slms.simulated import SimulatedSLM from slmsuite.hardware.cameras.simulated import SimulatedCamera # Make the SLM and camera. slm = SimulatedSLM((1600, 1200), pitch_um=(8,8)) # Program the simulated and calibrated sources to be flat phase. slm.set_source_analytic(sim=True) slm.set_source_analytic() cam = SimulatedCamera(slm, (1440, 1100), pitch_um=(4,4), gain=200) # Tie the camera and SLM together with an analytic calibration. fs = FourierSLM(cam, slm) M, b = fs.fourier_calibration_build( f_eff=80000., # f_eff of 80000 wavelengths or 80 mm with the default 1 um wavelength theta=5 * np.pi / 180, ) cam.set_affine(M, b) fs.fourier_calibrate_analytic(M, b) ``` -------------------------------- ### Clone SLMSUITE Repository Source: https://slmsuite.readthedocs.io/en/latest/_sources/installation.rst.txt Clone the SLMSUITE source code from GitHub. This is a prerequisite for development installs and for installing dependencies directly. ```console git clone https://github.com/holodyne/slmsuite ``` -------------------------------- ### Initialize SLM and Camera Hardware Source: https://slmsuite.readthedocs.io/en/latest/_examples/structured_light.html This snippet attempts to load physical SLM and camera hardware, falling back to simulated versions if unsuccessful. It also loads and processes wavefront calibration data. Ensure necessary libraries are installed for physical hardware. ```python # Try to load physical hardware. try: from slmsuite.hardware.slms.texasinstruments import PLM from slmsuite.hardware.cameras.flir import FLIR # Load the hardware. slm = PLM('p67', 1, wav_um=0.488, settle_time_s=0.05, configure_usb=True); print() cam = FLIR(serial="22562470", pitch_um=2.74) # For this camera, we also want to crop the WOI to the center 1024x1024 area. h_max, w_max = cam.default_shape cam.set_woi(((w_max - 1024) // 2, 1024, (h_max - 1024) // 2, 1024)) # Load the composite CameraSLM. fs = FourierSLM(cam, slm) fs.load_calibration("wavefront_superpixel"); # We'll come back to this next tutorial! fs.wavefront_calibration_superpixel_process(plot=True, r2_threshold=.8) # Fallback to virtual hardware. except Exception as e: print(f"Loading physical hardware failed; loading virtual hardware. Error:\n{str(e)}") from slmsuite.hardware.slms.simulated import SimulatedSLM from slmsuite.hardware.cameras.simulated import SimulatedCamera # Make the SLM and camera. slm = SimulatedSLM((1600, 1200), pitch_um=(8,8)) # Program the simulated and calibrated sources to be flat phase. slm.set_source_analytic(sim=True) slm.set_source_analytic() cam = SimulatedCamera(slm, (1440, 1100), pitch_um=(4,4), gain=200) # Tie the camera and SLM together with an analytic calibration. fs = FourierSLM(cam, slm) M, b = fs.fourier_calibration_build( f_eff=80000., # f_eff of 80000 wavelengths or 80 mm with the default 1 um wavelength theta=5 * np.pi / 180, ) cam.set_affine(M, b) fs.fourier_calibrate_analytic(M, b) ``` -------------------------------- ### setup_grabber Source: https://slmsuite.readthedocs.io/en/latest/_autosummary/slmsuite.hardware.cameras.xenics.Cheetah640.html Sets up the frame grabber capture mode. ```APIDOC ## setup_grabber ### Description Setup frame grabber capture mode. ### Parameters * **mode** (int) - Optional - Capture mode. 0: circular buffer, 1: waits till all frames grabbed before restarting capture, 2: non-circular (Stops grabbing when buffer filled). Defaults to 0. * **frames** (int) - Optional - Number of frames to capture. Defaults to 4000. ``` -------------------------------- ### Install GPU Acceleration Dependencies Source: https://slmsuite.readthedocs.io/en/latest/installation.html Install optional dependencies for GPU acceleration, including cupy. Ensure your CUDA version is compatible. ```bash pip install -e ".[gpu]" ``` -------------------------------- ### Install PyTorch Dependencies Source: https://slmsuite.readthedocs.io/en/latest/_sources/installation.rst.txt Install optional dependencies for PyTorch, which is required for conjugate gradient hologram optimization. This enables both GPU and CPU modes. ```console pip install -e ".[torch]" ``` -------------------------------- ### Install GPU Acceleration Dependencies Source: https://slmsuite.readthedocs.io/en/latest/_sources/installation.rst.txt Install optional dependencies required for GPU acceleration, including CuPy. This command enables GPU-accelerated holography. ```console pip install -e ".[gpu]" ``` -------------------------------- ### Server Initialization Source: https://slmsuite.readthedocs.io/en/latest/_autosummary/slmsuite.hardware.remote.Server.html Initializes a server to host slmsuite hardware: cameras and SLMs. Interface with this server using RemoteSLM and RemoteCamera. ```APIDOC ## Server ### Description Server for handling client commands and interfacing with hardware. ### Method __init__ ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **hardware** (List[object]) - Required - List of hardware objects to serve. * **port** (int) - Optional - Port number to serve on. Defaults to 5025 (commonly used for instrument control). * **timeout** (float) - Optional - Timeout in seconds for the server to wait for a client. Defaults to 0.5. * **allowlist** (Optional[List[str]]) - Optional - List of IP addresses to allow to connect. Defaults to None (allow all). Keep in mind that IP addresses can be spoofed, so this allowlist provides only modest security. ``` -------------------------------- ### Initialize SLM and Camera Source: https://slmsuite.readthedocs.io/en/latest/_examples/multiplane_holography.html Initializes physical or virtual SLM and camera hardware, including loading calibration data. Use this to set up your optical system. ```python # Try to load physical hardware. try: from slmsuite.hardware.slms.texasinstruments import PLM from slmsuite.hardware.cameras.flir import FLIR # Load the hardware. slm = PLM('p67', 1, wav_um=0.488, settle_time_s=0.05, configure_usb=True); print() cam = FLIR(serial="22562470", pitch_um=2.74, bitdepth=12) # For this camera, we also want to crop the WOI to the center 1024x1024 area. h_max, w_max = cam.default_shape d_im = 1920 cam.set_woi(((w_max - d_im) // 2, d_im, (h_max - d_im) // 2, d_im)) # Load the composite CameraSLM. fs = FourierSLM(cam, slm) fs.load_calibration("wavefront_superpixel"); fs.wavefront_calibration_superpixel_process(plot=True, r2_threshold=.8) # Fallback to virtual hardware. except Exception as e: print(f"Loading physical hardware failed; loading virtual hardware. Error:\n{str(e)}") from slmsuite.hardware.slms.simulated import SimulatedSLM from slmsuite.hardware.cameras.simulated import SimulatedCamera # Make the SLM and camera. slm = SimulatedSLM((1600, 1200), pitch_um=(8,8)) # Program the simulated and calibrated sources to be flat phase. slm.set_source_analytic(sim=True) slm.set_source_analytic() cam = SimulatedCamera(slm, (1440, 1100), pitch_um=(4,4), gain=200) # Tie the camera and SLM together with an analytic calibration. fs = FourierSLM(cam, slm) M, b = fs.fourier_calibration_build( f_eff=80000., # f_eff of 80000 wavelengths or 80 mm with the default 1 um wavelength theta=5 * np.pi / 180, ) cam.set_affine(M, b) fs.fourier_calibrate_analytic(M, b) ``` -------------------------------- ### SimulatedCamera Initialization Source: https://slmsuite.readthedocs.io/en/latest/_autosummary/slmsuite.hardware.cameras.simulated.SimulatedCamera.html Initializes the SimulatedCamera. This method sets up the camera, optionally displaying a live viewer and controls. ```APIDOC ## SimulatedCamera.__init__() ### Description Initializes the SimulatedCamera, optionally creating a live viewer and controls. ### Parameters * **activate** (_bool OR None_) – If `True`, creates a live viewer in the current cell, destroying any other attached viewer. If `False`, destroys any other attached viewer. If `None`, toggles the live viewer, destroying any attached viewer or creating one in the current cell if none is attached. Defaults to `None`. * **widgets** (_bool_) – If `True`, also displays sliders and controls used to hone the display properties. * **backend** (_str_) – Placeholder option for different types of viewers. The default is `"ipython"`. * ****kwargs** – Options passed to the `_CameraViewer` to customize the default settings. These features will be made less hidden in the future. Most things are customizable via these keywords. For instance, the user can pass a custom list of colormaps to appear in the widget dropdown as `cmap_options=`. ``` -------------------------------- ### Load Vendor Phase Calibration (Commented Out) Source: https://slmsuite.readthedocs.io/en/latest/_examples/wavefront_calibration.html This snippet shows how to load vendor-provided phase calibration data from a CSV file. The code is commented out as the example did not have access to the calibration file. Update the file_path to load your specific calibration data. ```python # slm.load_vendor_phase_correction( # file_path='Wavefront_correction_Data_221136000005(830nm).csv', # Update this path to load your calibration # smooth=True # ) ``` -------------------------------- ### get_exposure() Source: https://slmsuite.readthedocs.io/en/latest/_autosummary/slmsuite.hardware.cameras.camera.Camera.html Get the frame integration time in seconds. ```APIDOC ## get_exposure() ### Description Get the frame integration time in seconds. Used in `autoexposure()`. ### Method `get_exposure()` ### Returns * **Integration time** (float) - The integration time in seconds. ``` -------------------------------- ### List Available SLM Displays Source: https://slmsuite.readthedocs.io/en/latest/_examples/experimental_holography.html Use the .info() static method to list available displays for ScreenMirrored SLMs. This helps identify the correct display number for configuration. ```python from slmsuite.hardware.slms.texasinstruments import PLM PLM.info(); ``` -------------------------------- ### CG Loss Function Example Source: https://slmsuite.readthedocs.io/en/latest/_autosummary/slmsuite.holography.algorithms.Hologram.html This example demonstrates how a user-provided `torch.nn.Module` is used as a loss function for the Conjugate Gradient (CG) optimization method. The loss function receives the computed farfield (with gradients) and target values, and its `backward()` method is called internally to back-propagate gradients to the phase. ```python result = loss( farfield, target ) result.backward() ``` -------------------------------- ### Get Weights Source: https://slmsuite.readthedocs.io/en/latest/_autosummary/slmsuite.holography.algorithms.SpotHologram.html Returns the current weights, collecting them from the GPU if applicable. ```python get_weights() ``` -------------------------------- ### Camera Initialization Source: https://slmsuite.readthedocs.io/en/latest/_autosummary/slmsuite.hardware.cameras.camera.Camera.html Initializes a camera with specified parameters, including resolution, bit depth, and transformation settings. ```APIDOC ## `__init__` Initializes a camera. In addition to the other class attributes, accepts the following parameters to set `transform`. See `get_orientation_transformation()`. Parameters: * `_resolution_` (tuple): The resolution of the camera (height, width). * `_bitdepth` (int, optional): The bit depth of the camera. Defaults to 8. * `_pitch_um` (float or tuple, optional): The pixel pitch in microns. Defaults to None. * `_name` (str, optional): An identifier for the camera. Defaults to 'camera'. * `_exposure_bounds_s` (tuple, optional): The shortest and longest allowable integration times in seconds. Defaults to None. * `_averaging` (int or None, optional): The default setting for averaging. Defaults to None. * `_capture_attempts` (int, optional): The number of capture attempts in case of errors. Defaults to 5. * `_hdr` (tuple or None, optional): The default setting for High Dynamic Range imaging. Defaults to None. * `_rot` (str, optional): Rotation setting ('0', '90', '180', '270'). Defaults to '0'. * `_fliplr` (bool, optional): Whether to flip the image horizontally. Defaults to False. * `_flipud` (bool, optional): Whether to flip the image vertically. Defaults to False. ``` -------------------------------- ### MMCore Get Images Source: https://slmsuite.readthedocs.io/en/latest/_autosummary/slmsuite.hardware.cameras.mmcore.MMCore.html Captures a specified number of images in succession. ```APIDOC ## get_images ### Description Grab `image_count` images in succession. ### Parameters * **image_count** (_int_) – The number of images to capture. ``` -------------------------------- ### MindVision Get Images Source: https://slmsuite.readthedocs.io/en/latest/_autosummary/slmsuite.hardware.cameras.mindvision.MindVision.html Grabs a specified number of images in succession. ```APIDOC ## get_images ### Description Grab `image_count` images in succession. ``` -------------------------------- ### configure Source: https://slmsuite.readthedocs.io/en/latest/_autosummary/slmsuite.hardware.cameras.xenics.Cheetah640.html Loads a pre-stored imaging profile from an XC_SaveSettings XCF file. ```APIDOC ## configure ### Description Loads pre-stored imaging profile from XC_SaveSettings XCF file. ### Parameters * **format_file** (str) - Required - Path to XCF file containing format information. ``` -------------------------------- ### MindVision Get Image Source: https://slmsuite.readthedocs.io/en/latest/_autosummary/slmsuite.hardware.cameras.mindvision.MindVision.html Captures, processes, and returns an image from the camera. ```APIDOC ## get_image ### Description Capture, process, and return images from a camera. ``` -------------------------------- ### live Source: https://slmsuite.readthedocs.io/en/latest/_autosummary/slmsuite.hardware.cameras.remote.RemoteCamera.html Creates and displays an IPython camera viewer for live image display. ```APIDOC ## live Creates and displays an IPython camera viewer. ``` -------------------------------- ### Initialize and Wrap a PyLabLib Camera Source: https://slmsuite.readthedocs.io/en/latest/_autosummary/slmsuite.hardware.cameras.pylablib.PyLabLib.html Demonstrates how to load a legacy Thorlabs camera using a specific driver and then wrap it with the PyLabLib class for compatibility with SLMSuite. This is essential for using pylablib cameras within the SLMSuite ecosystem. ```python import pylablib as pll pll.par["devices/dlls/uc480"] = "path/to/uc480/dlls" from pylablib.devices.uc480 import UC480Camera pll_cam = UC480Camera() # Wrap the camera with the slmsuite-compatible class. from slmsuite.hardware.cameras.pylablib import PyLabLib cam = PyLabLib(pll_cam) ``` -------------------------------- ### Get Source Center Source: https://slmsuite.readthedocs.io/en/latest/_autosummary/slmsuite.hardware.slms.holoeye.Holoeye.html Extracts the scaling for `zernike_aperture()` from the scalars computed in `fit_source_amplitude()`. ```APIDOC ## get_source_center ### Description Extracts the scaling for `zernike_aperture()` from the scalars computed in `fit_source_amplitude()`. ``` -------------------------------- ### Get Multiple Images Source: https://slmsuite.readthedocs.io/en/latest/_autosummary/slmsuite.hardware.cameras.imagingsource.ImagingSource.html Grabs a specified number of images in succession from the camera. ```APIDOC ## get_images ### Description Grab `image_count` images in succession. ### Parameters * **image_count** (int) - The number of images to grab. ``` -------------------------------- ### PyLabLib Initialization Source: https://slmsuite.readthedocs.io/en/latest/_autosummary/slmsuite.hardware.cameras.pylablib.PyLabLib.html Initializes the PyLabLib camera wrapper. Requires a pre-initialized pylablib camera object. ```APIDOC ## __init__ ### Description Initialize camera and attributes. Initial profile is "single". ### Parameters * **cam** (_pylablib.devices.interface.camera.Camera_) – Required. This class is just a wrapper for `pylablib`, so the user must pass a constructed `pylablib` camera. For example: ```python # Load a legacy Thorlabs camera using the UC480 driver. import pylablib as pll pll.par["devices/dlls/uc480"] = "path/to/uc480/dlls" from pylablib.devices.uc480 import UC480Camera pll_cam = UC480Camera() # Wrap the camera with the slmsuite-compatible class. from slmsuite.hardware.cameras.pylablib import PyLabLib cam = PyLabLib(pll_cam) ``` * **pitch_um** (_(__float__,__float__)_ OR None_) – Optional. Fill in extra information about the pixel pitch in `(dx_um, dy_um)` form to use additional calibrations. * **verbose** (_bool_) – Optional. Whether or not to print extra information. * **kwargs** – See `Camera.__init__()` for permissible options. ### Raises * **RuntimeError** – If the camera can not be reached. ``` -------------------------------- ### start_capture Source: https://slmsuite.readthedocs.io/en/latest/_autosummary/slmsuite.hardware.cameras.xenics.Cheetah640.html Initiates the current capture run. ```APIDOC ## start_capture ### Description Initiates the current capture run. ``` -------------------------------- ### MMCore Get Image Source: https://slmsuite.readthedocs.io/en/latest/_autosummary/slmsuite.hardware.cameras.mmcore.MMCore.html Captures, processes, and returns a single image from the camera. ```APIDOC ## get_image ### Description Capture, process, and return images from a camera. ### Returns Captured and processed image data. ``` -------------------------------- ### MindVision Get Exposure Source: https://slmsuite.readthedocs.io/en/latest/_autosummary/slmsuite.hardware.cameras.mindvision.MindVision.html Retrieves the current frame integration time in seconds. ```APIDOC ## get_exposure ### Description Get the frame integration time in seconds. ``` -------------------------------- ### Camera Utilities Source: https://slmsuite.readthedocs.io/en/latest/_autosummary/slmsuite.hardware.cameras.basler.Basler.html Includes methods for testing core hardware functionality and creating a live camera viewer. ```APIDOC ## test ### Description Tests the core hardware methods of `Camera`. ``` ```APIDOC ## live ### Description Creates and displays an IPython camera viewer. ``` -------------------------------- ### Get Source Zernike Scaling Source: https://slmsuite.readthedocs.io/en/latest/_autosummary/slmsuite.hardware.slms.holoeye.Holoeye.html Extracts the scaling for `zernike_aperture()` from the scalars computed in `fit_source_amplitude()`. ```APIDOC ## get_source_zernike_scaling ### Description Extracts the scaling for `zernike_aperture()` from the scalars computed in `fit_source_amplitude()`. ``` -------------------------------- ### Digitization Bitdepth Control Source: https://slmsuite.readthedocs.io/en/latest/_autosummary/slmsuite.hardware.cameras.basler.Basler.html Methods to set and get the camera's digitization bitdepth. ```APIDOC ## set_adc_bitdepth ### Description Set the digitization bitdepth. ### Parameters * **bitdepth** (_int_) – Desired digitization bitdepth. ``` ```APIDOC ## get_adc_bitdepth ### Description Get the digitization bitdepth. ### Returns The digitization bitdepth. ### Return type int ``` -------------------------------- ### setup_output_trigger Source: https://slmsuite.readthedocs.io/en/latest/_autosummary/slmsuite.hardware.cameras.xenics.Cheetah640.html Configures the output trigger settings. ```APIDOC ## setup_output_trigger ### Description Configures output trigger. ### Parameters * **enable** (bool) - Optional - Whether to enable the output trigger. Defaults to True. * **mode** (int) - Optional - Trigger properties. 0: active low, 1: active high. Defaults to 1. * **source** (int) - Optional - Source of the input trigger. 0: integration start, 1: trigger input, 2: integration period. Defaults to 2. * **delay** (float) - Optional - Trigger delay in microseconds. Defaults to 0. * **width** (float) - Optional - Number of frames to skip after trigger. Defaults to 10. * **verbose** (bool) - Optional - Enable debug printout. Defaults to False. ``` -------------------------------- ### MMCore Get Exposure Source: https://slmsuite.readthedocs.io/en/latest/_autosummary/slmsuite.hardware.cameras.mmcore.MMCore.html Retrieves the current frame integration time (exposure) of the camera in seconds. ```APIDOC ## get_exposure ### Description Get the frame integration time in seconds. ### Returns Frame integration time in seconds. ### Return type float ``` -------------------------------- ### Initialize SLM and Camera System Source: https://slmsuite.readthedocs.io/en/latest/_examples/wavefront_calibration.html Initializes the SLM and camera, either with physical hardware (PLM, FLIR) or simulated equivalents. Configures camera region of interest and ties the camera and SLM together with an analytic calibration. ```python # Try to load physical hardware. try: from slmsuite.hardware.slms.texasinstruments import PLM from slmsuite.hardware.cameras.flir import FLIR # Load the hardware. slm = PLM('p67', 1, wav_um=0.488, settle_time_s=0.05, configure_usb=True); print() cam = FLIR(serial="22562470", pitch_um=2.74, bitdepth=12) # For this camera, we also want to crop the WOI to the center 1024x1024 area. h_max, w_max = cam.default_shape cam.set_woi(((w_max - 1024) // 2, 1024, (h_max - 1024) // 2, 1024)) # Load the composite CameraSLM. fs = FourierSLM(cam, slm) # Fallback to virtual hardware. except Exception as e: print(f"Loading physical hardware failed; loading virtual hardware. Error:\n{str(e)}") from slmsuite.hardware.slms.simulated import SimulatedSLM from slmsuite.hardware.cameras.simulated import SimulatedCamera # Make the SLM and camera. slm = SimulatedSLM((1600, 1200), pitch_um=(8,8)) from slmsuite.holography.toolbox.phase import zernike_sum phase_aberration = zernike_sum( slm, indices=(3, 4, 5, 7, 8), weights=(1, -2, 3, 1, 1), aperture=None, use_mask=False ) slm.set_source_analytic( phase_offset=phase_aberration, sim=True ) slm.plot_source(sim=True) cam = SimulatedCamera(slm, (1440, 1100), pitch_um=(4,4), gain=200) # Tie the camera and SLM together with an analytic calibration. fs = FourierSLM(cam, slm) M, b = fs.fourier_calibration_build( f_eff=80000., # f_eff of 80000 wavelengths or 80 mm with the default 1 um wavelength theta=5 * np.pi / 180, ) cam.set_affine(M, b) fs.fourier_calibrate_analytic(M, b) ``` -------------------------------- ### MindVision Print Capability Source: https://slmsuite.readthedocs.io/en/latest/_autosummary/slmsuite.hardware.cameras.mindvision.MindVision.html A MindVision specific method to print the capability of the camera, copied from MindVision examples. ```APIDOC ## print_capability ### Description MindVision specific method (copied from MindVision examples) to print the capability of the camera. ```