kalemaria / pycurv

Reliable estimation of membrane curvature for cryo-electron tomography
GNU Lesser General Public License v3.0
16 stars 6 forks source link

TypeError when using normals_directions_and_curvature_estimation #11

Open kyy-chow opened 1 year ago

kyy-chow commented 1 year ago

I've come across a TypeError when using normals_directions_and_curvature_estimation. I've also reproduced this same error for different methods (VV, AVV, SSVV) and with one of the brain .vtk files from experimental_data_sets.

I'm not sure what's gone wrong, so I'd be grateful for any help. Please let me know if you need more information. Thank you!

TypeError                                 Traceback (most recent call last)
[<ipython-input-4-d5cf739c16fd>](https://localhost:8080/#) in <module>
     40 
     41 print("Estimating surface normals and principal directions and curvatures...")
---> 42 method_tg_surf_dict = normals_directions_and_curvature_estimation(
     43     tg, radius_hit, methods=methods, page_curvature_formula=True, area2=area2, cores=cores)
     44 

3 frames
[/usr/local/lib/python3.9/dist-packages/pycurv/vector_voting.py](https://localhost:8080/#) in normals_directions_and_curvature_estimation(sg, radius_hit, epsilon, eta, methods, page_curvature_formula, full_dist_map, graph_file, area2, only_normals, poly_surf, cores, runtimes)
    104         results = {}
    105         for method in methods:
--> 106             sg_curv, surface_curv = curvature_estimation(
    107                 radius_hit, graph_file=graph_file, method=method,
    108                 page_curvature_formula=page_curvature_formula, area2=area2,

[/usr/local/lib/python3.9/dist-packages/pycurv/vector_voting.py](https://localhost:8080/#) in curvature_estimation(radius_hit, graph_file, method, page_curvature_formula, area2, poly_surf, full_dist_map, cores, runtimes, vertex_based, sg)
    509 
    510     # Transforming the resulting graph to a surface with triangles:
--> 511     surface_curv = graph_to_triangle_poly(verbose=False)
    512 
    513     t_end2 = time.time()

[/usr/local/lib/python3.9/dist-packages/pycurv/surface_graphs.py](https://localhost:8080/#) in graph_to_triangle_poly(self, verbose)
   1480                     data_type = self.graph.vp[prop_key].value_type()
   1481                     data_type = TypesConverter().gt_to_numpy(data_type)
-> 1482                     array.InsertNextTuple(self.get_vertex_prop_entry(
   1483                         prop_key, vd, n_comp, data_type))
   1484             if verbose:

[/usr/local/lib/python3.9/dist-packages/pycurv/graphs.py](https://localhost:8080/#) in get_vertex_prop_entry(self, prop_key, vertex_descriptor, n_comp, data_type)
    432         prop = list()
    433         if n_comp == 1:
--> 434             prop.append(data_type(self.graph.vp[prop_key][vertex_descriptor]))
    435         else:
    436             for i in range(n_comp):

TypeError: float() argument must be a string or a number, not 'Vector_double'