-
Notifications
You must be signed in to change notification settings - Fork 16
Plotting of comp morphology #432
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
Conversation
Hi Jonas, thanks, this can be super useful, especially for the radiuses. I don't understand this sentence: Afaik we currently have no notion of "comp center", so I don't understand what you mean. |
We do in '_update_nodes_with_xyz'. |
Okay! Then yes, I think I would be pro |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, awesome! Please add a test (just ensuring that there is no error) for a compartment, branch, cell, network, swc file, and net.cell(1).vis(...)
Thanks for the feedback! Should I also add the col kwarg for consistency? #432 (comment) |
Yes I think it would be great to have a |
@michaeldeistler added tests and addressed all comments. Feel free to merge if you approve. |
swc files to reproduce the effect of zigzaging morphologies on the comp lengths. file extension changed to txt since swc not supported |
I got side-tracked while working on a different PR and implemented plotting of the actual compartment structure:
The compartments are rendered in 3D and then the correct projection of the 3d mesh is plotted on whatever plane.
Hence the compartment radii and lengths are correctly reflected in the plot.

However, plotting an imported morphology looked weird for some reason.

While looking into this, I noticed two things:
Since the cylindrical compartments are straight, they run from one compartment edge to the other on a straight line. However, they model a potentially very zigzaggy branch/path structure. This means:
a) Assuming the comp center is at loc=0.5 along the path (currently how we do it), can put the comp center off axis.
b) Setting the comp length to the path length can result in comps which appear longer than the distance between their two endpoints.
This can be illustrated by adding a bit of noisy to the xyz coordinates of the example above.

Changing the compartment centers to be the center of the cylinder, already produces much better looking plots.

While I dont think changing b) makes sense (apart from for visualization maybe) I think changing a) might be a good idea.
Lemme know your thoughts.
PR is missing documentation, some cleanup and handling of single point cases.