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.
- Compute line segment centre points and their squared distance from the camera.
- Perform a highly parallelized sort on the GPU.
- Generate an index buffer containing a series of vertex pairs.
- 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.
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.
What's likely to be tricky here is:
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.