This repository contains two key components for analyzing fluorescence data in brain slice experiments: SliceScan, a real-time image analysis software, and spread_analysis, a post-experiment analysis Jupyter notebook. These tools are primarily used for experiments involving fluorescence sensors like iGluSnFR and dLight to measure neurotransmitter release in brain slices.
/slicescan/ # Folder containing the SliceScan real-time image analysis software
├── main.py # Main script for SliceScan, executed via python -m SliceScan
├── SliceScan.bat # Batch file to run SliceScan on Windows
└── init.py # Empty init file for package initialization
/spread_analysis/ # Folder containing the Jupyter notebook for further analysis
└── analysis_notebook.ipynb # Post-experiment analysis notebook
SliceScan is a real-time image analysis tool designed for analyzing brain slice experiments as images are being collected by a camera. The software enables researchers to perform on-the-fly region of interest (ROI) selection, calculate delta F over F (dF/F), and visualize key metrics like activated pixel areas and volumes during the experiment.
- Real-Time Processing: Process TIFF image stacks as they are generated by the camera.
- ROI and Electrode Selection: Interactive selection of regions of interest (ROI) and electrode positions on the images.
- dF/F Calculation: Calculate delta F over F in real time for selected ROIs.
- Activation Area Calculation: Track the activation area and visualize it over the course of the experiment.
- Drug Treatment Tracking: Add drug treatment periods and visualize their effects on activation.
- Export Data: Save experimental metadata, calculated dF/F, and the images for post-analysis.
- Python 3.10: SliceScan requires Python version 3.10.
- Dependencies:
tifffile
,matplotlib
,numpy
,pandas
,opencv-python
(these should be installed manually).
-
Copy the SliceScan Folder:
- To use
python -m SliceScan
or run the batch file (SliceScan.bat
), you must copy theslicescan/
folder (renamed toSliceScan
) to your Python library folder:- For Windows: Copy it to
C:\Python310\Lib\site-packages\
- For other systems, copy it to the equivalent Python site-packages directory.
- For Windows: Copy it to
- To use
-
Running the Software:
- Windows: Double-click the
SliceScan.bat
file to run the software. - Python Module: Alternatively, if you copied the
SliceScan
folder to the Python library, you can run the software using:python -m SliceScan
- Windows: Double-click the
-
If You Did Not Copy to Python Library:
- If you didn't copy the
SliceScan
folder into your Python library, you can directly run the main Python script:python slicescan/__main__.py
- If you didn't copy the
-
Select Folder: Use the GUI to select the folder containing the image stacks (
hi
,lo
, andno
files) from your experiment. -
Define ROI and Electrode: Select the region of interest (ROI) and electrode position on the image.
-
Start Experiment: Click the Start Experiment button to begin real-time processing.
-
Monitor Activation: The software will calculate and display activation volumes and areas during the experiment. Drug wash periods can also be visualized.
-
Export Data: Once the experiment is complete, click the Export Data button to save all the processed data (metadata, dF/F values, activation area plots, and images).
__main__.py
: The main script that handles the real-time image processing, plotting, and user interactions through the GUI.SliceScan.bat
: A simple batch file to launch the SliceScan software on Windows.__init__.py
: Empty file to initialize the SliceScan package.
The spread_analysis folder contains a Jupyter notebook that provides comprehensive post-experiment analysis of the collected fluorescence data. It focuses on the detailed analysis of fluorescence spread and activation areas based on delta F over F (dF/F) calculations.
- Analyzing TIFF Stacks: Process TIFF stacks from your experiments, calculating dF/F for different conditions (e.g., baseline, treatment, wash).
- Activation Area Calculation: Compute the total number of activated pixels and plot the data.
- Stim-Response and Drug Treatment Experiments: Compatible with both stimulus-response (uA folders) and quinpirole drug treatment experiments.
The notebook is well-documented with explanations of each step in the analysis workflow. Refer to the notebook for specific details about how to process and visualize your data.
- Install Python 3.10.
- Install the required dependencies manually:
pip install tifffile matplotlib numpy pandas opencv-python
-
SliceScan:
-
For Windows users, double-click
SliceScan.bat
. -
For other operating systems, or if not using the batch file, you can run the following:
python slicescan/__main__.py
-
spread_analysis:
-
Open the Jupyter notebook in the
spread_analysis
folder:jupyter notebook spread_analysis/analysis_notebook.ipynb
This project is licensed under the MIT License. Feel free to use, modify, and distribute it under the terms of the license.
Contributions are welcome! If you find any issues or have ideas for improvements, feel free to open an issue or submit a pull request.