GithubHelp home page GithubHelp logo

kalemaria / pycurv Goto Github PK

View Code? Open in Web Editor NEW
16.0 16.0 6.0 586.12 MB

Reliable estimation of membrane curvature for cryo-electron tomography

License: GNU Lesser General Public License v3.0

Python 83.49% Shell 0.42% Jupyter Notebook 16.09%

pycurv's People

Contributors

anmartinezs avatar bbarad avatar kalemaria avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

pycurv's Issues

TypeError when using normals_directions_and_curvature_estimation

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'

Membrane label

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

Consistent problem with Surface generation from membrane (noncompartment) segmentation

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:

Screen Shot 2021-03-03 at 10 47 45 AM

Screen Shot 2021-03-03 at 11 25 38 AM

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

Using second segmentation for lumen

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

AttributeError

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)

:1: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.