neu_morpho.roi¶
Restrict a run to a portion of the volume, without moving the block grid.
The grid is tiled over the whole volume and then filtered, so a block’s index and region are the same in an ROI run as in a later full run: a test run over one cube is a prefix of the full run, and its fragments and manifest keys carry over.
ROIs are half-open (z0, y0, x0, z1, y1, x1) in the voxels of the scale being read.
Intersecting blocks are kept whole, never clipped, so a block index always holds the
same data.
Functions¶
|
Clamp an ROI to a volume's bounds, so an over-wide stop is not an error. |
|
Keep the blocks of the global grid that intersect |
|
Does a block region overlap the ROI (half-open, per axis)? |
|
Parse |
|
Convert an ROI between scales; |
Module Contents¶
- neu_morpho.roi.clip_to_shape(roi: Sequence[int] | None, shape: Sequence[int]) tuple[int, ...] | None¶
Clamp an ROI to a volume’s bounds, so an over-wide stop is not an error.
- neu_morpho.roi.filter_blocks(blocks, roi: Sequence[int] | None) list¶
Keep the blocks of the global grid that intersect
roi(all, if None).
- neu_morpho.roi.intersects(region: Sequence[slice], roi: Sequence[int]) bool¶
Does a block region overlap the ROI (half-open, per axis)?
- neu_morpho.roi.parse_roi(text: str | Sequence[int] | None) tuple[int, ...] | None¶
Parse
"z0,y0,x0,z1,y1,x1"(or a 6-sequence) into a tuple, or None.
- neu_morpho.roi.scale_roi(roi: Sequence[int] | None, factor_zyx: Sequence[float]) tuple[int, ...] | None¶
Convert an ROI between scales;
factor_zyx= target voxels per source voxel.Starts floor, stops ceil, so the scaled ROI always covers the original region rather than shaving a partial voxel off its edge.