Pointwise maps and channel arithmetic

These operations combine values at the same voxel. Their spatial reach is zero; channel count and temporary/output arrays still contribute to memory. Match image coordinates before combining channels. A shared array shape alone does not prove physical alignment.

Available operations

voxelwise

Source.

Entry points: VoxelwiseMapOp, VoxelwiseMaskOp, CombineOp, WidenOp, NarrowOp.

Apply intensity maps, comparisons, gamma/log/sigmoid correction, rescaling, boolean logic, arithmetic and selection. CarryOp preserves values; explicit conversion ops make dtype changes visible. Integer narrowing requires the chosen rounding/range policy rather than an implicit cast.

Execution: Planned block chains and resident kernels. Pointwise; accepted types depend on the selected map.

Zero reach does not mean zero cost. A map reads only its own input sample, so it needs no spatial halo. A sequence of maps can share one block phase and avoid stored full images, while still invoking multiple kernels and holding the buffers required by that chain. Explicit conversions expose where rounding and clipping occur.

For example, offset subtraction followed by a threshold is pointwise throughout. Adding a later radius-three blur makes the original input require that blur’s neighborhood: the corrected values must be computed in the halo too. Do not precompute only a core-sized correction and ask the following kernel to clamp its artificial edge.

mixing

Source.

Entry points: TupleKernel, TupleOp, LinearMap.

Combine K co-located source images into one or more voxelwise results. LinearMap applies a supplied channel-mixing matrix; a tuple kernel can return diagnostic side arrays as well as the primary image.

Execution: Planned source-aware tuples, zero spatial halo. Each source and output must be accounted for.

Arity and spatial support are separate. A three-channel linear map consumes three numbers at the same coordinate. Its halo is zero, but all three source buffers and any output/diagnostic arrays contribute to task admission. The additional images are explicit SourceInputs rather than hidden file reads, so dependencies and retention can be checked.

Use a supplied matrix for known compensation or basis changes; use calibrated NNLS when components must be nonnegative and conditioning/fit diagnostics matter. Co-located channel indices must refer to the same physical voxel. The tuple operation does not register channels, estimate a mixing matrix or decide how missing measurements should be imputed.

activity

Source.

Entry points: ActivityOp.

Summarise whether spatial regions contain mask support. These metadata fragments let a consumer decide that a task is empty before reading pixels; a missing summary must remain unknown.

Execution: Planned fragment producer and metadata-first task preparation; summaries are not an alternative pixel image.

Why this is metadata rather than another thresholded image. A downstream operation can often prove that an owned region contains no work using a small occupancy summary. Reading that summary first can avoid fetching and decoding a much larger intensity window. The consumer still needs an explicit rule defining which summary covers its complete query region.

An absent summary means unavailable evidence, not an empty image. Empty completion must also emit valid empty outputs so that later coverage checks remain meaningful. This mechanism is useful when image-analysis objects or support masks are sparse; it changes avoidable I/O, not the numerical answer for regions that contain work.

Composition example

flowchart LR
  A[Detector A] --> M[Linear channel map]
  B[Detector B] --> M
  M --> T[Threshold]
  T --> O[Mask]

This shape needs no neighborhood halo. A following morphology pass changes that: its input window must include the neighboring corrected values, so the chain’s required input region grows even though the correction itself is pointwise.