Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for graph operations #334

Open
jnsbck opened this issue Apr 11, 2024 · 3 comments · May be fixed by #355
Open

support for graph operations #334

jnsbck opened this issue Apr 11, 2024 · 3 comments · May be fixed by #355
Assignees
Labels
enhancement New feature or request v1.0

Comments

@jnsbck
Copy link
Contributor

jnsbck commented Apr 11, 2024

Add .to_graph() and .from_graph() methods. See below. This is a long term thing though.

I agree, these things would be awesome to have, but I think we should add all of this functionality separately. Maybe in jaxley.graph_utils or something. Then the user could resample, clean, fix, edit, etc. however he wants directly on the graph. We could add a to_graph and from_graph method, that casts module.nodes to a networkx DiGraph object. Then graph_utils could operate on that.

Originally posted by @jnsbck in #238 (comment)

@jnsbck jnsbck added the enhancement New feature or request label Apr 11, 2024
@michaeldeistler
Copy link
Contributor

Would be awesome if from_graph could be used to read swc...not sure if possible

@jnsbck
Copy link
Contributor Author

jnsbck commented Apr 11, 2024

I.e. read swc into networkx DiGraph before running cell = Cell.from_graph(swc_graph) or something? Should work I think. MorphoPy does something like this.

https://github.com/berenslab/MorphoPy/blob/3ae9d1f51b6cac7d08a820cb1fcae931425bc797/morphopy/neurontree/utils.py#L356-L468

@michaeldeistler
Copy link
Contributor

Yes it would be great if we could entirely remove my hand-written SWC reader. I would be open to use MorphoPy for this, or just networkx (not sure what is easier, I know neither of those two libraries well). The features we need are:

  • automatically reconstruct parents (i.e. the branch structure)
  • get length and radius of every reconstructed point in every branch
  • get the type of every branch

Anyways, let's maybe talk about this next week before starting to tackle it, but I think it could be worth it.

@jnsbck jnsbck self-assigned this Apr 25, 2024
@jnsbck jnsbck linked a pull request Apr 25, 2024 that will close this issue
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request v1.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants