Skip to content
PointillViz
PointillViz

© 2026 PointillViz

Vector Field

by PointillViz reference tools

Which way a quantity increases across the tissue, as arrows over the section. Gene, cell type or any annotation column — with every arrow that could be noise removed.

Verifiedv1.0.0
  • gradient
  • expression
  • summary
  • cells
  • vectors
  • series
Vector field: arrows on the local gradient of S100a6 over a colon section, over cells painted by the smoothed field
Vector field: arrows on the local gradient of S100a6 over a colon section, over cells painted by the smoothed fieldArtwork from the tool’s bundle

Readme

Answers the question: In which direction does a selected quantity increase across the tissue, and how steeply?

The tool converts the selected quantity into a smoothed spatial field. Its gradient reveals the direction and strength of local changes across the tissue. Each cell j with a valid measurement receives a value aj. This is either the selected gene expression, a continuous measurement, or—for a selected population—1 for cells belonging to that population and 0 for other labelled cells.

At regularly spaced positions x across the tissue, the tool calculates a Gaussian-weighted local mean:

The weight wj(x) decreases with the distance between cell j and position x, so nearby cells contribute more strongly to F(x) than distant cells. For a selected population, F(x) represents its smoothed local proportion.

From the spatial variation of this field, the tool calculates its gradient and magnitude:

Map. Cells are colored by the smoothed local value F(x): dark colors indicate lower values and yellow indicates higher values. The arrows show the gradient ∇F(x): their direction indicates the steepest increase, while their length represents the strength g(x) of the spatial change. For display, this strength is scaled nonlinearly as t(x)=min(g(x)/g95,1), where g95 is the 95th percentile of the displayed gradient magnitudes. Arrow color also represents F(x), not gradient magnitude.

Plot. To distinguish strong gradients from uncertain estimates, the tool calculates the effective cell count N(eff), the local variance τˆ2, and the standard error:

Here, a′j=aj−a¯ is the centered cell value, and σp is the spatial width of the Gaussian filter. A small effective cell count or high local variation increases the standard error. The x-axis shows a threshold t, while the y-axis shows the proportion of the M measurable positions whose standardized gradient magnitude z(x) reaches that threshold:

The solid curve shows the observed proportion. The dashed curve shows the frequency of standardized two-dimensional gradients expected from the Rayleigh distribution under random cell values. If the observed curve lies clearly above it, strong spatial gradients occur more often than expected by chance. The line at z=3 marks the default threshold below which arrows are hidden when filtering is enabled.

Parameters

ParameterTypeDefaultWhat it does
Differentiatesource select, 3 options One level of a categorical column Selects whether the field represents the local proportion of a population, a continuous measurement, or gene expression.
Categorical columnfield categorical_field optional Selects the categorical annotation used to define the populations. Used only when Differentiate is set to category. Defaults to the dataset’s cell-type column.
Levellevel category_value optional Selects the population from the chosen categorical column whose local proportion is analyzed.
Continuous columncolumn continuous_field optional Selects the continuous measurement to analyze. Used only when Differentiate is set to continuous.
Genegene gene optional Selects the gene whose normalized expression is analyzed. Used only when Differentiate is set to gene. Values are normalized to a total of 10,000 counts per cell.
Smoothing (σ, grid cells)sigma float, 0.6–3 1.2 Sets the width of the Gaussian smoothing in grid cells. Larger values produce smoother fields with broader, weaker gradients.
Grid detaildetail float, 0.5–2.5 1 Sets the spatial resolution of the calculation. Higher values capture finer but noisier spatial changes.
Arrowsarrows int, 200–20,000 2,000 Sets the approximate number of arrows displayed. This changes the display density, not the calculated field.
Hide arrows that are not significantgate bool on Shows only positions with z ≥ 3 and at least 30 effective cells. Turning it off also displays gradients that may reflect noise.

Outputs

  • summarywrites a summary
  • cellspaints the spatial view
  • vectorsdraws arrows over the tissue
  • seriesreturns a line chart

Tool check

The nine gates this version passed when it was published.

Verified

Passed 9 of 9 gates

  1. bundle pass
  2. manifest pass
  3. entry pass
  4. imports pass, advisory
  5. fixture pass
  6. result pass
  7. determinism pass
  8. edge pass
  9. no_mutation pass
  1. bundle pass

    5 files, 39.0 kB packed and 174.9 kB unpacked, plugin.json at the root.

  2. manifest pass

    vector-field 1.0.0 by PointillViz reference tools; entry tool.py, outputs summary, cells, vectors, series, 180 s and 4096 MB budget.

  3. entry pass

    tool.py imported in 0.20 s and defines run(ds, params).

  4. imports advisory pass

    2 Python files, importing __future__, backend, numpy, vfield_core; no network, subprocess, filesystem-write, dynamic-exec or environment use found.

  5. fixture pass

    ran on the 600-cell fixture in 0.02 s of its 180 s budget, returning summary, cells, vectors, series and 1 log line.

  6. result pass

    returned the declared outputs: summary, cells, vectors, series.

  7. determinism pass

    two runs with identical parameters produced byte-identical results (27.3 kB of JSON).

  8. edge pass

    ran at the minimum corner (arrows=200, detail=0.5, gate=False, sigma=0.6) in 0.02 s; at the maximum corner (arrows=20000, detail=2.5, sigma=3.0, source='continuous') it refused in words rather than crashing: Nothing could be measured. Of 122 grid sites inside the tissue, none were far enough from a tissue edge for the smoothing window to sit entirely on real data, so no gradient at all was computed for cont_cell_area. The grid is too coarse, or σ too large, for a region this size: lower the smoothing, raise the grid detail, or widen the selection. (code: no_measurable_sites).

  9. no_mutation pass

    the fixture dataset's 4 files are byte-identical after every run (plugin_cache/, where ds.knn caches, is excluded by design).

Passed every required gate when this version was published. That is a statement about the gates, not about whether the code is safe to run.

Versions

  1. v1.0.0 latest

More tools