Performs various image manipulations on binary images based on techniques from Mathematical morphology. To use within scripting, first retrieve a binary image of the current voxels:
im = voxels.image()
Then pass the resulting image to any of these functions. The resulting binary image can be consumed by the Add/Remove Voxels tool or by the PowerEdit tool:
# erodes the image (removes voxels starting from the boundary)
morph.erode im
# fills a hole starting at 4, 5, 8
morph.fillHole im, [4, 5, 8]
Call methods with.name(),.name(arguments)or just .name arguments .
arr, hint, [radius], [p])
-> ndarray#Fills a 3D hole within the input array, starting at the given position. This acts like a smarter "flood fill"---like the paint bucket tool in Photoshop.
ndarrayBinary image (updated in place)
Number[]Position in the array to start filling
NumberSize of the structuring element
(Optional; defaults to1)NumberExponent of the metric
(Optional; defaults to2)ndarrayResulting image