The default colormap in Digital Micrograph is greyscale, but different applications or communities ofter use other colour look-up tables (CLUT) to highlight certain features or present data more artistically. You can see your colour scale choices in DM by right-clicking on an image and selecting “ImageDisplay…” or by pressing ctrl+D, then selecting ‘Display’ > ‘Color’, you will see something like this:
You will see a 16×16 array of increasing shades (256 in total) that defines the colormap.The most direct (but most painful) way to create a new colormap is to click on each of these squares and adjust the colour values, when you’re done click ‘Save’. That requires you to make 256 individual, and smoothly graduated, selections and is rather painful.
Instead, we can create the necessary colormap using scripting; in this example by using Matlab.
The first thing to know is that DM just stores the colormaps in a hidden folder in the installation as a 16×16 pixel RGB image. Once you know that it’s just a case of creating the right sort of image and storing it in the right place.
Creating the RGB Colormap
First, we will use Matlab to create the RGB image we need from one of its in built colormaps.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
clear all % Create a dummy figure with no content: figure % Create the colormap: colormap hot(256) cmap = colormap ; % Reshap this to an RGB image: RGB = reshape(cmap,16,16,3) ; % Transpose to suit DM order: RGB = permute(RGB,[2 1 3]) ; % Write this image to disk: imwrite(RGB,'RGB.tiff') % Close the dummy figure: close all
This will give you a colour image file on the disk, as a TIFF, which has the correct properties for the next stage.
At 16×16 pixels it doesn’t look like much but it’s okay. Next, open this TIFF in Digital Micrograph:
Now save this as both a *.dm3 file and a *.dm4 file. The names of the files should be the same and will be the name of your new colormap in the menu. Finally, both these files should be copied to a hidden folder in the Gatan installation at:
while replacing **Username** with your own user name. If that folder doesn’t exist you should create it.
Select the new colormap and you’re done!