Checks And Issues Reference#
This is the canonical reference for:
validation checks
GUI issue types
related tools
parameter sources
the current radii-cleaning and auto-labeling algorithms
Primary code sources:
swcstudio/core/validation_catalog.pyswcstudio/core/validation_checks/native_checks.pyswcstudio/core/validation_checks/neuron_morphology_checks.pyswcstudio/core/issues.pyswcstudio/core/radii_cleaning.pyswcstudio/core/auto_typing/(engine package)swcstudio/core/labeler/(the SWC auto-labeler’s code, copied byscripts/sync_labeler.py)swcstudio/tools/validation/configs/default.jsonswcstudio/tools/batch_processing/configs/radii_cleaning.jsonswcstudio/tools/batch_processing/configs/auto_typing.json
How To Read This Page#
Sourcenative: implemented directly in SWC-StudioNeuroM: wrapped from NeuroM
Severitycurrent default from
swcstudio/tools/validation/configs/default.json
JSONyes: params are exposed in JSONenabled/severity only: the check can be turned on/off and reclassified, but has no extra exposed params
Related toolthe tool the GUI routes to for inspection or repair
Pipeline Overview#
The app raises issues from three layers:
Validation checksdeterministic checks run through the shared validation engine
Suspicious-item detectorssuspicious radii and suspicious labels
Issue normalizationvalidation rows and suspicious findings become GUI issues
So one SWC can raise:
validation issues
blocked-check issues
suspicious radii issues
suspicious label issues
Validation Check Matrix#
There are 32 checks: 21 native and 11 wrapped from NeuroM.
Most checks read a working copy of the file in which each connected soma
group is merged into one node, so a complex soma does not trip them. Merging
removes the merged nodes’ IDs and makes each soma a root, so the checks about
the file’s own IDs and parent links (no_duplicate_node_ids,
no_parent_cycles, no_missing_parents, no_self_loop,
parent_id_less_than_child_id and no_node_id_gaps) read the file as
written.
File Integrity#
These run first, so they report even when multiple_somas stops validation.
Key |
Issue title |
Source |
Severity |
How checked |
Params |
JSON |
Related tool |
|---|---|---|---|---|---|---|---|
|
|
native |
critical |
Fails when a node ID is on more than one row, and lists those IDs. A parent ID that names a duplicated ID could mean either row, so the NeuroM checks are blocked, and Index Clean and the geometry edits refuse the file. |
none |
enabled/severity only |
none: renumber or remove the duplicated rows in the file, then reload it |
|
|
native |
critical |
Follows parent IDs and fails on nodes whose chain closes on itself (two or more nodes, for example A’s parent is B and B’s parent is A). Those nodes, and the nodes below them, never reach a root. The NeuroM checks are blocked, and Index Clean refuses the file. A node that is its own parent is left to |
none |
enabled/severity only |
Geometry Editing (disconnect, then reconnect) |
|
|
native |
critical |
Fails on nodes whose parent ID (other than -1) names no row in the file, often from a truncated file, and lists those nodes. They and the nodes below them are unattached. The NeuroM checks are blocked, and Index Clean and Split refuse the file rather than turning such a node into a new root. |
none |
enabled/severity only |
Geometry Editing (reconnect the node to its real parent) |
Structural Presence#
Key |
Issue title |
Source |
Severity |
How checked |
Params |
JSON |
Related tool |
|---|---|---|---|---|---|---|---|
|
|
native |
warning |
Groups connected type- |
none |
enabled/severity only |
|
|
|
native |
critical |
Runs after temporary soma consolidation and fails if more than one soma anchor remains. The file holds several cells, so validation stops here; split it first. |
none |
enabled/severity only |
|
|
|
native |
critical |
Fails if no node has type |
none |
enabled/severity only |
Manual Label Editing / Auto Label Editing |
|
|
native |
critical |
Fails if any node type is |
none |
enabled/severity only |
Manual Label Editing |
|
|
native |
warning |
Requires every used custom type ( |
none |
enabled/severity only |
|
|
|
native |
warning |
Fails if no node has type |
none |
enabled/severity only |
Manual Label Editing / Auto Label Editing |
|
|
native |
warning |
Fails if no node has type |
none |
enabled/severity only |
Manual Label Editing / Auto Label Editing |
|
|
native |
warning |
Fails if no node has type |
none |
enabled/severity only |
Manual Label Editing / Auto Label Editing |
Radius And Size#
Key |
Issue title |
Source |
Severity |
How checked |
Params |
JSON |
Related tool |
|---|---|---|---|---|---|---|---|
|
|
native |
critical |
Fails on non-soma nodes with non-finite or |
none |
enabled/severity only |
Manual Radii Editing |
|
|
NeuroM |
critical |
Calls NeuroM |
|
yes |
Manual Radii Editing |
|
|
NeuroM |
warning |
Calls NeuroM |
|
yes |
Manual Radii Editing |
|
|
NeuroM |
warning |
NeuroM’s |
|
yes |
Manual Radii Editing |
|
|
NeuroM |
warning |
Calls NeuroM |
|
yes |
Manual Radii Editing |
|
|
native |
warning |
Fails when any radius is above |
|
yes |
Auto Radii Editing |
Length And Geometry#
Key |
Issue title |
Source |
Severity |
How checked |
Params |
JSON |
Related tool |
|---|---|---|---|---|---|---|---|
|
|
native |
critical |
Uses segment-based section validity and fails on zero or invalid derived section length. |
none |
enabled/severity only |
Geometry Editing |
|
|
native |
critical |
Computes Euclidean parent-child distance and fails on non-finite or |
none |
enabled/severity only |
Geometry Editing |
|
|
NeuroM |
warning |
Calls NeuroM |
none |
enabled/severity only |
Geometry Editing |
|
|
NeuroM |
warning |
Calls NeuroM |
|
yes |
Geometry Editing |
|
|
native |
critical |
Fails only when the full |
none |
enabled/severity only |
Geometry Editing |
|
|
native |
warning |
Flags parent-child segments above a threshold derived from absolute, median-ratio, and MAD-based bounds. |
|
yes |
Geometry Editing |
Topology#
Key |
Issue title |
Source |
Severity |
How checked |
Params |
JSON |
Related tool |
|---|---|---|---|---|---|---|---|
|
|
native |
critical |
Fails on non-soma nodes with |
none |
enabled/severity only |
Geometry Editing |
|
|
native |
critical |
Fails when |
none |
enabled/severity only |
Geometry Editing |
|
|
NeuroM |
warning |
Calls NeuroM |
none |
enabled/severity only |
Geometry Editing |
|
|
NeuroM |
warning |
Calls NeuroM |
none |
enabled/severity only |
Geometry Editing |
|
|
NeuroM |
warning |
Calls NeuroM |
none |
enabled/severity only |
Geometry Editing |
Index Consistency#
Key |
Issue title |
Source |
Severity |
How checked |
Params |
JSON |
Related tool |
|---|---|---|---|---|---|---|---|
|
|
NeuroM |
critical |
Calls NeuroM |
|
yes |
Geometry Editing |
|
|
NeuroM |
critical |
Calls NeuroM |
|
yes |
Geometry Editing |
|
|
native |
warning |
Fails when a valid in-file parent ID is |
none |
enabled/severity only |
Index Clean |
|
|
native |
info |
Fails when sorted unique node IDs skip integers, read from the file as written (merging a complex soma does not count as a gap). |
none |
enabled/severity only |
Index Clean |
Index Clean refuses a file with duplicate node IDs or a parent cycle, including a node that is its own parent, and writes nothing. The error names the IDs.
GUI-Only Issue Generators#
These are shown in the issue-driven workflow but are not entries in default.json.
Source key |
Title |
How generated |
Config source |
Related tool |
|---|---|---|---|---|
|
|
Grouped from validation rows that could not run because morphology building failed. Duplicate node IDs and parent cycles (including a node that is its own parent) block the NeuroM checks with their own titles. |
none |
Validation, Manual Label Editing or Geometry Editing, depending on cause |
|
|
Runs the shared radii-cleaning engine and groups nodes the cleaner would change. |
|
Auto Radii Editing |
|
|
Runs the auto-labeler on the file (labels only; the quality flag is not scored) and groups the nodes whose current type differs from the labeler’s type. In the GUI it runs again on each validation refresh. |
|
Auto Label Editing |
Issue Model#
Issues normalized in swcstudio/core/issues.py use these fields:
issue_idseveritycertaintydomaintitledescriptionnode_idssection_idstool_targetsuggested_fixstatussource_keysource_labelsource_categorysource_payload
Radii Cleaning Algorithm#
The suspicious radii issue and Auto Radii Editing use the same shared backend in swcstudio/core/radii_cleaning.py.
Current method#
The current cleaner is directed-path and fixed-point based:
build topology and directed branch paths
look up each node type’s plausible radius range (fixed, not taken from the file)
Pass 1: flag and replace radii that are invalid, above the plausible maximum, or more than 3 times thicker or thinner than their plausible neighbours on both sides (local_outlier.max_ratio = 3)Pass 2: taper enforcement (off by default)Pass 3: local polynomial smoothing of the flagged nodes’ replacementsre-apply taper (when on)
repeat until no issue-visible changes remain
Only radii that fail one of these tests change; natural variation (on expert-traced cells, 99% of radii lie within x1.9 of their neighbours) is left alone.
Soma radii are always preserved.
Plausible radius ranges (µm), sanity_bounds:
Type |
Minimum |
Maximum |
|---|---|---|
axon (2) |
0.05 |
5 |
basal dendrite (3) |
0.05 |
8 |
apical dendrite (4) |
0.05 |
10 |
any other neurite type |
0.05 |
10 |
A radius above its type’s maximum is always flagged. A radius below the
minimum is changed only when it is an outlier among its neighbours, or when
small_radius_zero_only is off: values such as 0.004 are common
placeholders for an unknown radius, and replacing them would invent data.
Only radii inside the range serve as reference or replacement values, so a
file whose radii are mostly wrong cannot pull good values toward them. The
taper rule, when turned on, caps a node only by a parent whose radius is
plausible.
Reasons recorded per changed node#
non_finitenon_positivebelow_type_minabove_type_maxlocal_outliertaper_cappost_smooth_taper_capaxon_floorsavitzky_golay
Current radii-clean config keys#
Main config file:
swcstudio/tools/batch_processing/configs/radii_cleaning.json
Current top-level rule groups:
small_radius_zero_onlysanity_bounds.default(min_radius,max_radius)sanity_bounds.per_type(enabled,min_radius,max_radius; configs from earlier versions withlower_abs/upper_absstill work)local_outliertaperaxon_floorsavgolfixed_pointreplacement
Important defaults:
local_outlier.window_nodes = 5local_outlier.max_ratio = 3taper.enabled = false(taper.slack = 0.05when on)axon_floor.enabled = false(raises axon radii belowaxon_floor.min_radius = 0.12when on)savgol.window_nodes = 7savgol.polyorder = 2fixed_point.max_passes = 32fixed_point.min_effective_delta = 0.005
Auto Labeling Algorithm#
The suspicious label issue and Auto Label Editing run the same engine, the SWC auto-labeler 1.0.1. It is implemented in:
swcstudio/core/auto_typing/(engine package)swcstudio/core/labeler/(the labeler’s own code)swcstudio/tools/batch_processing/configs/auto_typing.json(user-editable settings)
The suspicious label issue compares labels only. It does not score the quality flag.
Pipeline architecture#
Each file goes through five stages. The model files live in the
labeler-1.0.1/ model folder.
Stage |
Files |
What it produces |
|---|---|---|
Stage 0, structural checks |
none (rules) |
Pass or reject. A file must hold one connected cell (a single root and no orphan nodes) with a soma, at least one neurite node, between 10 and 200,000 nodes, finite coordinates, and finite, non-negative radii. A rejected file is not labeled; the error says |
Stage 1, cell class |
|
3-class (axon, basal, apical) or 2-class (axon, dendrite), decided from whole-cell shape, unless the user chooses the class. |
Stage 2, subtree labels |
|
A gradient-boosted classifier labels each primary subtree that leaves the soma. |
Stage 3, topology rules and correction |
|
Rules enforce the expected anatomy, for example a single axon tree and, for 3-class cells, a single apical tree. For 3-class cells, a learned correction then re-decides single branches within 150 µm of path length from the soma. |
Stage 4, quality flag |
|
One flag per cell class. It predicts the cell’s per-cell F1. A single file is flagged below the flag’s fixed cut-off; a batch flags the riskiest share of each cell class (10% by default). It never changes labels. |
A file whose soma nodes form several disconnected groups is refused before Stage 0. Split it first.
Cell class and apical labels#
Only 3-class cells get apical labels (type 4). 2-class cells get axon (type 2) and dendrite labels; the dendrites are written as type 3.
The cell class comes from Stage 1 when it is set to auto. The user can
choose 3-class or 2-class instead in the GUI, on the CLI
(--cell-class) or in the configuration file. Stage 1 still runs. If
it predicts the other class, the chosen class is used and the cell is
flagged as a class mismatch.
Config keys#
The user-editable JSON at
swcstudio/tools/batch_processing/configs/auto_typing.json is small.
The engine’s behavior is set by the trained model files, not by
hand-tuned weights. Keys:
enabled:trueby defaultmodel_dir: a model folder to use. An empty string means theSWCSTUDIO_MODEL_DIRfolder when that variable is set, and otherwise the default search: the user data folder, the desktop app’s model folder, then the package folder.cell_type:auto(Stage 1 decides),3-classor2-classflag_enabled: score the quality flag (trueby default)flag_budget: the share of each cell class a batch flags for review (0.1by default)notes: a description for people; the engine does not read it
To use your own trained models everywhere without editing this file,
set the SWCSTUDIO_MODEL_DIR environment variable to their folder.
Model updates install into the user data folder (%APPDATA%\swcstudio\models\
on Windows, ~/Library/Application Support/swcstudio/models/ on macOS,
or ~/.local/share/swcstudio/models/ on Linux) and replace its
contents, so do not keep your own models there.
See Auto-Typing Engine for model resolution, the flag review, and training.
How Checks Become GUI Issues#
Current conversion rules:
validation
passno issue
validation
info(a failing check whose severity isinfo)infoissue
validation
warning(a failing check whose severity iswarning)warningissue
validation
fail(a failing check whose severity iserror)criticalissue
blocked or dependency-failed checks
collapsed into grouped blocked-check issues
suspicious radii changes
one aggregated
Outlier radii detectedissue
suspicious label changes
one aggregated
Likely wrong labelsissue
Where To Edit Behavior#
validation check enable/severity/params
swcstudio/tools/validation/configs/default.json
radii cleaning behavior
swcstudio/tools/batch_processing/configs/radii_cleaning.json
auto labeling behavior
swcstudio/tools/batch_processing/configs/auto_typing.json