neu_morpho.ops.meshify

Block-first, two-stage meshing orchestrated with blockrun.

stage 1 “chunk” : block_map over non-empty blocks -> per-(body,block) fragments stage 2 “assemble” : block_map over bodies (from fragments) -> multires meshes

One manifest, two groups (“chunk” keyed by block index, “assemble” by body id). Resume skips done tasks; running only stage 2 reuses the fragments on disk. The caller passes seg_spec at the meshing scale and occupancy_spec at a coarse one, with their voxel sizes (nm), and the meshing scale’s origin (nm), which places the vertices.

Attributes

Functions

meshify(seg_spec, out[, mesh_cfg, mesh_origin_nm, ...]) → dict

Mesh a segmentation body-by-body via block-first chunking + assembly.

Module Contents

neu_morpho.ops.meshify.meshify(seg_spec: dict, out: neu_morpho.config.OutputConfig, mesh_cfg: neu_morpho.config.MeshConfig | None = None, *, mesh_voxel_size: Sequence[float], mesh_origin_nm: Sequence[float] = (0.0, 0.0, 0.0), allowlist: Any = None, occupancy_spec: dict | None = None, occupancy_voxel_size: Sequence[float] | None = None, occupancy_dilate: int = 1, roi: Sequence[int] | str | None = None, db_path: str | None = None, max_consecutive_failures: int = 10, stages: Sequence[str] = ('chunk', 'assemble'), client: Any | None = None, npartitions: int | None = None, resume: bool = True) → dict

Mesh a segmentation body-by-body via block-first chunking + assembly.

roi ("z0,y0,x0,z1,y1,x1" or a 6-sequence, in mesh-scale voxels) restricts stage 1 to the blocks intersecting it on the global grid, so a trial run is a prefix of the full run. A body straddling the ROI edge is meshed only from inside it.

mesh_origin_nm (zyx) is where the meshing scale’s index 0 lies, from its Frame: a volume with a voxel offset meshes in place only with it.

With db_path, each body’s mesh metrics (surface area, vertex and component counts) go to the metrics DB; under an ROI they describe the truncated body.

Stage-2 failures are isolated per body (stage 1 fails fast; see ops/manifest.py). max_consecutive_failures stops the stage (0 disables); a systemic error aborts at once.

neu_morpho.ops.meshify.logger