neu_morpho.measure.driver¶
Block-mapped per-body volume over a published segmentation.
Fills voxel_count / volume_nm3 in a MetricsDB, block by block, resumably; the
pure per-block work is in sweep.py.
No occupancy or ROI prefilter by default: a compartment-mask ROI omits somata outside it, and
V/Lwould divide a truncated volume by complete cable. An empty block costs about a tenth of a dense one, so reading everything is affordable.Counts, not bboxes (see
MetricsDB.apply_counts_block).Per-block retry of transient errors; a persistent one still stops the run.
Functions¶
|
Union the body ids named by each source; |
|
Count each body's voxels across |
Module Contents¶
- neu_morpho.measure.driver.resolve_keep(sources: Iterable[str] | None) set[int] | None¶
Union the body ids named by each source;
Nonefor “record every label”.A source is a file of ids (one per line, or a first CSV column), or a
neuroglancer_segment_propertiessource (a directory or URL with aninfo) whoseidsare taken;os.path.isfiletells them apart. Several may be given, as a dataset may split its properties across sources. A properties source is usually a better cohort gate than a size threshold: only named bodies have properties.
- neu_morpho.measure.driver.sweep_volumes(seg_spec: dict, db_path: str, *, voxel_size: Sequence[float], block: int | Sequence[int] = DEFAULT_BLOCK, keep: Iterable[int] | None = None, roi: Sequence[int] | str | None = None, background: int = 0, attempts: int = 5, client: Any | None = None, npartitions: int | None = None, resume: bool = True) dict¶
Count each body’s voxels across
seg_specand accumulate intodb_path.voxel_size(nm, zyx) is the read level’s own voxel size, fromneu_vol.read_scales(pyramids may be anisotropic, so never2**level).keeprestricts which bodies are recorded, not which blocks are read, so its rows are complete. Refuses a DB that already holds an index scan: both fillvoxel_count.