Skip to content

Latest commit

 

History

History
133 lines (91 loc) · 5.86 KB

readme.md

File metadata and controls

133 lines (91 loc) · 5.86 KB

NanoDriftGuard

License: MIT

This repository contains the official implementation of the research described in:

NanoDriftGuard: open-source isotropic ångström-scale active stabilization for super-resolution microscopy

Xiaofan Sun Zhengyi Zhan Chenying He et al.

Any reuse of this code should cite the original associated publication.

Introduction

Advanced active stabilization software achieving ångström-scale precision through sub-pixel image registration and incremental PID control. Built in MATLAB with GPU acceleration, NanoDriftGuard delivers real-time 3D drift correction at >50 Hz rates, making it ideal for ultra-high-precision microscopy applications. Its language-agnostic file I/O interface enables seamless integration with any programming environment, offering exceptional flexibility for diverse experimental setups.

Table of Contents

TOC


Quick Start

Demo or Speed Test

  1. Install the following prerequisites on a computer with a CUDA-compatible GPU:

    • MATLAB R2023a or later
      • Parallel Computing Toolbox
  2. Clone the repository

  3. Open MATLAB and navigate to the project folder

  4. Run the script Demo.m or Benchmark.m

Running in Real-Time with Actual Devices

Requirements

  • Specialized imaging system with fiducial marker detection capabilities
  • GenTL-compatible camera
    • MATLAB Image Acquisition Toolbox
    • MATLAB Image Acquisition Toolbox Support Package for GenICam™ Interface
  • Physik Instrumente (PI) nano-positioning stage

Note: Other hardware setups may require modifications to the control code.

Steps

  1. Edit the example configuration file NDG_Config.ini according to your specific setup

  2. Run the following code in the MATLAB command window:

    initMatlab;
    lventry('NDG_Config.ini');

    If the settings are correct, you should see a figure displaying the initial image along with the linear fit. The command window will then print the running status.

Note: The paths in the examples are configured for Windows-style path conventions. If you are using a different operating system, please modify the path-related code (e.g., lvini2struct in readConfig.m) accordingly.

Citation & Reference

This project builds upon Efficient subpixel image registration algorithms DOI

@article{guizar-sicairosEfficientSubpixelImage2008,
    author = {Guizar-Sicairos, Manuel and Thurman, Samuel T. and Fienup, James R.},
    title = {Efficient Subpixel Image Registration Algorithms},
    year = {2008},
    doi = {10.1364/OL.33.000156},
    journal = {Optics Letters}
}

Functions

Top-Level Function

  • lventry: Entry point for the real-time control loop

Core Functions & Classes

  • regisXpress3: High-efficiency 3D subpixel image registration with GPU acceleration, optimized for real-time applications
  • PidManager: Incremental PID controller for stage management, inherited from StageManager64

Utility Functions & Classes

  • StageManager64: Custom PI stage control class
  • fileManage: File management utilities
  • connectCam & getImg: Utility functions for GenTL camera connection and image acquisition
  • getReference: Utility function for reference image acquisition and parameters of Z estimation
  • readConfig: Utility function for reading ini configuration file in LabVIEW format

Limitations

This project does not include a GUI. You can create your own GUI for better visualization of the drift status using MATLAB figures or other platforms.

License

This project incorporates code from File Exchange, which is licensed under the BSD 3-Clause License.

NanoDriftGuard modifications are licensed under the MIT License.