diku-dk / CarGen

Python code for the paper "A direct geometry processing cartilage generation method for using segmented bone models from datasets with poor cartilage visibility”
MIT License
2 stars 3 forks source link

hip joint cartilage generator does not work #1

Open petr-henys opened 1 year ago

petr-henys commented 1 year ago

Hi, when trying to run examples, I get this error:

File e:\computing\bone_database\notebooks\..\cargen\hj_cartilage_function.py:38, in get_hj_cartilage(vertices_p, faces_p, vertices_s, faces_s, param)
     31 intt_face_idxs = cargen.get_initial_surface(vertices_p,
     32                                             faces_p,
     33                                             vertices_s,
     34                                             faces_s,
     35                                             param.gap_distance)
     37 # delete the cartilage boundary layer
---> 38 int_face_idxs = cargen.trim_boundary(faces_p,
     39                                      intt_face_idxs,
     40                                      face_adjacency,
     41                                      cumulative_sum,
     42                                      param.trimming_iteration)
     44 # removing extra components
     45 int_face_idxs = cargen.get_largest_component(faces_p,
     46                                              int_face_idxs)
...
--> 151 edge_vertex_idxs = igl.boundary_facets(faces[sub_face_idxs])
    152 boundary_vertex_idxs = np.unique(edge_vertex_idxs.flatten())
    154 boundary_face_idxs = []

ValueError: Invalid mesh indices, t has zero rows (t.shape = [0, 3]) 

Do I make something wrong?

thanks, Petr

moshfeghi commented 1 year ago

Hi, It seems like the bone surface mesh models are not being read properly. When running the "hj_cartilage.ipynb" code, were you able to visualize the left femur and pelvic bones?