Skip to content

This is a public repository for PyZebrascope, an open-source Python software for controlling light-sheet microscopes for zebrafish

License

Notifications You must be signed in to change notification settings

KawashimaLab/PyZebraScope_public

Repository files navigation

PyZebraScope

PyZebraScope: an open-source platform for brain-wide neural activity imaging in zebrafish

This is a repository for PyZebrascope, an open-source Python platform for brain-wide neural activity imaging in zebrafish.

Light-sheet microscopy for whole-brain neural activity imaging in zebrafish requires specific features not available in commercially distributed microscopes. Such features include scanning of two orthogonal excitation beams and eye damage prevention. These particular requirements, as well as numerous device parameters required for the experimenter to manipulate, have been the main bottlenecks for disseminating / developing technology and performing daily experiments. We developed PyZebrascope to address these issues.

PyZebrascope is a high-level interface designed for neural activity imaging experiments based on light-sheet microscopy in zebrafish. It incorporates functionalities from other open-source microscopy projects such as μManager and additional modules for device control, signal processing, computer vision, and machine learning.

PyZebrascope_structure

A list of hardware that we used to develop PyZebrascope is described in detail in our manuscript https://www.frontiersin.org/articles/10.3389/fcell.2022.875044/full

Installation requirements

PyZebrascope requires the preinstallation of the following hardware drivers and low-level interfaces:

The below Python packages are required to run PyZebrascope:

Note that nVidia GPU board, CUDA toolkit and CuPy are only necessary for speeding up the computation time for the autofocusing feature. We still have CPU-based codes in auto_focusing.py

As of December 2023, we confirmed its functionality in Windows10 (x64) with Anaconda 2023.09 which include below Python packages

  • conda 23.11.0

  • Python 3.11.5

  • numpy 1.26.2

  • spyder 5.4.3

  • PyQt5 5.15.10

  • pyqtgraph 0.13.3

  • nidaqmx 0.9.0

  • h5py 3.9.0

  • pyserial 3.5

  • cupy-cuda12x: 12.3.0 (for CUDA 12)

  • micro-manager-2.0.0

  • pymmcore: 10.1.1.70.6 (not the latest but is compatible with an available Hamamatsu μManager API, which requires Device v70 and Module v10)

Device configuration

PyZebrascope supports two laser systems, up to three scanning arms for the front and side illumination of excitation beams, a piezoelectric objective scanner and two sCMOS cameras for multicolor imaging. Below is a configuration with which we tested PyZebrascope.

Device

Software interface

PyZebrascope has two main tabbed interfaces with a camera view window. Additionally, it has an interface to set a laser exclusion area for eye damage prevention.

Interface

File writing

Image data from cameras are processed like below. Three Qthreads (Reader, Writer, CamView) run in parallel for each camera to support file writing and image previewing. This structure achieves over 800 MB/s writing performances on a fast NVMe drive (Micron 9300) or SSD RAID system while maintaining a stable resource usage of CPU and system memory.

CameraIO

Automatic focusing

The alignment of the excitation beam to the focus of the detection objective is a time-consuming process for users. We implemented in auto_focusing.py a module for automatically aligning the side laser position to the position of the detection objective lens. It also works for volumetric scans (5-point sampling between the start and the end position) and two excitation arms to fully compensate for the nonlinear relationship between the position of the detection objective positions and analog voltage input to scanning galvanometers.

Autofocusing

Whole-brain imaging

We were able to achieve whole-brain imaging at cellular resolution in a zebrafish performing a motor learning task (kawashima et al., 2016). The imaging volume covers the extremities of the most dorsal part (cerebellum), the most ventral part (hypothalamus), the most rostral part (forebrain), and the most caudal part (hindbrain) at the speed of 1 Hz, 45 planes, 2304 x 1600 pixel resolution.

WholeBrainImaging

About

This is a public repository for PyZebrascope, an open-source Python software for controlling light-sheet microscopes for zebrafish

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages