Processing Flow#
High-level overview of all processing steps executed by lsp.pipeline().
Registration#
Step |
Description |
Outputs |
Disable |
|---|---|---|---|
Rigid Registration |
Correct XY frame shifts via phase correlation |
|
|
Non-rigid Registration |
Correct local warping via block-wise shifts |
|
|
Compute meanImg |
Average all registered frames |
|
N/A |
Compute meanImgE |
Enhanced mean via spatial high-pass |
|
N/A |
Detection Preprocessing#
These steps are applied to the registered movie before ROI detection:
Step |
Description |
Affects |
Disable |
|---|---|---|---|
Temporal Binning |
Average consecutive frames to reduce noise |
Detection movie, |
|
Temporal High-Pass |
Remove slow baseline drift |
Detection movie, |
|
*The mbo fork allows disabling high_pass; standard Suite2p forces a value.
What each projection image contains#
Image |
Source |
Binned? |
Temporally HP filtered? |
|---|---|---|---|
|
Average of registered frames |
No |
No |
|
Spatial HP of meanImg |
No |
No |
|
Max of detection movie |
Yes |
Yes |
Detection: Anatomical Mode (Cellpose)#
Cellpose segments one static image, chosen by cellpose_settings.img. Suite2p 1.1.0
accepts three values:
|
Image |
Notes |
|---|---|---|
|
|
default; log ratio emphasizes active regions |
|
mean image |
raw mean intensity |
|
max projection |
binned + temporally high-pass filtered |
The enhanced mean image (meanImgE) is no longer a cellpose input — the old
anatomical_only=3 was removed upstream.
Selecting the image#
Recommended — enable cellpose with algorithm="cellpose" and pick img:
ops = {"algorithm": "cellpose", "img": "max_proj / meanImg"} # default
ops = {"algorithm": "cellpose", "img": "meanImg"}
ops = {"algorithm": "cellpose", "img": "max_proj"}
Legacy — the integer anatomical_only still works and maps to img:
ops = {"anatomical_only": 1} # img = "max_proj / meanImg" (default)
ops = {"anatomical_only": 2} # img = "meanImg"
ops = {"anatomical_only": 4} # img = "max_proj"
anatomical_only=0 (or algorithm="sparsery"/"sourcery") uses functional detection.
anatomical_only=3 warns and falls back to 1.
Step |
Description |
Disable |
|---|---|---|
PCA Denoise |
Spatial denoising via block-wise PCA |
|
Spatial High-Pass |
Sharpen the chosen image before cellpose |
|
Cellpose Segmentation |
Run Cellpose model on the image |
N/A |
Spatial high-pass: spatial_hp_cp (upstream cellpose_settings.highpass_spatial)#
Integer, default 0 (off). When > 0, the chosen img is normalized to [0, 1] and a
Gaussian-blurred copy (sigma = diameter × spatial_hp_cp) is subtracted twice, removing
illumination gradients and sharpening cell boundaries. It applies to whichever img you
select and does not modify the stored ops["meanImg"] or ops["max_proj"].
Detection: Functional Mode#
When ops["anatomical_only"] = 0:
Step |
Description |
Disable |
Notes |
|---|---|---|---|
Spatial High-Pass |
High-pass filter for activity detection |
|
sparse only |
Compute Vcorr |
Activity correlation images |
N/A |
sparse only |
Seed Detection |
Find candidate ROI centers from peaks |
N/A |
sparse only |
ROI Growing |
Expand seeds based on correlation |
N/A |
sparse only |
SVD Decomposition |
Reduce dimensionality for source detection |
N/A |
sourcery only ( |
Source Detection |
Find ROIs via iterative NMF-like method |
N/A |
sourcery only |
ROI Overlap Removal |
Merge/remove overlapping ROIs |
|
all functional |
Post-Detection (All Modes)#
Step |
Description |
Disable |
|---|---|---|
Extract Fluorescence (F) |
Compute raw fluorescence from ROI pixels |
N/A |
Compute Neuropil (Fneu) |
Estimate neuropil signal from surround |
|
Classifier |
Apply ROI classifier (cell vs not-cell) |
|
Spike Deconvolution |
Infer spike times via OASIS |
|
Apply Filters |
Size/shape filters on detected ROIs |
|
lsp.pipeline() Additional Steps#
These are applied by lsp.pipeline() after suite2p completes:
Step |
Description |
Disable |
|---|---|---|
Accept All Cells |
Mark all suite2p-rejected ROIs as accepted |
|
Cell Filters |
Size/shape filters (default 4-35 µm diameter) |
|
Compute dF/F |
Rolling percentile baseline correction |
N/A |
Generate Figures |
Diagnostic plots for each plane |
N/A |
See also
User Guide - Complete processing examples and parameter tuning
Postprocessing - ΔF/F and filtering functions
Pipeline Comparison - CaImAn, Suite2p, EXTRACT comparison