Processing Workflows
This guide describes the typical image processing workflows available in KINTSUGI.
Overview
KINTSUGI provides a complete pipeline for multi-cycle immunofluorescence image analysis:
Illumination Correction - Fix uneven lighting across images
Stitching - Combine tiled images into single large images
Deconvolution - Remove optical blur and improve resolution
Extended Depth of Focus (EDoF) - Combine Z-stacks into 2D
Registration - Align images across multiple cycles
Autofluorescence Removal - Subtract background signal
Segmentation - Identify cells and structures
Spatial Analysis - Analyze spatial relationships
Workflow 1: Single Channel Evaluation
Use this workflow to test and tune parameters on a single channel before batch processing.
Notebook: notebooks/1_Single_Channel_Eval.ipynb
Steps:
Load a single channel image
Test illumination correction parameters
Test stitching parameters
Test deconvolution settings
Evaluate results visually
Workflow 2: Cycle Processing
Batch process all channels across multiple cycles.
Notebook: notebooks/2_Cycle_Processing.ipynb
Steps:
Configure input/output directories
Set processing parameters
Run illumination correction
Run stitching
Run deconvolution (optional)
Run EDoF (optional)
Run registration
Workflow 3: Signal Isolation
Remove autofluorescence and isolate true signal.
Notebook: notebooks/3_Signal_Isolation.ipynb
Steps:
Load registered images
Identify autofluorescence channels
Subtract autofluorescence
Apply filtering
Generate final signal images
Workflow 4: Segmentation Analysis
Perform cell segmentation and spatial analysis.
Notebook: notebooks/4_Segmentation_Analysis.ipynb
Steps:
Load processed images
Run InstanSeg segmentation
Extract cell features
Perform clustering
Analyze spatial relationships
Registration Module (Kreg)
The Kreg module provides image registration functionality based on VALIS.
Basic Usage
from kintsugi.kreg import Valis
# Initialize registrar
registrar = Valis(
src_dir="/path/to/images",
dst_dir="/path/to/output",
reference_img_f="cycle1.tif",
align_to_reference=True,
)
# Run registration
registrar.register()
registrar.register_micro() # Fine registration
registrar.warp_and_merge_slides() # Output registered images
Configuration Options
Parameter |
Description |
Default |
|---|---|---|
|
Source image directory |
Required |
|
Output directory |
Required |
|
Reference image filename |
Required |
|
Max image dimension for processing |
2048 |
|
Enable non-rigid registration |
True |
|
Crop to overlapping region |
True |
Visualization Module (Kview2)
The Kview2 module provides interactive visualization tools.
Basic Usage
from kintsugi.kview2 import imshow, curtain, crop
# Display image
imshow(image)
# Compare two images with curtain view
curtain(image1, image2)
# Interactive crop
cropped = crop(image)
Stitching Module (Kstitch)
The Kstitch module provides tile stitching functionality.
Basic Usage
from kintsugi.kstitch import stitch_tiles
# Stitch tiled images
stitched = stitch_tiles(
tile_dir="/path/to/tiles",
output_path="/path/to/output.tif",
overlap=0.1, # 10% overlap
)
Tips for Large Datasets
Start small: Test parameters on a subset before full batch processing
Monitor memory: Use
kintsugi infoto check available resourcesUse tiled processing: Enable tiled output for very large images
GPU acceleration: Enable CuPy for faster deconvolution