neu_proc.ops.offset¶
Shift an array by whole voxels, keeping its shape: offset().
The far side is filled by one of two methods:
extendrepeats the edge plane outward, adding only what the boundary already holds; the default, and right for a label volume.constwritesfill_const(0, background, by default).
There is no “dilate” fill: edt dilation is unbounded and would fill interior
background too, and even bounded it would invent labels where the edge is background.
Fill the margin, then dilate explicitly if that is wanted.
Attributes¶
Functions¶
|
|
Module Contents¶
- neu_proc.ops.offset.offset(arr, offset, fill_method: str = 'extend', fill_const=0) numpy.ndarray¶
arrshifted byoffsetwhole voxels, keeping its shape.offset(labels, 1) # one voxel along every axis offset(labels, (2, 0, -3)) # per axis, either direction offset(labels, 4, “const”, fill_const=0)
offsetis a scalar for all three axes or one value per axis, zyx, positive toward higher indices. What falls off one side is dropped and the other side is filled byfill_method(FILL_METHODS).The origin is not adjusted: through
Piece.applythe shifted data keeps the old frame. If the shift should move the data in physical space, pass aframe=with the origin moved accordingly.
- neu_proc.ops.offset.FILL_METHODS¶