Skip to content

Repository files navigation

WBIM

WBIM is an all-optical serial multiphoton microscope designed for sub-micrometer resolution 3D imaging of organ-scale complex tissue. This system combines multiphoton microscopy with femtosecond laser machining to iteratively image and remove biological tissues with distinct optical and mechanical properties. The system has been tested for in situ imaging of the mouse brain-skull system.

This pipeline was developed using MATLAB 2021b and Python 3.10 on Windows 10. Basic two-photon microscopy operations were implemented using ScanImage. As this repository serves as instrument control software, running the code requires proper setup of the associated hardware, which is detailed in the referenced paper.

Repository Overview

This repository contains the software and computational pipelines developed to enable multiday-long automated acquisition. Below is a detailed breakdown of the repository structure:

  1. Analysis contains the MATLAB script and classes for analyzing experimental results.
  2. Calibration contains the MATLAB scripts and classes for instrument calibration, including:
    1. Automated HWP-PBS-based laser power control calibration
    2. Automated Pockels-cell-PBS-based laser power control calibration
    3. Servo motorized stage controller delay correction
    4. Femtosecond laser machining characterization
  3. Control contains the major classes implemented for microscope control, including:
    1. WBIMConfig: base class for storing instrument parameters, coordinate transform, and configuration space.
    2. WBIMControlBase: child class of WBIMConfig. Implements logging, motorized stage control, and piezo control.
    3. WBIMImaging: child class of WBIMControlBase. Implements methods for automated serial imaging, including:
      1. Acquisition grid generation
      2. Imaging hardware initialization and control (e.g., laser, imaging HWP, imaging shutter)
      3. Asynchronous data processing TCP server setup and data management
      4. ROI detection, classification, and acquisition trajectory path planning
      5. Visual-based quality control and hardware abnormal state detection (e.g., scanner desynchronization, laser failures)
    4. WBIMAblation: child class of WBIMControlBase. Implements methods for automated femtosecond laser machining, including:
      1. Ablation hardware initialization and control (e.g., laser gating, ablation beam shutter, ablation HWP, pump, refractometers)
      2. Ablation ROI detection (e.g., multichannel 3D image spectrum unmixing, segmentation, classification)
      3. Coverage path planning (TSP algorithm)
      4. Ablation control sequence synthesis, execution, and monitoring
    5. WBIMControl: child class of WBIMControlBase, integrates WBIMImaging and WBIMAblation for iterative imaging and ablation, including:
      1. Operation mode switching between exploration, scan, and ablation
      2. Ablation refinements, including visual quality control, ablation parameter adjustment, and ablation refinement control
      3. Acquisition statement logging and tile management
      4. Asynchronous parallel data transfer to the cluster
    6. Additional classes include:
      1. Instrument control: ZaberController, WBIMPowerHWP, ThorlabsPowerMeter
      2. Data management: WBIMTileManager, WBIMImagingGrid2D
      3. Email and message notification: WBIMNotification
      4. Ablation control: WBIMAblationPath3D, WBIMAblationPath2D
  4. Laser_control contains the classes for controlling and monitoring Coherent Chameleon laser.
  5. Postprocessing contains the scripts and classes for image processing, asynchronous data processing, and data management.
  6. Refractometer contains the classes for controlling inline refractometer and adjusting solution index.
  7. SITiffConverter contains the asynchronously parallel tile processing pipeline, including:
    1. Raw ScanImage Tiff stack analysis and conversion to H5 file
    2. TCP client class handling tile processing and data transfer

License

This project is licensed under the BSD 3-Clause License. See the LICENSE file for details.

Reference

If you find this repository helpful, please consider citing our work:

@article{Ji2025,
   title={Spatiotemporal focusing enables all optical in situ histology of heterogeneous tissue},
   author={Ji, Xiang and Huang, Sincheng and Friedman, Beth and Kleinfeld, David}, 
   journal={Nature Methods},
   volume={},
   number={},
   pages={},
   year={2025},
   publisher={Springer Nature},
   url={}}

About

Control software for an all-optical serial multiphoton microscope

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages