kalemaria / pycurv Goto Github PK
View Code? Open in Web Editor NEWReliable estimation of membrane curvature for cryo-electron tomography
License: GNU Lesser General Public License v3.0
Reliable estimation of membrane curvature for cryo-electron tomography
License: GNU Lesser General Public License v3.0
Newer versions of numpy don't support calling numpy data types with too low precision - https://numpy.org/doc/stable/release/1.24.0-notes.html#expired-deprecations. Could just pin older numpy versions as a requirement but I think the best approach would be to replace np.int with np.int32 etc where appropriate. I'm happy to prepare a PR to address this.
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'
Hello!
I'm trying to apply pycurv to viral membranes that were segmented using EMAN2, and I was wondering what label I would use for surface generation since the segmentation was not generated in TomosegmemTV and do not contain any labels.
Best,
Judy Huang
Hi Maria,
I have been trying to set up pycurv to analyze some mitochondria which have complex cristae morphology, which makes compartment segmentation difficult to borderline impossible, so I am using the membrane surface generation tools packaged with pycurv. I am seeing a consistent error in surface generation with this tool, however, which I highlighted with pictures of the voxel segmentation and the resulting surface:
This is just the outer membrane surface, but there is a consistent gap in the segmentation on both sides of the membrane where the membrane is most vertical (at the equator of the mitochondria). The following outer membrane segmentation (voxels) can reproduce the problem: https://www.dropbox.com/s/kguo79h7nyzxhr4/OMM_thick.mrc?dl=0. The gap doesn't align with the XY plane, since there is pretilt from the lamella which I didn't correct for in IMOD.
Do you have any advice for mitigating or correcting this error? Compartment segmentation is going to be near-impossible with this data, though I know it is probably the easiest solution!
Thanks,
Ben Barad
Hi Maria!
Hope you're doing well. I was wondering if it's possible to use one segmentation for the membrane and an additional for the lumen, in lieu of a single file containing the segmentations for both the membrane and the lumen. I currently have two annotations of the same tomogram, where both the membrane and the lumen are labelled 1, and I'm having trouble merging the two with the programs I am familiar with.
Thank you!
Judy
I sorted it out, it is a little mistake I have for the label.
Thanks for the pycurv package !
Hi kalemaria,
Many thanks for the pycurv development.
I am a PhD student and I would like to use it for some mito membrane curvature. Your workflow is well explained, but as I am a real beginner for python, I am stuck with the following error after this line:
binary_seg = (seg == label).astype(data_type)
AttributeError Traceback (most recent call last)
in
----> 1 binary_seg = (seg == label).astype(data_type)
AttributeError: 'bool' object has no attribute 'astype'
Many thanks in advance.
If it is easier for you, here is my email address [email protected].
Best,
Yangci
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.