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

In need of per-streamline linewidth #860

Open
VincentBeaud opened this issue Feb 5, 2024 · 0 comments
Open

In need of per-streamline linewidth #860

VincentBeaud opened this issue Feb 5, 2024 · 0 comments

Comments

@VincentBeaud
Copy link

VincentBeaud commented Feb 5, 2024

Is your feature request related to a problem? Please describe.
I need to visualize tractography streamlines that have different widths (representing axonal diameters), but I can only provide the actor.streamtube function with a single linewidth.

Describe the solution you'd like
I'd like for actor functions that accept a linewidth argument (Ex: actor.streamtube, actor.line) to also accept an arraylike version for per-streamline width.

Describe alternatives you've considered

I have tried looping through each streamline and adding them separately to the scene, with no success.


s = window.Scene()
    for i, line in enumerate(tractogram.streamlines[:5]):
        line_actor = actor.streamtube(line, colors=[1., 0., 0.], opacity=0.5, linewidth=diameters[i])
        s.add(line_actor)

When using this alternative:

  • actor.line gets me a memory error:
malloc(): invalid size (unsorted)
Abandon (core dumped)
  • actor.streamtube gets me an empty scene, no matter what other actor I add to the scene. It kills the thing 😅

Edit:
This solution actually works by changing it to ... actor.streamtube([line], .... The errors were simply related to that.
It's a suboptimal solution, but my problem is fixed for now. I'll keep the issue open as the feature still seems relevant and rather quick to add.

Additional context
An example of what I'm trying to achieve, but with variable streamline widths:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants