Expanded color scheme (CLUT)

Category: Image Display
Author:
Description: Apply customized Color Lookup Table (CLUT) to images. New color schemes are taken from "Scientific Colour Maps" by F. Crameri (Scientific colour-maps. http://doi.org/10.5281/zenodo.1243862 or www.fabiocrameri.ch/colourmaps.php). A precompiled plugin "Set Customized CLUT (v.1.21).gt3" is included with the zipped file. It have been tested to run successfully in GMS 2.3 (64-bit version) and GMS 3.4. In GMS 3.4, the script palette "Set Color Scheme" is registered as a technique "Image Color" under the technique group "Custom". In GMS 2.3, the script palette "Set Color Scheme" may not show up automatically when first installed. Need to find and select it from the "Window > Floating Windows" menu. The core function to set customized CLUT can also be assessed via scripting without going through UI. For example, the following script can set the CLUT of the front image to "hawaii" alloc(VDH_ApplyCustomizedClut).ApplyClutToImage("hawaii", GetFrontImage()) To apply "inverted" CLUT, just add an additional option flag. alloc(VDH_ApplyCustomizedClut).ApplyClutToImage("hawaii", GetFrontImage(), 1) or hold-down the ALT-key when click on the UI buttons.
Comments: The attached zipped file contains the scripts and tag group file needed to build the plugin. Tag group file "ScientificColorMaps5_Clut_v1.1.gtg" contains the CLUT's. The script "Build Set Color package (v1.21).s". will build the script plugin. It should be noted that there appears to be a "bug" (or a feature) in the AddScriptFileToPackage() function in both GMS 2.3 and 3.4 where the tag group added by AddTagsToPackage() will not "stay" in the script package if it is executed prior to AddScriptFileToPackage(). The current workaround is to execute the AddTagsToPackage() again. Last, main script file "Apply Customized CLUT (v1.21).s" is written for GMS 3.4 (however, the built plugin can also be used for GMS 2.3 directly). If you need to build plugin for GMS 2.x exclusively, please use the "Apply Customized CLUT (v1.21) - GMS2.s" instead.
Acknowledgements: Crameri, F. (2018). Scientific colour-maps. Zenodo. http://doi.org/10.5281/zenodo.1243862
Script version: 1..21
DM/GMS version: 2.3 and above
Hardware: n/a
Script written as a function: Yes
Source: Show code
Download Source Code: Download
Download Zip File: Download