Color Maps

Applicable version(s):

Development version

by Simone Manini, Orobix Srl, Italy

This tutorial demonstrates how to handle different color maps while rendering a data array in a vmtk viewer script.


Overview

Color maps are available in the following scripts:

  • vmtkcenterlineviewer
  • vmtkmeshviewer
  • vmtkpathlineanimator
  • vmtksurfaceviewer

At the moment there are 4 different color maps currently implemented in vmtk:

  • grayscale
  • rainbow
  • cooltowarm (default one)
  • blackbody

There is also the possibility to set the number of colors to be used in selected color map. By default a discrete number of colors (256) are used.

Figure 1 Figure 1: vmtk color maps. From top to bottom: cooltowarm (default), rainbow, blackbody and grayscale.

vmtkmeshviewer -ifile surface.vtp -array pressure -legend 1

Figure 2 Figure 2: Cooltowarm color map (default) with 256 colors (default)

vmtkmeshviewer -ifile surface.vtp -array pressure -legend 1 -numberofcolors 8

Figure 3 Figure 3: Cooltowarm color map (default) with 8 colors

vmtkmeshviewer -ifile surface.vtp -array pressure -colormap rainbow -legend 1

Figure 4 Figure 4: Rainbow blue to red color map (default) with 256 colors (default)

vmtkmeshviewer -ifile surface.vtp -array pressure -legend 1 -colormap rainbow -numberofcolors 8

Figure 5 Figure 5: Rainbow blue to red color map with 8 colors

vmtkmeshviewer -ifile surface.vtp -array pressure -colormap blackbody -legend 1

Figure 6 Figure 6: Blackbody radiation color map with 256 colors (default)

vmtkmeshviewer -ifile surface.vtp -array pressure -legend 1 -colormap blackbody -numberofcolors 8

Figure 7 Figure 7: Blackbody radiation color map with 8 colors

vmtksurfaceviewer -ifile surface.vtp -array pressure -legend 1 -colormap grayscale

Figure 8 Figure 8: Grayscale color map with 256 colors (default)

vmtksurfaceviewer -ifile surface.vtp -array pressure -legend 1 -colormap grayscale -numberofcolors 8

Figure 9 Figure 9: Grayscale color map with 8 colors