neu_morpho.ops.export_roi_seg¶
Copy the ROI’s segmentation into the output as a precomputed volume.
So meshes and skeletons can be inspected against the labels they came from. Each scale
carries its voxel_offset, so the labels land in the same physical-nm space as the
meshes.
Every source scale is copied, not regenerated: each is cropped directly into the matching destination scale, where downsampling from level 0 would re-read far more data and might not reproduce the source’s own rule.
Cost is uneven: scale 0 usually dominates by an order of magnitude. scale_cost()
reports it and scale_indices restricts the range. By default the region is
expanded to whole blocks, matching what stage 1 meshed (roi.py).
Attributes¶
Functions¶
|
Expand an ROI to whole blocks of the global grid, clipped to the volume. |
|
Write the ROI's labels to |
|
Per-scale shape and byte estimate for an export — check before running one. |
|
|
Module Contents¶
- neu_morpho.ops.export_roi_seg.block_align(roi: Sequence[int], block_shape: Sequence[int], shape: Sequence[int]) tuple[int, ...]¶
Expand an ROI to whole blocks of the global grid, clipped to the volume.
- neu_morpho.ops.export_roi_seg.export_roi_seg(src: dict | str, out_dir: str, *, roi: Sequence[int] | str | None, roi_voxel_size: Sequence[float], scale_indices: Sequence[int] | None = None, block_shape: Sequence[int] = (256, 256, 256), align_to_blocks: bool = True, copy_block: Sequence[int] = DEFAULT_COPY_BLOCK, encoding: str | None = 'compressed_segmentation', progress_path: str | None = None, client: Any | None = None, npartitions: int | None = None, delete_existing: bool = False, resume: bool = True) dict¶
Write the ROI’s labels to
out_diras a multiscale precomputed volume.roiis in the voxels of the scale whose voxel size isroi_voxel_size;Nonecopies the whole volume.scale_indicesselects which source scales to copy (default: all) — seescale_cost()first, since scale 0 usually dominates.
- neu_morpho.ops.export_roi_seg.scale_cost(src, roi, roi_voxel_size, *, block_shape=(256, 256, 256), align_to_blocks: bool = True, scale_indices=None) list[dict]¶
Per-scale shape and byte estimate for an export — check before running one.
- neu_morpho.ops.export_roi_seg.source_levels(src, roi_voxel_size) list[tuple]¶
[(ScaleInfo, read_spec)]for the source, finest first.A source with no pyramid metadata (a bare array, an HDF5 dataset) is one level at
roi_voxel_size.
- neu_morpho.ops.export_roi_seg.DEFAULT_COPY_BLOCK = (512, 512, 512)¶
- neu_morpho.ops.export_roi_seg.PRECOMPUTED_PROFILE = 's3-neuroglancer'¶
- neu_morpho.ops.export_roi_seg.logger¶