This function finds 'threads' hanging off of the edges of blobs in an image, allowing the user to trim them
A logical matrix matrix of the same size as im
containing the number of neighboring pixels
A numeric matrix representing an image, with non-zero values representing pixels to display
the minimum number of neighbors a pixel must have to be retained
the maximum number of iterations to run the thread trimming algorithm. Default: 15.
Whether to count diagonal elements as valid neighbors
Michael Hallquist
This algorithm runs count_neighbors iteratively until no pixel exceeds the trimming threshold min_neighbors
or the maximum number of iterations, maxit
, is reached.
By running iteratively, long tails are trimmed sequentially by pruning the most disconnected voxels.