-
Notifications
You must be signed in to change notification settings - Fork 81
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
Add line actor #334
Add line actor #334
Conversation
Hi @paulbrodersen, thanks for this. I've marked the PR as draft, but feel free to mark as ready for review whenever. Please reach out if we can be of any help (you're welcome to join our Zulip chat). Some of the team are away at the moment, so we may be slower to respond than normal. |
Hi @adamltyson, thanks for the quick feedback and the invite to Zulip. I guess the purpose of submitting the PR in its current form was to gauge the appetite for this additional functionality, before I commit any more time understanding the testing and documentation infrastructure, and make the necessary changes there. So any feedback on that front would be welcome. I appreciate that any additional functionality incurs maintenance costs, and that this is a particular trivial piece of code for anyone familiar with the code base. However, from the perspective of a new user -- unburdened by knowledge of any internals as I was just this morning -- it wasn't clear at all to me how to draw a line in brainrender, even after reading the entire documentation and most examples. So either the documentation needs some more love, or brainrender needs at least one more drawing primitive such as this |
Sorry @paulbrodersen, I didn't say anything along those lines because I thought it was obviously a good addition! As you say, it's a bit of an oversight to not be able to just draw a simple line. As far as I know we have lots of line-like things (neurons, cylinders, streamlines), but not actually a line! I'm going to tag @IgorTatarnikov who has worked on the brainrender codebase more than me recently to see if he's aware of any duplication, but as far as I'm concerned this is a nice addition. Our contributing guide is here if you haven't seen it, but we don't have any
Hope this helps. As I say, get in touch anytime. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #334 +/- ##
==========================================
+ Coverage 86.39% 86.47% +0.07%
==========================================
Files 26 27 +1
Lines 1213 1220 +7
==========================================
+ Hits 1048 1055 +7
Misses 165 165 ☔ View full report in Codecov by Sentry. |
Summary of further changes
NotesRegarding testing, Adam's suggestion above
turned out to be more complicated than I thought. I couldn't identify any attributes in the underlying Regarding the documentation, I have kept my additions in line with the style and the level of detail of the documentation for the other actors. However, in my opinion, the whole section needs an overhaul. It completely lacks concrete examples ("Show, don't tell"), as well as any details beyond the mandatory arguments for each class. I am happy to take a first stab at fleshing out the actor documentation a bit more (in another PR) but as I am unfamiliar with many of the actor classes, this will require the commitment of at least one maintainer to proofread and to fill in the remaining gaps in the same fashion. |
@paulbrodersen that all sounds reasonable to me. I will review this PR in a couple of days when I have some time to play with it properly. Thanks again!
Also sounds reasonable. Any contribution to the docs would be extremely valuable. Feel free to contribute whatever you can, every little helps! |
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.
Sorry for the delay in getting back to you @paulbrodersen - I put a small comment below, but the docstring looks good to me! In other parts of brainglobe we're trying to move all docstrings to numpydoc
format, but as brainrender
seems to universally use the :param
style this fits well here.
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.
Looks great, thanks @paulbrodersen. I've left some minor comments (sorry it's an easy PR to review so I've been very picky!), alongside @K-Meech's.
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 @paulbrodersen looks great! I will release a new version today.
Before submitting a pull request (PR), please read the contributing guide.
Please fill out as much of this template as you can, but if you have any problems or questions, just leave a comment and we will help out :)
Description
What is this PR
Why is this PR needed?
3D drawing primitives are typically points, lines, and surfaces/volumes.
While there are simple ways to add points and volumes to a scene in brainrender, there seems to be no straightforward way to add a simple line to a scene. The available options seem to be to import a line via a neuron .swc morphology file, or (potentially) to import a (to me still mysterious) streamlines .json file.
What does this PR do?
This PR implements a simple
Line
actor class and adds it to theactors
namespace.References
Could not find any related issues but also didn't peruse the tracker exhaustively.
How has this PR been tested?
This script visualizes the (pre-computed) shortest path within cortex boundaries between two cortical neurons.
Is this a breaking change?
No.
Does this PR require an update to the documentation?
Yes, but as this is a draft PR, I haven't bothered with updating the documentation, yet.
Checklist: