Sample Data and Scripts¶
This page describes the sample data and scripts available in examples/data/sample_data/ for testing and demonstrating PySPIM functionality.
Contents¶
Jupyter Notebooks¶
basic_usage.ipynb: Main example notebook demonstrating the complete PySPIM workflow- Data loading with uManager acquisition
- ROI detection and cropping
- Deskewing for both heads
- Registration and transformation
- Deconvolution
SLURM Job Scripts¶
The sh/ directory contains SLURM job scripts for batch processing:
1_deskew.sh: CPU-based deskewing2_register.sh: GPU-based registration3_transform.sh: Data transformation4_deconvolve.sh: GPU-based deconvolution5a_rotate.sh: Data rotation
Usage¶
Running the Notebook¶
-
Install dependencies:
-
Start Jupyter:
-
Open the notebook:
- Navigate to
basic_usage.ipynb - Run cells sequentially
Running SLURM Jobs¶
- Modify paths in the shell scripts to point to your data
- Submit jobs:
Data Requirements¶
Input Data Format¶
The scripts expect: - uManager acquisition format: Micro-Manager data files - TIFF files: Standard TIFF format - HDF5 files: Hierarchical data format
PSF Files¶
For deconvolution, you need:
- PSF-A: Point spread function for head A (.npy format)
- PSF-B: Point spread function for head B (.npy format)
Acquisition Parameters¶
Standard diSPIM parameters: - Step size: 0.5 microns - Pixel size: 0.1625 microns - Angle: Ī/4 radians (45 degrees) - Camera offset: 100 (PCO.edge)
Customization¶
Using Your Own Data¶
-
Update paths in the notebook:
-
Modify parameters:
-
Load your PSFs:
SLURM Configuration¶
Adjust SLURM parameters in the shell scripts:
CPU Jobs:
GPU Jobs:
Performance Tips¶
GPU vs CPU¶
- Use GPU for: Registration, deconvolution, large datasets
- Use CPU for: Deskewing, small datasets, development
Memory Management¶
- Monitor memory usage during processing
- Use chunked processing for large datasets
- Adjust SLURM memory allocation as needed
Processing Pipeline¶
- Deskew (CPU): Correct light sheet artifacts
- Register (GPU): Align multi-view data
- Transform (CPU): Apply transformations
- Deconvolve (GPU): Restore image quality
- Rotate (CPU): Final orientation
Troubleshooting¶
Common Issues¶
- Memory Errors
- Reduce data size for testing
- Increase SLURM memory allocation
-
Use CPU processing for large datasets
-
GPU Errors
- Check CUDA installation
- Verify GPU memory availability
-
Use CPU fallback if needed
-
Import Errors
- Ensure PySPIM is installed:
uv pip install -e packages/pyspim - Check Python environment
Getting Help¶
- Check the main documentation
- Review the API reference
- Open an issue on GitHub
File Structure¶
examples/data/sample_data/
âââ basic_usage.ipynb # Main workflow notebook
âââ sh/ # SLURM job scripts
â âââ 1_deskew.sh # CPU deskewing
â âââ 2_register.sh # GPU registration
â âââ 3_transform.sh # Data transformation
â âââ 4_deconvolve.sh # GPU deconvolution
â âââ 5a_rotate.sh # Data rotation
âââ README.md # Usage instructions
Next Steps¶
- Try the Basic Usage tutorial
- Explore the Snakemake Workflow
- Check out Advanced Features
- Review the API Reference