- Notifications
You must be signed in to change notification settings - Fork0
CVR-MucosalImmunology/Image-Processing-Workflow
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Latest update - Jan 2025
Thomas O'Neil (thomas.oneil@sydney.edu.au) |Oscar Dong (oscardong4@gmail.com) |Heeva Baharlou
The purpose of this notebook is to provide a consolidated approach to IMC analysis and forms the prerequisite steps to the IMComplete R package workflow. We focused
Nature Method of the Year in 2024 wasspatial proteomics.
Computational tools for spatial proteomics are the focus of the second Comment, from Yuval Bussi and Leeat Keren. These authors note that current image processing and analysis workflow arewell defined but fragmented, with various steps happening back to backrather than in an integrated fashion. They envision a future for the field whereimage processing and analysis steps work in concert for improved biological discovery.
In alignment with these comments, we have committed to provide a comprehensive and dynamic workflow. In part, we aimed to achieve this by compiling as much as we could into this pre-processing workflow.
Particularly, we have emphasised tools that can be performed inone linear workflow. For example, we provide the functionPyProfiler
, a tool that performs the same functions as CellProfiler in extracting cell features, andRegisterImages
to register IMC to IF in Python, and allowing users remain in this linear pipeline and not have to install additional applications.
Some scripts adapted fromBodenmillerGroup/ImcSegmentationPipeline
Therefore, make sure to also reference these studies:
- Windhager, J., Zanotelli, V.R.T., Schulz, D. et al. An end-to-end workflow for multiplexed image processing and analysis.Nat Protoc (2023).
ImagingAnalysis/ (root directory)├── IMComplete-Workflow├── ImcSegmentationPipeline├── Experiment_name_1│ └── raw│ └── Sample1.zip│ └── Sample2.zip│ └── ...│ └── analysis│ └── 1_image_out│ └── 2_cleaned│ └── 3_segmentation│ └── 3a_cellpose_crop│ └── 3b_cellpose_full│ └── 3c_cellpose_mask│ └── 3d_compartments│ └── 4_pyprofiler_output│ └── panel.csv├── ...├── Experiment_name_n
Anaconda is needed to run this workflow. Follow the steps below to set up Anaconda and aconda
environment:
InstallAnaconda and navigate to the relevant command line interface:
Windows | macOS |
---|---|
1. Search for'Anaconda Prompt' in the taskbar search 2. SelectAnaconda Prompt | 1. Usecmd + space to open Spotlight Search2. Type'Terminal' and press return to open |
cd /Desktop/ImageAnalysis
From Github
Go to theGithub page and near the top click thecode
button and download the zip. Unzip the folder into theroot
directory. This will contain the IMComplete-Workflow documents and allow ready access to the necessary files.
Using Git in command line
git clone --recursive https://github.com/CVR-MucosalImmunology/IMComplete-Workflow.git
- BodenmillerGroup/ImcSegmentationPipeline: Windhager, J., Zanotelli, V.R.T., Schulz, D. et al. An end-to-end workflow for multiplexed image processing and analysis.Nat Protoc (2023).
git clone --recursive https://github.com/BodenmillerGroup/ImcSegmentationPipeline.git
conda env create -f IMComplete-Workflow/environment.yml
This can take some time so be patient!
conda activate IMComplete
Unfortunately, parts of this workflow will require GPU-acceleration: Cell segmentation, Denoise, PyProfiler (will run quicker, but not necessary).
You will need to install Pytorch and pytorch-cuda versions that are suitable for your PC. Instructions are foundhere. The code will look like this:
conda install pytorch==2.4.1 torchvision==0.19.1 torchaudio==2.4.1 pytorch-cuda=12.4 -c pytorch -c nvidia
Cellpose is used for cell segmentation. We'll install the gui version for the user-friendly version. If you experience errors installing cellpose, refer to thecellpose installation instructions
python -m pip install cellpose[gui]
Set up (
CheckSetup()
)Create a new project (
NewProject()
)Prep the raw folder and
panel.csv
Extract images from the raw folder (
ExtractImages()
)
Optional 1: Check filter parameters of IF data (
CheckExtract()
)Optional 2: Filter images (
FilterImages()
)Optional 3: Select crop regions for segmentation training (
CropSelector()
)
- Prepare the images for Segmentation model training (
PrepCellpose()
)
- Optional 4: Register low-resolution images with high-resolution images to improve cell segmentation (
RegisterImages()
)
- Train a segmentation model (
cellpose
)
- Optional 5: You have the option to not train a segmentation model and use a generic model.
Batch segment the images and generate cell masks (
BatchSegment()
)Extract data from your images using the cell segment masks (
PyProfiler()
)
About
A Comprehensive Workflow for image preprocessing.
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Contributors3
Uh oh!
There was an error while loading.Please reload this page.