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.
ndarray
Binary image (updated in place)
Number[]
Position in the array to start filling
Number
Size of the structuring element
(Optional; defaults to1
)Number
Exponent of the metric
(Optional; defaults to2
)ndarray
Resulting image