This repository is used to showcase the basic usage of automated microscopy image analysis The automated iamge analysis pipeline include:
- Image preprocessing
- Vesicle detection
- Batch processing
Follow these steps to set up the Microscopy Analysis Tutorial on your computer:
If you don't have Anaconda installed, download and install it from anaconda.com. Anaconda includes Python and Jupyter Notebook.
If you don't have Python installed, download and install it from python.org. Make sure to check the option to add Python to your PATH during installation.
We recommend to install Anaconda for non-coding experience user.
- Go to the GitHub repository.
- Click the green "Code" button and select "Download ZIP".
- Extract the downloaded ZIP file to a folder on your computer.
User should only need to install these packages: matplotlib numpy pandas scikit-image opencv-python Open Anaconda, search the pacakges in 'Not installed' menu, check the packages and click apply.
- Open a command prompt (Windows) or terminal (macOS/Linux).
- Navigate to the folder where you extracted the project files. For example:
cd path/to/MicroscopyAnalysis_Tutorial
- Install the required Python packages by running:
User should only need to install the above packages, if you need to know the full environment dependencies, you can check it in
pip install matplotlib numpy pandas scikit-image opencv-python
MicroscopyAnalysis/requirements.txt
.
-
Run the main script in jupyter notebook. Copy the code in the Usage section(Next section) and run.
-
Run the main script in terminal, use the following command in your terminal:
python main.py <file_folder> <PlateName> [--templates <template_file1> <template_file2> ... <template_fileN>]
- Using Default Templates:
python main.py Data/Test_0517 Plate_2024605
- Using Custom Templates:
python main.py Data/Test_0517 Plate_2024605 --templates Templates/custom_template1.npy Templates/custom_template2.npy
This section show the minimal code examples illustrating how to use the functions. You can also check the documentation site.
Here we provide some example code to analysis batch images from a folder. Three parameters are needed for main
function.
file_folder
: The folder stored the images that needed to be analyzed
templates
: A list of templates files
PlateName
: Used for saving results
import os
import time
import numpy as np
from MicroscopyAnalysis.batch_run import run_batch_files_templates
from MicroscopyAnalysis.main import main
# Adjust paths to the templates
template1 = np.load(os.path.join('Templates', 'template_656, 640, 71, 71.npy'))
template2 = np.load(os.path.join('Templates', 'Project_Whole Plate1_1024x1024_200Hz_1%Laser_800gain_B_5_R1.tif_enhance_482_20_56_56.npy'))
template3 = np.load(os.path.join('Templates', '1024x1024 - 4 point_no-z-stack - split 5 rows rows only_TileScan 1_C_11_R2.npy'))
templates = [template1, template2, template3]
# Adjust the path to the data folder
file_folder = os.path.join('Data', 'Test_0517')
PlateName = 'Plate_2024605'
# Example usage
main(file_folder, templates, PlateName)
Distributed under the Apache License 2.0.
See the LICENSE
file for more information.
Academic collaborations and extensions/improvements by the community are encouraged. Please contact HL by email if you have questions.
TBD