Visualisation of streamlines terminations

I have on many occasions been asked about Figures 5-7 in the Anatomically-Constrained Tractography article, which demonstrate the effects that the ACT method has on the locations of streamlines terminations. There are two different techniques used in the figures in this manuscript, which I’ll explain here in full.

Density maps

Figure 6 shows streamlines termination density maps : these are 3D maps where the intensity in each voxel reflects the number of streamlines terminations within that voxel. So they’re a bit like Track Density Images (TDIs), except that it’s only the streamlines termination points that contribute to the map, rather than the entire streamline. The easiest way to achieve this approach is with the tckmap command, using the -ends_only option.

Termination points

Figures 5 and 7 display large dots at the streamline endpoints lying within the displayed slab, in conjunction with the streamlines themselves and a background image. This can be achieved as follows:

  • Use the tckresample command with the -endpoints option to generate a new track file that contains only the two endpoints of each streamline.
  • Load this track file into mrview.
  • Within the mrview tractography tool, for the “Geometry” option, select “Points”.

This will display each streamline point as a dot, rather than drawing lines between each streamline point. Since this track file contains only two points per streamline, corresponding to the streamline endpoints, this means that a dot is drawn at each streamline endpoint.

In Figure 7 specifically, each streamline endpoint is coloured red; this is easy, as it simply involves setting a fixed colour for the particular track file corresponding to the streamline endpoints. Figure 5 is slightly trickier, as it includes “contrasting” colours for those terminations. This requires some image editing trickery:

  • Display only the streamline endpoints track file.

  • Colour each “track” according to direction (this will colour each point according to the “direction” between the two endpoints).

  • Disable display of the main image (shortcut key “M”), and disable all other tools/geometry (so that only the termination points are visible).

  • Take a screenshot.

  • Disable the streamline endpoints track file within the tractography tool, set up whatever background image / tracks you wish to also be included in your final image, and take another screenshot. Make sure to not move the view focus or resize the mrview window, so that the two screenshots will overlay directly on top of one another.

  • Open the two screenshots using image editing software such as GIMP.

  • In Figure 5, the specific trick I used was to take the endpoint termination screenshot, and rotate the hue by 180 degrees: this provides a pseudo-random coloring of the termination points that contrasts well against the surrounding tracks.

  • Within the image editing software, make the screenshot that contains the termination points transparent by selecting all black pixels (i.e. those where no termination points exist) and deleting them. You may need to explicitly add a transparency layer to the image first for this to work.

  • Overlay the termination point image on top of the second screenshot. In GIMP, you can use “Copy” -> “Paste as new layer”.