Skip to content

issue runing segmentation_to_centerlines.py #1

Description

@Jamie790

Hi,

When i try to run segmentation_to_centerlines.py and try to extract centerline from .nii, i encounting following errer, any suggestions.

(meshing) jay@WINDOWS-5N745I9:~/vascularmd/Others$ python segmentation_to_centerlines.py
/home/jamie_lyu/miniconda3/envs/meshing/lib/python3.7/site-packages/skimage/util/dtype.py:531: UserWarning: Downcasting int16 to uint8 without scaling because max value 1 fits in uint8
return _convert(image, np.uint8, force_copy)

segmentation_to_centerlines.py:968: RuntimeWarning: invalid value encountered in true_divide
v.append((pt[i] - bif_coord) / norm(pt[i] - bif_coord))
segmentation_to_centerlines.py:979: RuntimeWarning: invalid value encountered in true_divide
v.append((pt[i] - bif_coord) / norm(pt[i] - bif_coord))
segmentation_to_centerlines.py:732: RuntimeWarning: invalid value encountered in true_divide
v.append(vect / norm(vect))
Traceback (most recent call last):
File "segmentation_to_centerlines.py", line 1611, in
write_swc(path_to_outfolder, path_to_img, algo = "sknw", path_data = [path_to_img])
File "segmentation_to_centerlines.py", line 1581, in write_swc
G_list = undirected_graph_to_oriented_tree(G, min_size = 200, remove_multi = True, create_cliques = True, coef_weight = 0.2, orientation = True, dim_inlet = dim_inlet)
File "segmentation_to_centerlines.py", line 1185, in undirected_graph_to_oriented_tree
T = add_weight(T, coef=coef_weight)
File "segmentation_to_centerlines.py", line 1064, in add_weight
w = (1-coef) * ((T.edges[e]["length"] - min_length)/ (max_length - min_length)) + coef * (1-((T.edges[e]["angle"] - min_angle)/ (max_angle - min_angle)))
ZeroDivisionError: float division by zero

Regards,
Jay

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions