Skip to content

ENH mrview: Improved tractogram rendering with transparency #3416

Description

@Lestropie

MRtrix 0.2 MRView had the capability to draw tractograms reasonably well with transparency, by drawing vertices as points and sorting the whole tractogram from back to front based on camera position. This hasn't propagated to MRtrix3 because it's very clunky.

It might be possible to get something working reasonably well with some AI help and use of the new GPU compute capabilities.

  1. Compute line segment centre points and their squared distance from the camera.
  2. Perform a highly parallelized sort on the GPU.
  3. Generate an index buffer containing a series of vertex pairs.
  4. Modify the draw call to treat each successive pair of vertices as constituting a single line (i.e. no longer a strip for each streamline with sentinel delimiters).

What's likely to be tricky here is:

  • An individual tractogram may be partitioned into separate chunks, but the tractogram would need to be sorted as a singular data structure so that the resulting singular index buffer can reference any line segment.
  • There may be multiple tractograms loaded; same problem.
    Indeed different tractograms may have different visual properties ascribed to them. So most likely it would be necessary to embed more features into VAOs and have shaders performing branching rather than recompiling shaders based on tractogram-specific features.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions