upxo.topOps.topotoolbox3d module

upxo.topOps.topotoolbox3d.repair_nonManifold_voxels(lfi, articulation_mask, bboxes, library_path)[source]

Orchestrates Tiers 0-4 to resolve non-manifold pinches in the LFI.

  1. Tier 0: DNA & Connectivity Setup

  2. Tier 1: Fast Pass Stencils (Global)

  3. Tier 2: Connectivity Audit (Local)

  4. Tier 3: Manifold Cell Fetcher (Signature-based)

  5. Tier 4: Atomization (Fail-safe)

upxo.topOps.topotoolbox3d.apply_fast_pass_stencils(lfi, articulation_mask)[source]

Tier 1: Global morphological welding of 26-connected pinches into 6-connected manifold interfaces.

upxo.topOps.topotoolbox3d.connectivity_auditor(lfi, coord, neighborhood=3)[source]

Tier 2: Local 6-connectivity audit to confirm manifold breaks.

upxo.topOps.topotoolbox3d.manifold_cell_fetcher(library_path, local_sig, tolerance=0.15)[source]

Tier 3: Queries pre-verified manifold cell library using DNA signatures

upxo.topOps.topotoolbox3d.atomize_pinch(lfi, coord, current_max_id)[source]

Tier 4: The Fail-safe. Resolves knots by creating a unique single-voxel grain.

Parameters:

lfindarray

The 3D grain ID array.

coordtuple or ndarray

The (z, y, x) coordinate of the articulation point.

current_max_idint

The highest grain ID currently in the volume.

Returns:

lfindarray

Updated volume with the new ‘atom’ grain.

new_idint

The ID assigned to the atom (current_max_id + 1).

upxo.topOps.topotoolbox3d.apply_manifold_patch(lfi, coord, patch, target_fid)[source]

Surgically splices a Tier 3 patch into the LFI.

upxo.topOps.topotoolbox3d.generate_oriented_blob(coord, target_fid, dna, window_size=5)[source]

Tier 5: Creates an oriented ellipsoidal mask aligned with grain DNA.