check_backbone_proofread_hybrid.py

Audit

Three-way corroboration for when you need to prove the answer (skeptics, or validating a new script). Runs the same IDs through three engines side by side — a supervoxel method, banc-bot's own code imported from the banc package (is_latest_roots + banc.lookup.annotations, i.e. the literal <id>??), and suggest_latest_roots — flags every disagreement, and writes a *_bancbot_log.txt reproducing banc-bot's replies as an offline audit trail. Its reconciled best_current_id / best_proofread columns match resolve_and_status.py.

Usage

python check_backbone_proofread_hybrid.py --input ids.txt
Repo: tracer-tools-extensions/check_backbone_proofread_hybrid.py Needs: pip install banc (then restore cloud-files==6.3.1)

fast_validate_ids.py

Experimental

Parallel ID updater using ThreadPoolExecutor. Checks whether root IDs are still current and resolves stale ones to their latest version; processes 5,000+ IDs in under 2 minutes by parallelizing supervoxel lookups, then batching root lookups in a single API call. Updates IDs only — it does not report proofread status. For updating IDs and checking proofread status together, use resolve_and_status.py above. Resolves via single-supervoxel tracking (follows physical voxels through splits/merges), which can land on a minor fragment after a split; resolve_and_status.py uses the split-robust suggest_latest_roots instead.

Usage

python fast_validate_ids.py --input ids.txt python fast_validate_ids.py --input ids.txt --output results.txt --workers 20
Repo: tracer-tools-extensions/fast_validate_ids.py Default datastack: brain_and_nerve_cord Default workers: 20

Known Issues

  • No retry logic for transient API failures; a single thread error loses that ID
  • Progress reporting is coarse (every 500 IDs)
  • High worker count may trigger CAVE API rate limits on some networks

fast_validate_ids_updated_auto_detect_path.py

Experimental

Portable version of fast_validate_ids for coworkers / other machines. Auto-detects the tracer_tools/src module path relative to the script, removing the need to hand-set --tracer-path (pass it manually if auto-detect fails). Same behavior otherwise — ID updates only, no proofread status.

Usage

python fast_validate_ids_updated_auto_detect_path.py --input ids.txt --output results.txt

fast_get_coords.py

Experimental

Parallel coordinate fetcher. Gets viewer-resolution coordinates for thousands of root IDs by parallelizing L2 chunk lookups, then batching L2 coordinate fetches. Output is tab-separated (root_id, x, y, z) ready to paste into Google Sheets.

Usage

python fast_get_coords.py --input ids.txt python fast_get_coords.py --input ids.txt --output coords.tsv --workers 20
Repo: tracer-tools-extensions/fast_get_coords.py Default datastack: brain_and_nerve_cord Default workers: 20

Known Issues

  • No retry logic for transient API failures; a single thread error loses that ID
  • Uses L2 representative coordinates only (not skeleton centroids)
  • L2 cache batches of 100 may still occasionally 504 on slow connections

full_pipeline.py

Experimental

Complete workflow script: update IDs → get coordinates → output to file, clipboard, or Google Sheets. Combines multiple steps into one command.

Usage

python tracer_tools/scripts/full_pipeline.py --input ids.txt --output results.tsv
Location: tracer_tools/scripts/full_pipeline.py

validate_ids_batch.py

Experimental

Batch ID validator for large datasets (1,000+ IDs). Processes in chunks with progress reporting. More robust than fast_validate_ids for very large batches and Windows environments.

Usage

python tracer_tools/scripts/validate_ids_batch.py --input ids.txt --output results.txt
Location: tracer_tools/scripts/validate_ids_batch.py Default datastack: brain_and_nerve_cord

process_file_column.py

Experimental

Adds coordinate columns to CSV/TSV files. Reads root IDs from a specified column, fetches coordinates, and writes them to adjacent columns in-place.

Usage

python tracer_tools/scripts/process_file_column.py --input data.csv
Location: tracer_tools/scripts/process_file_column.py

Google Sheets Integration

sheets_get_coords.py

Experimental

Reads root IDs from a Google Sheet, fetches coordinates via CAVE, and writes the coordinates back to columns in the same sheet. Modifies in-place.

Location: tracer_tools/scripts/sheets_get_coords.py

sheets_get_coords_safe.py

Experimental

Safe mode version: creates a new worksheet with coordinate results rather than modifying the original sheet.

Location: tracer_tools/scripts/sheets_get_coords_safe.py

sheets_coords_oauth.py

Experimental

OAuth-based Google Sheets coordinate updater. Uses browser-based OAuth flow instead of service account credentials. Includes offset/limit support for processing sheets in batches.

Usage

