Skip to content

Commit

Permalink
remove accidental skeleton thickening
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxGamill-Sheffield committed Dec 11, 2024
1 parent f89f8ab commit 1d47377
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions topostats/tracing/disordered_tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import skimage.measure as skimage_measure
from scipy import ndimage
from skimage import filters
from skimage.morphology import binary_dilation, label
from skimage.morphology import label

from topostats.logs.logs import LOGGER_NAME
from topostats.tracing.pruning import prune_skeleton
Expand Down Expand Up @@ -750,10 +750,7 @@ def get_skan_image(original_image: npt.NDArray, pruned_skeleton: npt.NDArray, sk
path_coords = skan_skeleton.path_coordinates(i)
if skan_column == "node-id-src":
branch_field = i
temp = np.zeros_like(branch_field_image)
temp[path_coords[:, 0], path_coords[:, 1]] = 1
temp = binary_dilation(temp)
branch_field_image[temp != 0] = branch_field + 1
branch_field_image[path_coords[:, 0], path_coords[:, 1]] = branch_field + 1
except ValueError: # when no skeleton to skan
LOGGER.warning("Skeleton has been pruned out of existence.")

Expand Down

0 comments on commit 1d47377

Please sign in to comment.