Image analysis workflows
A complete example makes the acquisition interpretation, intermediate images, resource choices and output conventions visible. It is also the place to test whether a proposed library operation is actually necessary. Many high-level analyses can be assembled from existing filters, labels and measurements.
Choose a workflow with the right scientific contract
| Example | What the image computation demonstrates |
|---|---|
| Percent positive | An image-assay workflow with explicit intensity and region processing |
| Foci per nucleus | Nuclear labels combined with punctate signal and containment/counting glue |
| Colocalization | Planned two-channel intensity reductions inside labeled regions |
| 3D object measurement | Label geometry with anisotropic physical voxel spacing |
| Bead–layer distance | Multiple image channels, fitted surfaces and distances from image-derived features |
| Vessel graph | A multi-stage volumetric image pipeline with resource-aware grid choice |
Global surfaces inside a blockwise workflow
The bead–layer example is useful for understanding why “one pipeline” does not mean “all independent local filters.” It constructs image-derived edge costs, pools columns and fits two related surfaces. append_layered_surface_phases combines block evidence into a global surface problem; SurfaceBandOp then uses the fitted surfaces to define image regions.
Bead detection runs on a separate response derived from another channel. Candidate selection and exclusion criteria remain application choices. The example measures both vertical depth relative to a height surface and nearest Euclidean distance to an image region. Those distances agree only under particular geometry; folds and overhangs can make them answer different questions. Physical voxel spacing is therefore part of the measurement, not just display metadata.
The point-distance route uses boundary evidence instead of requiring a dense whole-image distance field when only sparse query locations are needed. The library’s image and neighborhood operations make this possible, while the choice of tissue boundary, bead rejection rules and reports stays in the example. This is the intended division between reusable primitives and a scientific workflow.
Measurements need matching definitions
The colocalization example attaches two intensity arrays and labels, accumulates primitive sums and derives Pearson, overlap and Manders values. The raw sums make comparison with an independent reference easier than comparing only one final ratio. A thresholding convention, empty region or constant channel can change the meaning or definedness of that ratio, so preserve the input masks and numerical definitions when comparing tools.
The 3D measurement example compares basic geometry against a reference on the same labeled fixtures. It deliberately does not collapse exact and directional Feret-like measurements into one interchangeable metric: algorithms with different costs or definitions deserve separate validation rows. For anisotropic images, voxel count, physical volume and physical extent are distinct outputs.
Develop the next example from images outward
List the required intermediate images first: filtered intensity, cost, probability, mask, labels, restored image or support. Then identify where a phase boundary is necessary and where a composed chain would avoid storing an intermediate. Inspect each expensive stage’s dependency kind before selecting blocks. A local filter, a complete-axis transform and a global surface fit can look identical as boxes in a presentation diagram while having very different resource requirements.
Keep a small deterministic fixture with a stated expected answer. Exercise seam positions and workers before scaling up. Use a real crop to evaluate acquisition assumptions separately from that software fixture. Promote a reusable numerical piece into the library only when the full example reveals the need.
The ImgLib2, OpenCV, scikit-image and Dask-image comparison pipelines report matched workloads in the benchmark reference. Their speed ratios apply to those measured inputs and scopes; they are not substitutes for profiling the expensive stages of your own pipeline.