python tracer_tools/scripts/sheets_coords_oauth.py --sheet "SHEET_ID" --offset 0 --limit 1000 --update-ids
Location: tracer_tools/scripts/sheets_coords_oauth.py

sheets_merge.py

Experimental

Merges multiple Google Sheets into one. Useful for combining parallel batch outputs or consolidating results from multiple processing runs.

Location: tracer_tools/scripts/sheets_merge.py

CLI Utilities

get_coords_cli.py

Stable

Interactive CLI for fetching coordinates for root IDs. Sequential processing (for small batches or one-off lookups).

Usage

python tracer_tools/scripts/get_coords_cli.py --datastack brain_and_nerve_cord --ids 720575941471915328
Location: tracer_tools/scripts/get_coords_cli.py

update_ids_cli.py

Stable

Interactive CLI for updating outdated segment IDs. Uses the accurate supervoxel method to track IDs through splits and merges.

Usage

python tracer_tools/scripts/update_ids_cli.py --datastack brain_and_nerve_cord --with-coords
Location: tracer_tools/scripts/update_ids_cli.py

monitor_validation.py

Utility

Monitors real-time progress of running batch ID validation. Useful when processing large datasets with validate_ids_batch.py.

Location: tracer_tools/scripts/monitor_validation.py

save_cave_token.py

Setup

Saves your CAVE authentication token to the standard location. Run this once before using any CAVE-dependent scripts.

Location: tracer_tools/scripts/save_cave_token.py

Mesh & Volume Pipeline

Turn Neuroglancer annotation points into publicly-viewable precomputed mesh (and optional 2D segmentation) layers. All in tracer-tools-extensions; Windows/nokura-adapted variants of the upstream tooling.

state_to_ng_layer_ben.py

Experimental

One-command mesh pipeline: an annotation layer of points → a publicly-viewable precomputed mesh layer. Supports convex hull (default) and a 3D alpha-shape ("shrinkwrap") that auto-tunes alpha to a single-component watertight mesh, then uploads to a bucket with the correct ACLs and info dimensions. Composes three helpers: json_to_volume_ben.py (points → mesh), obj_to_volume_ben.py (OBJ → volume), bucket_upload_folder_ben.py (folder → bucket).

Usage

python state_to_ng_layer_ben.py state.json --layer annotation3 --name region_v1 python state_to_ng_layer_ben.py state.json --layer pts --name region_v2 --method alpha
Repo: tracer-tools-extensions/state_to_ng_layer_ben.py Needs: trimesh, cloud-volume, cloud-files>=6.x, boto3, scipy

state_to_ng_seg_layer_ben.py + serve_local_precomputed_ben.py

Experimental

For when the layer should render in both the 2D cross-section panel and 3D, not just 3D. Extends the mesh pipeline by voxelizing the mesh into a chunked precomputed segmentation volume so NG's 2D view has per-voxel IDs to sample. serve_local_precomputed_ben.py is a tiny CORS HTTP server for previewing a --no-upload build in NG before publishing. Adds ~2–3 min and 30 MB–1 GB per mesh, so the mesh-only pipeline stays the default when 2D fills aren't needed.

Usage

python state_to_ng_seg_layer_ben.py state.json --layer annotation1 --name my_region --method alpha --no-upload python serve_local_precomputed_ben.py C:\path\to\workdir\image # -> precomputed://http://localhost:9000

merge_layers_to_ng_ben.py

Experimental

Combines multiple annotation layers into one hosted mesh (vs one mesh per layer). Useful when N point clusters should be a single 3D region — e.g. 12 sub-regions → one watertight envelope for "does this neuron pass through" testing. Self-contained (pulls scale and EM source from the state directly). Optional boolean union, dilation, Taubin smoothing, and a marching-cubes remesh that guarantees watertight output.

Usage

python merge_layers_to_ng_ben.py state.json --name all_regions --combine per-layer --method alpha --union --remesh-pitch 500
Repo: tracer-tools-extensions/merge_layers_to_ng_ben.py Optional deps: manifold3d, scikit-image, fast-simplification

bucket_copy_folder_ben.py

Experimental

Copies a precomputed folder from one bucket to another with the nokura-safe client (colon-name translation, public-read ACLs). A local stand-in for the upstream tracertools.bucket_copy_folder — used to copy meshes into the shared central folder. Requires cloud-files>=6.x (older versions silently make shared-folder copies unreadable).

Link Restoration Pipeline

Collect old Neuroglancer / appspot / CAVE-state share links, classify which still work, and rebuild the dead-but-restorable ones. The command-line companion to the Link Restorer web tool — both share the same fetch/route logic. Guiding rule: a link's host does not identify the dataset; only the fetched state contents do.